From 84961e6a20ea4aecbe0bedd0d4d8add207126cc5 Mon Sep 17 00:00:00 2001 From: Ava Howell Date: Mon, 24 Jun 2024 12:34:55 -0700 Subject: [PATCH 1/3] ibc: fix logging of timestamp timeouts --- crates/core/component/ibc/src/component/packet.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core/component/ibc/src/component/packet.rs b/crates/core/component/ibc/src/component/packet.rs index 5bbd9dc186..ee754baac6 100644 --- a/crates/core/component/ibc/src/component/packet.rs +++ b/crates/core/component/ibc/src/component/packet.rs @@ -161,7 +161,7 @@ pub trait SendPacketRead: StateRead { if packet.timeout_timestamp <= chain_ts.nanoseconds() { anyhow::bail!( "timeout timestamp {} is less than the latest timestamp on the counterparty {}", - packet.timeout_height, + packet.timeout_timestamp, chain_ts, ); } From 02785e4d0e866ac22fff20ccbd5af3d8f5b41145 Mon Sep 17 00:00:00 2001 From: Chris Czub Date: Mon, 24 Jun 2024 15:37:34 -0400 Subject: [PATCH 2/3] Update packet.rs Signed-off-by: Chris Czub --- crates/core/component/ibc/src/component/packet.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core/component/ibc/src/component/packet.rs b/crates/core/component/ibc/src/component/packet.rs index ee754baac6..6c3eb464cd 100644 --- a/crates/core/component/ibc/src/component/packet.rs +++ b/crates/core/component/ibc/src/component/packet.rs @@ -162,7 +162,7 @@ pub trait SendPacketRead: StateRead { anyhow::bail!( "timeout timestamp {} is less than the latest timestamp on the counterparty {}", packet.timeout_timestamp, - chain_ts, + chain_ts.nanoseconds(), ); } From 6e09f6659c50e8ed498aab808e5b1494296e47f3 Mon Sep 17 00:00:00 2001 From: Ava Howell Date: Mon, 24 Jun 2024 12:48:57 -0700 Subject: [PATCH 3/3] use consensus state timestamp instead of update time --- crates/core/component/ibc/src/component/packet.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/core/component/ibc/src/component/packet.rs b/crates/core/component/ibc/src/component/packet.rs index 6c3eb464cd..032986f079 100644 --- a/crates/core/component/ibc/src/component/packet.rs +++ b/crates/core/component/ibc/src/component/packet.rs @@ -155,14 +155,12 @@ pub trait SendPacketRead: StateRead { // check that the timeout timestamp hasn't already passed in the local client tracking // the receiving chain - let chain_ts = self - .get_client_update_time(&connection.client_id, &latest_height) - .await?; - if packet.timeout_timestamp <= chain_ts.nanoseconds() { + let chain_ts = latest_consensus_state.timestamp.unix_timestamp_nanos() as u64; + if packet.timeout_timestamp <= chain_ts { anyhow::bail!( "timeout timestamp {} is less than the latest timestamp on the counterparty {}", packet.timeout_timestamp, - chain_ts.nanoseconds(), + chain_ts, ); }