[NONEVM-5742] [OffRamp Flow] Add missing support for offchainTokenData - #884
Conversation
5838633 to
eeb01ba
Compare
5afe581 to
2e4a7c0
Compare
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds TON support for offchainTokenData, migrates token administration to a standalone registry, and introduces CCV/fee-query bindings.
Changes:
- Updates CCIP dependencies and registry deployment models.
- Adds Lisp-list and execute-report serialization support.
- Adds token-pool CCV queries, fee getters, and array encoding.
File summaries
| File | Description |
|---|---|
| staging-monitor/go.mod | Updated as part of this pull request. |
| scripts/oplint/lock.nix | Updated as part of this pull request. |
| scripts/oplint/default.nix | Updated as part of this pull request. |
| scripts/.chainlink-ton_version | Updated as part of this pull request. |
| pkg/ccip/ocr/contract_transmitter_test.go | Updated as part of this pull request. |
| pkg/ccip/model/router.go | Updated as part of this pull request. |
| pkg/ccip/model/offramp.go | Updated as part of this pull request. |
| pkg/ccip/chainaccessor/config.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenregistry/tokenregistry.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenpool/types.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenpool/reader.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenpool/lockreleaselockbox/reader.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenpool/lockrelease/reader.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenpool/burnmint/reader.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenadminregistryentry/token_admin_registry_entry.go | Updated as part of this pull request. |
| pkg/ccip/bindings/tokenadminregistry/token_admin_registry.go | Updated as part of this pull request. |
| pkg/ccip/bindings/router/router.go | Updated as part of this pull request. |
| pkg/ccip/bindings/onramp/onramp.go | Updated as part of this pull request. |
| pkg/ccip/bindings/offramp/reader.go | Updated as part of this pull request. |
| pkg/ccip/bindings/offramp/offramp.go | Updated as part of this pull request. |
| pkg/ccip/bindings/offramp/offramp_test.go | Updated as part of this pull request. |
| pkg/ccip/bindings/offramp/exitcode_string.go | Updated as part of this pull request. |
| pkg/ccip/bindings/ccipsendexecutor/ccipsendexecutor.go | Updated as part of this pull request. |
| pkg/bindings/index.go | Updated as part of this pull request. |
| integration-tests/model/router_test.go | Updated as part of this pull request. |
| integration-tests/go.mod | Updated as part of this pull request. |
| integration-tests/deployment/ccip/token_adapter_test.go | Updated as part of this pull request. |
| integration-tests/deployment/ccip/cs_transfer_ownership_test.go | Updated as part of this pull request. |
| integration-tests/deployment/ccip/cs_test.go | Updated as part of this pull request. |
| go.sum | Updated as part of this pull request. |
| go.mod | Updated as part of this pull request. |
| flake.nix | Updated as part of this pull request. |
| devenv/go.mod | Updated as part of this pull request. |
| deployment/testadapter/test_adapter.go | Updated as part of this pull request. |
| deployment/state/state.go | Updated as part of this pull request. |
| deployment/go.mod | Updated as part of this pull request. |
| deployment/ccip/sequence/deploy_ccip.go | Updated as part of this pull request. |
| deployment/ccip/cs_test_helpers.go | Updated as part of this pull request. |
| deployment/ccip/config/deploy.go | Updated as part of this pull request. |
| deployment/ccip/1_6_0/sequences/tokens.go | Updated as part of this pull request. |
| deployment/ccip/1_6_0/sequences/deploy_chain_contracts.go | Updated as part of this pull request. |
| contracts/wrappers/TokenAdminRegistryEntry.compile.ts | Updated as part of this pull request. |
| contracts/wrappers/TokenAdminRegistry.compile.ts | Updated as part of this pull request. |
| contracts/wrappers/tests.examples.LispList.compile.ts | Updated as part of this pull request. |
| contracts/wrappers/gen/ccip/TokenRegistry.ts | Updated as part of this pull request. |
| contracts/wrappers/gen/ccip/test/MockAdvancedPoolHooks.ts | Updated as part of this pull request. |
| contracts/wrappers/gen/ccip/MerkleRoot.ts | Updated as part of this pull request. |
| contracts/wrappers/firedrill/FiredrillOffRamp.ts | Updated as part of this pull request. |
| contracts/tests/gas-report/ccip/messaging/OnRamp.spec.ts | Updated as part of this pull request. |
| contracts/tests/gas-report/ccip/messaging/OffRamp.spec.ts | Updated as part of this pull request. |
| contracts/tests/gas-report/ccip/messaging/FeeQuoter.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/sendExecutor/SendExecutor.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/router/Router.Setup.ts | Updated as part of this pull request. |
| contracts/tests/ccip/receiveExecutor/ReceiveExecutor.execution.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/pools/LockReleaseTokenPool.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/pools/LockReleaseLockboxTokenPool.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/pools/BurnMintTokenPool.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/onramp/OnRamp.Setup.ts | Updated as part of this pull request. |
| contracts/tests/ccip/onramp/OnRamp.send.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/onramp/OnRamp.generateMessageID.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/onramp/OnRamp.executorExited.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/offramp/OffRamp.Setup.ts | Updated as part of this pull request. |
| contracts/tests/ccip/offramp/OffRamp.execute.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/merkleRoot/MerkleRoot.spec.ts | Updated as part of this pull request. |
| contracts/tests/ccip/e2e/CCIPSendWithTokenTransfer.spec.ts | Updated as part of this pull request. |
| contracts/scripts/generateContractsPkg.ts | Updated as part of this pull request. |
| contracts/contracts/firedrill/firedrill_offramp.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_registry/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_registry/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_registry/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry/storage.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry/events.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry/errors.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry_entry/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry_entry/storage.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry_entry/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry_entry/errors.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/token_admin_registry_entry/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/test/mock_advanced_pool_hooks.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/router/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/router/storage.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/router/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/router/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/receive_executor/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/receive_executor/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/receive_executor/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/TokenPool.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/lock_release/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/lock_release/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/lock_release_lockbox/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/lock_release_lockbox/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/lib/token_pool/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/burn_mint/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/pools/burn_mint/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/onramp/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/onramp/storage.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/onramp/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/onramp/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/offramp/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/offramp/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/offramp/errors.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/offramp/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/merkle_root/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/merkle_root/contract.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/ccipsend_executor/types.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/ccipsend_executor/messages.tolk | Updated as part of this pull request. |
| contracts/contracts/ccip/ccipsend_executor/contract.tolk | Updated as part of this pull request. |
| contracts/Acton.toml | Updated as part of this pull request. |
| cmd/chainlink-ton/lock.nix | Updated as part of this pull request. |
| cmd/chainlink-ton/default.nix | Updated as part of this pull request. |
| cmd/chainlink-ton-extras/lock.nix | Updated as part of this pull request. |
| cmd/chainlink-ton-extras/default.nix | Updated as part of this pull request. |
| cciplib/ccip/codec/msghasher_test.go | Updated as part of this pull request. |
| cciplib/ccip/codec/executecodec.go | Updated as part of this pull request. |
| cciplib/ccip/codec/executecodec_test.go | Updated as part of this pull request. |
| cciplib/ccip/bindings/onramp/onramp.go | Updated as part of this pull request. |
| cciplib/ccip/bindings/onramp/onramp_test.go | Updated as part of this pull request. |
| cciplib/ccip/bindings/ocr/executereport.go | Updated as part of this pull request. |
| cciplib/ccip/bindings/ocr/executereport_test.go | Updated as part of this pull request. |
| cciplib/ccip/bindings/common/common.go | Updated as part of this pull request. |
| .github/workflows/dependabot-lock-nix-fixup.yml | Updated as part of this pull request. |
Review details
Suppressed comments (3)
contracts/contracts/ccip/offramp/types.tolk:17
- This says no-token reports use an empty outer list, but
onExecuteSingleReportimmediately requiresoffchainTokenData.asSingle(), so the valid wire shape is a singleton outer list whose inner list is empty. Please document the required[[]]shape here (or change the contract validation) so the ABI contract is not misleading.
// An empty list when the report carries no token transfers; otherwise each
// outer entry is a message and each inner entry is that message's token-data blob.
contracts/contracts/ccip/onramp/contract.tolk:280
- OnRamp derives the registry entry from its own
executor.deployableCode, while the registry derives the same address fromst.entryDeployment.deployableCode. These are independent storage fields and can differ when a registry is reused or upgraded, so token sends can query an uninitialized address even though registration succeeded. Use the registry's canonical deployment code or enforce a code-hash match during configuration.
tokenRegistry = TokenAdminRegistryEntry.deriveAddress(
deployables.getExecutorDeployment().deployableCode,
token,
deployables.getTokenAdminRegistry(),
).calculateAddress();
deployment/ccip/1_6_0/sequences/tokens.go:572
RegisterTokenderives the entry address inside the registry using its storedentryDeployment.deployableCode, but this sequence derives it from locally retrievedcompiledContracts. If the datastore points to an existing registry deployed from another package/version, the hashes differ: registration deploys one address while this wait polls another and checks the local entry code. Read the registry's configured deployment or reject a package/version mismatch before registering.
- Files reviewed: 138/139 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
698b0ad to
8059c47
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Address the reported serialization, forwarding, retry, documentation, and integration-coverage issues.
Get a fresh assessment by requesting another Copilot review.
Review details
Files not reviewed (1)
- pkg/ccip/bindings/offramp/exitcode_string.go: Generated file
Suppressed comments (2)
cciplib/ccip/bindings/common/common.go:598
ToCelldoes not enforce the same chain-depth bound asLoadFromCell, so a report with more than 512 off-chain entries can be serialized into a list that the TVM/decoder cannot consume, after doing unbounded work. Reject lists overMaxCellChainDepthbefore building the chain (and cover the boundary in a test).
func (l LispList[T]) ToCell() (*cell.Cell, error) {
tail := tvm.EmptyCell
for i, v := range l {
contracts/contracts/ccip/offramp/contract.tolk:950
- The new forwarding path is only exercised with
Cell.EMPTYin the end-to-end token-transfer/PTT tests, andgetTokenTransferdeliberately converts that sentinel tonull. A regression in nested-list decoding or forwarding the actual blob would therefore pass; add a non-empty offchain-data case and assert that theTokenPool_ReleaseOrMintInV1request contains the blob.
val registryAddress = TokenAdminRegistryEntry.deriveAddress(
- Files reviewed: 27/28 changed files
- Comments generated: 3
- Review effort level: Lite
| self.transfer = transfer.toCell(); | ||
| return self |
There was a problem hiding this comment.
Hey @krebernisak what's the desired behaviour here?
| let tokenData = offchainTokenData | ||
| if (tokenData === undefined) { | ||
| tokenData = messages.map((msg) => | ||
| msg.tokenAmounts ? msg.tokenAmounts.map(() => Cell.EMPTY) : [], |
…ta` (#884) * feat: ExecuteReport now includes offchainTokenData (lisp_list) * ref: lisp_list<lisp_list<cell>> multi message multi token * fix: chainReport.OffchainTokenData could be nil * doc: oudated comment * test: offchainTokenData gets to the TokenPool
NONEVM-5742
followup: #889