Commit 59d2ea2
* fix(callbacks/v2): OnTimeoutPacket blocked by UnmarshalPacketData error (#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
* docs: fix conflict
---------
Co-authored-by: Mefai <95135443+mefai-dev@users.noreply.github.com>
Co-authored-by: srdtrk <srdtrk@hotmail.com>
1 parent db1d5bd commit 59d2ea2
2 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | 65 | | |
68 | 66 | | |
| 67 | + | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
323 | 324 | | |
324 | | - | |
| 325 | + | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| |||
0 commit comments