diff --git a/.changelog/unreleased/improvements/ibc-relayer/3531-fix-3531.md b/.changelog/unreleased/improvements/ibc-relayer/3531-fix-3531.md new file mode 100644 index 0000000000..4c28ea96b5 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3531-fix-3531.md @@ -0,0 +1,2 @@ +- Improve error message when scanning unsupported client + ([\#3531](https://github.com/informalsystems/hermes/issues/3531)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 3cfe9dc0c6..e4473c089b 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -13,7 +13,7 @@ use std::{cmp::Ordering, thread}; use tokio::runtime::Runtime as TokioRuntime; use tonic::codegen::http::Uri; use tonic::metadata::AsciiMetadataValue; -use tracing::{error, info, instrument, trace, warn}; +use tracing::{debug, error, info, instrument, trace, warn}; use ibc_proto::cosmos::{ base::node::v1beta1::ConfigResponse, staking::v1beta1::Params as StakingParams, @@ -1184,11 +1184,9 @@ impl ChainEndpoint for CosmosSdkChain { .filter_map(|cs| { IdentifiedAnyClientState::try_from(cs.clone()) .map_err(|e| { - warn!( - "failed to parse client state {}. Error: {}", - PrettyIdentifiedClientState(&cs), - e - ) + let (client_type, client_id) = (if let Some(client_state) = &cs.client_state { client_state.type_url.clone() } else { "None".to_string() }, &cs.client_id); + warn!("encountered unsupported client type `{}` while scanning client `{}`, skipping the client", client_type, client_id); + debug!("failed to parse client state {}. Error: {}", PrettyIdentifiedClientState(&cs), e) }) .ok() })