Skip to content

fix(callbacks/v2): OnTimeoutPacket blocked by UnmarshalPacketData error (backport #8856)#8911

Merged
srdtrk merged 3 commits intorelease/v10.5.xfrom
mergify/bp/release/v10.5.x/pr-8856
Apr 22, 2026
Merged

fix(callbacks/v2): OnTimeoutPacket blocked by UnmarshalPacketData error (backport #8856)#8911
srdtrk merged 3 commits intorelease/v10.5.xfrom
mergify/bp/release/v10.5.x/pr-8856

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Apr 22, 2026

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."


This is an automatic backport of pull request #8856 done by Mergify.

…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
@mergify mergify Bot added the conflicts label Apr 22, 2026
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Apr 22, 2026

Cherry-pick of 0e8a117 has failed:

On branch mergify/bp/release/v10.5.x/pr-8856
Your branch is up to date with 'origin/release/v10.5.x'.

You are currently cherry-picking commit 0e8a1170.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   modules/apps/callbacks/v2/ibc_middleware.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   CHANGELOG.md

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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 22, 2026

PR author is not in the allowed authors list.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/v10.5.x@c990bce). Learn more about missing BASE report.

Files with missing lines Patch % Lines
modules/apps/callbacks/v2/ibc_middleware.go 50.00% 1 Missing ⚠️
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           
Flag Coverage Δ
08-wasm 66.28% <ø> (?)
e2e 1.18% <ø> (?)
ibc-go 68.96% <50.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@srdtrk srdtrk removed the conflicts label Apr 22, 2026
@srdtrk srdtrk merged commit 84c5bad into release/v10.5.x Apr 22, 2026
47 checks passed
@srdtrk srdtrk deleted the mergify/bp/release/v10.5.x/pr-8856 branch April 22, 2026 09:39
srdtrk added a commit that referenced this pull request Apr 22, 2026
…tData error (backport #8856) (#8911)" (#8912)

* revert: "fix(callbacks/v2): OnTimeoutPacket blocked by UnmarshalPacketData error (backport #8856) (#8911)"

This reverts commit 84c5bad.

* docs: keep style imp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants