diff --git a/.changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md b/.changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md new file mode 100644 index 0000000000..3ed50bd279 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md @@ -0,0 +1,6 @@ +- Improve logs when clearing packet. + * When Hermes doesn't pull packet data it will now warn the user + instead of logging `pulled packet data for 0 events out of X` + * When ICS20 packets are filtered due to having a receiver or memo + field too big, the log will be at `warn` level instead of `debug`. + ([\#4072](https://github.com/informalsystems/hermes/issues/4072)) \ No newline at end of file diff --git a/crates/relayer/src/link/packet_events.rs b/crates/relayer/src/link/packet_events.rs index a1e78ad980..0d105ed645 100644 --- a/crates/relayer/src/link/packet_events.rs +++ b/crates/relayer/src/link/packet_events.rs @@ -41,14 +41,21 @@ where Ok(events) => { events_left -= chunk.len(); - info!( - events.total = %events_total, - events.left = %events_left, - "pulled packet data for {} events out of {} sequences: {};", - events.len(), - chunk.len(), - chunk.iter().copied().collated().format(", "), - ); + if events.is_empty() && !chunk.is_empty() { + warn!("no packet data was pulled at height {query_height} for sequences {}, this might be due to the data not being available on the configured endpoint. \ + Please verify that the RPC endpoint has the required packet data, for more details see https://hermes.informal.systems/advanced/troubleshooting/cross-comp-config.html#uncleared-pending-packets", + chunk.iter().copied().collated().format(", ")); + } else { + info!( + events.total = %events_total, + events.left = %events_left, + "pulled packet data for {} out of {} events: {}", + events.len(), + chunk.len(), + chunk.iter().copied().collated().format(", "), + ); + } + // Because we use the first event height to do the client update, // if the heights of the events differ, we get proof verification failures. diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 63abf46be3..04a34947b9 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -1947,7 +1947,7 @@ impl RelayPath { } } -#[tracing::instrument(skip(data))] +#[tracing::instrument(skip_all)] fn check_ics20_fields_size( data: &[u8], memo_limit: Ics20FieldSizeLimit, @@ -1962,9 +1962,9 @@ fn check_ics20_fields_size( (ValidationResult::Valid, ValidationResult::Valid) => true, (memo_validity, receiver_validity) => { - debug!("found invalid ICS-20 packet data, not relaying packet!"); - debug!(" ICS-20 memo: {memo_validity}"); - debug!(" ICS-20 receiver: {receiver_validity}"); + warn!("found invalid ICS-20 packet data, not relaying packet!"); + warn!(" ICS-20 memo: {memo_validity}"); + warn!(" ICS-20 receiver: {receiver_validity}"); false }