Skip to content

Commit

Permalink
Improve redundant packet logs (#4254)
Browse files Browse the repository at this point in the history
* Output an info log if the broadcasted packet is redundant instead of an error

* Fix redundant packet log

* Add additional information in redundant packet log

* Add changelog entry
  • Loading branch information
ljoss17 authored Nov 18, 2024
1 parent f5b58db commit 282b943
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Improve log message when broadcasting redundant packet and set it
to `INFO` instead of `ERROR`.
([\#4252](https://github.com/informalsystems/hermes/issues/4252))
13 changes: 12 additions & 1 deletion crates/relayer/src/chain/cosmos/retry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use core::time::Duration;
use std::thread;

use tracing::{debug, error, instrument, warn};
use tracing::{debug, error, info, instrument, warn};

use ibc_proto::google::protobuf::Any;
use tendermint::abci::Code;
Expand Down Expand Up @@ -149,6 +149,17 @@ async fn do_send_tx_with_account_sequence_retry(
Ok(response)
}

Code::Err(code) if response.log.contains("packet messages are redundant") => {
info!(
?response,
diagnostic = response.log,
?code,
"broadcast tx was not completed, all packets in tx have been relayed already, no fees were consumed"
);

Ok(response)
}

// Gas estimation succeeded, but broadcast_tx_sync failed with unrecoverable error.
Code::Err(code) => {
// Do not increase the account s.n. since CheckTx step of broadcast_tx_sync has failed.
Expand Down

0 comments on commit 282b943

Please sign in to comment.