fix(callbacks/v2): OnTimeoutPacket blocked by UnmarshalPacketData error (backport #8856)#8911
Merged
srdtrk merged 3 commits intorelease/v10.5.xfrom Apr 22, 2026
Merged
Conversation
…or (#8856) * fix(callbacks/v2): return nil on UnmarshalPacketData error in OnTimeoutPacket OnTimeoutPacket propagates UnmarshalPacketData errors, blocking the packet timeout lifecycle. This is inconsistent with OnSendPacket (line 124) and OnAcknowledgementPacket (line 254), both of which return nil on the same error, allowing the packet lifecycle to continue unblocked. The inconsistency is also visible in the comments: - OnSendPacket: "is not blocked if the packet does not opt-in to callbacks" (line 123) - OnAcknowledgementPacket: same comment (line 252) - OnTimeoutPacket: comment was missing (now added) The V1 callbacks middleware does not have this inconsistency because it uses a different pattern (GetSourceCallbackData combining unmarshal and callback data extraction). Impact: If a packet's payload cannot be unmarshalled by the callbacks middleware (e.g., codec version mismatch), the timeout transaction reverts entirely. The underlying app's OnTimeoutPacket has already executed the refund (line 317-320), but the revert rolls back all state changes. Since the packet has already timed out on the destination chain and cannot be received, the sender's funds become permanently locked with no recovery path. This aligns with the principle stated at line 359: "callback execution errors are not allowed to block the packet lifecycle." * docs: added deleted comment * docs: added CHANGELOG entry --------- Co-authored-by: srdtrk <srdtrk@hotmail.com> (cherry picked from commit 0e8a117) # Conflicts: # CHANGELOG.md
Contributor
Author
|
Cherry-pick of 0e8a117 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
PR author is not in the allowed authors list. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v10.5.x #8911 +/- ##
==================================================
Coverage ? 62.54%
==================================================
Files ? 288
Lines ? 20812
Branches ? 0
==================================================
Hits ? 13016
Misses ? 7230
Partials ? 566
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
srdtrk
approved these changes
Apr 22, 2026
7 tasks
srdtrk
added a commit
that referenced
this pull request
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OnTimeoutPacket propagates UnmarshalPacketData errors, blocking the packet timeout lifecycle. This is inconsistent with OnSendPacket (line 124) and OnAcknowledgementPacket (line 254), both of which return nil on the same error, allowing the packet lifecycle to continue unblocked.
The inconsistency is also visible in the comments:
The V1 callbacks middleware does not have this inconsistency because it uses a different pattern (GetSourceCallbackData combining unmarshal and callback data extraction).
Impact: If a packet's payload cannot be unmarshalled by the callbacks middleware (e.g., codec version mismatch), the timeout transaction reverts entirely. The underlying app's OnTimeoutPacket has already executed the refund (line 317-320), but the revert rolls back all state changes. Since the packet has already timed out on the destination chain and cannot be received, the sender's funds become permanently locked with no recovery path.
This aligns with the principle stated at line 359: "callback execution errors are not allowed to block the packet lifecycle."
This is an automatic backport of pull request #8856 done by Mergify.