diff --git a/.changelog/unreleased/bug-fixes/1239-consider-client-expired-at-trusting-period.md b/.changelog/unreleased/bug-fixes/1239-consider-client-expired-at-trusting-period.md new file mode 100644 index 000000000..3f2ecbcd2 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/1239-consider-client-expired-at-trusting-period.md @@ -0,0 +1,3 @@ +- [ibc-client-tendermint] Expire a client when the elapsed time from a trusted + header equals the trusting period, to stay consistent with the expiry logic in + `tendermint-rs` ([\#1239](https://github.com/cosmos/ibc-rs/issues/1239)) diff --git a/ibc-clients/ics07-tendermint/src/client_state/validation.rs b/ibc-clients/ics07-tendermint/src/client_state/validation.rs index 116b84dd8..4a7f7f6a3 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/validation.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/validation.rs @@ -221,7 +221,10 @@ where if let Some(elapsed_since_latest_consensus_state) = now.duration_since(&latest_consensus_state.timestamp().into()) { - if elapsed_since_latest_consensus_state > client_state.trusting_period { + // Note: The equality is considered as expired to stay consistent with + // the check in tendermint-rs, where a header at `trusted_header_time + + // trusting_period` is considered expired. + if elapsed_since_latest_consensus_state >= client_state.trusting_period { return Ok(Status::Expired); } }