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 beacd27 commit ef6e114
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;
if packet.timeout_timestamp <= chain_ts.unix_timestamp_nanos() as u64 {
anyhow::bail!(
"timeout timestamp {} is less than the latest timestamp on the counterparty {}",
packet.timeout_timestamp,
chain_ts.nanoseconds(),
chain_ts.unix_timestamp_nanos(),
);
}

Expand Down

0 comments on commit ef6e114

Please sign in to comment.