Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibc: fix timeouts: use client height and timestamp #4638

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions crates/core/component/ibc/src/component/msg_handler/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,18 @@ impl MsgHandler for MsgTimeout {
.context("failed to get connection")?
.ok_or_else(|| anyhow::anyhow!("connection not found for channel"))?;

let chain_ts = state
.get_client_update_time(&connection.client_id, &self.proof_height_on_b)
let client_state = state.get_client_state(&connection.client_id).await?;
let last_consensus_state = state
.get_verified_consensus_state(&client_state.latest_height(), &connection.client_id)
.await?;
let chain_height = self.proof_height_on_b;
let last_update_time = last_consensus_state.timestamp;
let proof_update_height = self.proof_height_on_b;

// check that timeout height or timeout timestamp has passed on the other end
if !self.packet.timed_out(&chain_ts, chain_height) {
if !self
.packet
.timed_out(&last_update_time.into(), proof_update_height)
{
anyhow::bail!("packet has not timed out on the counterparty chain");
}

Expand Down
Loading