Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix timeout processing #59

Merged
merged 1 commit into from
Sep 5, 2022
Merged

Fix timeout processing #59

merged 1 commit into from
Sep 5, 2022

Conversation

Wizdave97
Copy link

@Wizdave97 Wizdave97 commented Sep 5, 2022

Timeout messages should be processed successfully if either the timestamp or timeout height is reached.

Packet timeout calculation should be true at exactly the timeout height and timestamp specified in the packet, not at a block higher or timestamp higher
Reference https://github.com/cosmos/ibc-go/blob/main/modules/core/04-channel/keeper/timeout.go#L70-L73

if let Expiry::Expired = packet_timestamp.check_expiry(&proof_timestamp) {
return Err(Error::packet_timeout_timestamp_not_reached(
packet_timestamp,
if !packet.timed_out(&proof_timestamp, proof_height) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we check that the timestamp isn't zero before doing this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zero timestamp is represented as None internally and
packet.timed_out function checks that with this self.timeout_timestamp != Timestamp::none()

@seunlanlege seunlanlege merged commit 9925f24 into master Sep 5, 2022
@seunlanlege seunlanlege deleted the david/packet-timeout-fix branch September 5, 2022 19:44
@Wizdave97 Wizdave97 self-assigned this Sep 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants