Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recover from gas simulation failures on legacy chains #3793

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading