Skip to content

Commit

Permalink
use consensus state timestamp instead of update time
Browse files Browse the repository at this point in the history
  • Loading branch information
avahowell committed Jun 24, 2024
1 parent 02785e4 commit 6e09f66
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/core/component/ibc/src/component/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}

Expand Down

0 comments on commit 6e09f66

Please sign in to comment.