Skip to content

Commit

Permalink
Recover from gas simulation failures on legacy chains (#3793)
Browse files Browse the repository at this point in the history
Closes: #3792

Co-authored-by: Luca Joss <[email protected]>
  • Loading branch information
mdyring and ljoss17 authored Mar 4, 2024
1 parent df6cd29 commit df29acc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Recover from gas simulation failures on legacy chains.
([\#3792](https://github.com/informalsystems/hermes/issues/3792))
1 change: 1 addition & 0 deletions crates/relayer/src/chain/cosmos/estimate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ fn can_recover_from_simulation_failure(e: &Error) -> bool {
detail.is_client_state_height_too_low()
|| detail.is_account_sequence_mismatch_that_can_be_ignored()
|| detail.is_out_of_order_packet_sequence_error()
|| detail.is_empty_tx_error()
}
_ => false,
}
Expand Down
8 changes: 8 additions & 0 deletions crates/relayer/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,14 @@ impl GrpcStatusSubdetail {
Some((expected, got)) => expected < got,
}
}

/// Check whether this gRPC error message contains the string "invalid empty tx".
///
/// ## Note
/// This error may happen for older chains that does not properly support simulation.
pub fn is_empty_tx_error(&self) -> bool {
self.status.message().contains("invalid empty tx")
}
}

/// Assumes that the cosmos-sdk account sequence mismatch error message, that may be seen
Expand Down

0 comments on commit df29acc

Please sign in to comment.