[NONEVM-5608] Fix Receiver_CCIPReceive potential overflow - #841
Open
duck-types wants to merge 3 commits into
Open
[NONEVM-5608] Fix Receiver_CCIPReceive potential overflow#841duck-types wants to merge 3 commits into
duck-types wants to merge 3 commits into
Conversation
duck-types
force-pushed
the
fix/ccip-receive-overflow
branch
from
August 20, 2026 17:44
50e332c to
8051889
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes potential Receiver_CCIPReceive serialization overflow by moving the message payload into a referenced cell and migrating bindings, scripts, and tests.
Changes:
- Updates Receiver and Router serialization.
- Adds generated Receiver/TestReceiver bindings.
- Migrates deployment scripts, gas reports, and tests.
Final findings:
- Critical (2 votes): The inline-to-reference format is wire-incompatible with deployed 1.6.1 receivers; a compatible or explicitly versioned migration path is needed.
- Critical (3 votes): The gas-report setup references a nonexistent artifact; use
ccip.test.receiver. - Moderate (2 votes): Add a regression test using a 64-byte sender to cover the overflow boundary.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Summary |
|---|---|
contracts/wrappers/link.chain.ton.ccip.lib.Receiver.compile.ts |
Adds Receiver binding compiler configuration. |
contracts/wrappers/libraries/Receiver.ts |
Removes the handwritten serializer. |
contracts/wrappers/gen/index.ts |
Registers generated bindings. |
contracts/wrappers/gen/ccip/TestReceiver.ts |
Adds the generated TestReceiver wrapper. |
contracts/wrappers/gen/ccip/Router.ts |
Updates generated message encoding. |
contracts/wrappers/gen/ccip/Receiver.ts |
Adds the generated Receiver wrapper. |
contracts/wrappers/examples/Receiver.ts |
Updates Receiver metadata usage. |
contracts/tests/gas-report/ccip/messaging/opMapFunc.ts |
Updates opcode mappings. |
contracts/tests/gas-report/ccip/messaging/OffRamp.spec.ts |
Migrates gas-report receiver setup. |
contracts/tests/ExitCode.spec.ts |
Updates generated error references. |
contracts/tests/ccip/router/Router.ccipReceive.spec.ts |
Uses the generated Receiver opcode. |
contracts/tests/ccip/Receiver.spec.ts |
Migrates Receiver tests. |
contracts/tests/ccip/offramp/OffRamp.Setup.ts |
Migrates receiver setup. |
contracts/tests/ccip/offramp/OffRamp.execute.spec.ts |
Migrates behavior calls. |
contracts/scripts/updateReceiverBehavior.ts |
Uses the generated wrapper. |
contracts/scripts/deployReceiver.ts |
Uses the generated wrapper. |
contracts/contracts/lib/receiver/wrapper.tolk |
Adds a binding-generation stub contract. |
contracts/contracts/lib/receiver/messages.tolk |
Stores messages in a referenced cell. |
contracts/contracts/ccip/test/receiver/storage.tolk |
Renames the behavior enum. |
contracts/contracts/ccip/test/receiver/messages.tolk |
Updates enum references. |
contracts/contracts/ccip/test/receiver/contract.tolk |
Loads cell-backed messages. |
contracts/contracts/ccip/router/contract.tolk |
Forwards cell-backed messages. |
contracts/Acton.toml |
Registers Receiver contracts. |
Suppressed comments (1)
contracts/tests/ccip/Receiver.spec.ts:48
- The regression target is not exercised here: the updated receive tests use the fixed
EVM_ADDRESSfixture, whileCrossChainAddressCodecaccepts addresses up to 64 bytes. Add a test that builds/routesReceiver_CCIPReceivewith a 64-byte sender and verifies the message is accepted; otherwise the overflow fix can regress without detecting the original failure.
sender: EVM_ADDRESS,
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
duck-types
force-pushed
the
fix/ccip-receive-overflow
branch
from
August 26, 2026 13:05
6c7414d to
49b3ec2
Compare
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.
NONEVM-5608
Receiver_CCIPReceiveserialization was: 553-1065 bits, 1-2 refs.Long sender can cause an overflow in serialization