Skip to content

Commit 282b943

Browse files
authored
Improve redundant packet logs (#4254)
* 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
1 parent f5b58db commit 282b943

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Improve log message when broadcasting redundant packet and set it
2+
to `INFO` instead of `ERROR`.
3+
([\#4252](https://github.com/informalsystems/hermes/issues/4252))

crates/relayer/src/chain/cosmos/retry.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core::time::Duration;
22
use std::thread;
33

4-
use tracing::{debug, error, instrument, warn};
4+
use tracing::{debug, error, info, instrument, warn};
55

66
use ibc_proto::google::protobuf::Any;
77
use tendermint::abci::Code;
@@ -149,6 +149,17 @@ async fn do_send_tx_with_account_sequence_retry(
149149
Ok(response)
150150
}
151151

152+
Code::Err(code) if response.log.contains("packet messages are redundant") => {
153+
info!(
154+
?response,
155+
diagnostic = response.log,
156+
?code,
157+
"broadcast tx was not completed, all packets in tx have been relayed already, no fees were consumed"
158+
);
159+
160+
Ok(response)
161+
}
162+
152163
// Gas estimation succeeded, but broadcast_tx_sync failed with unrecoverable error.
153164
Code::Err(code) => {
154165
// Do not increase the account s.n. since CheckTx step of broadcast_tx_sync has failed.

0 commit comments

Comments
 (0)