Skip to content

Fix: Correct gas estimate for 2.0 solana receiver - #566

Open
PabloMansanet wants to merge 1 commit into
mainfrom
fix/solana-estimate-receiver-v2
Open

PabloMansanet wants to merge 1 commit into
mainfrom
fix/solana-estimate-receiver-v2

Conversation

@PabloMansanet

Copy link
Copy Markdown
Collaborator

No description provided.

@PabloMansanet
PabloMansanet requested a review from a team as a code owner November 23, 2026 12:01
@vercel

vercel Bot commented Nov 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ccip-tools-ts Ready Ready Preview Nov 23, 2026 12:01pm UTC

Request Review

@github-actions

Copy link
Copy Markdown

👋 PabloMansanet, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

CI Test Report

❌ Lint (npm run check) failed — tests did not run.

Lint failure output (npm run check)
> @chainlink/ccip-tools-ts@1.18.0 check
> npm run lint && npm run typecheck && npm run generate:lint


> @chainlink/ccip-tools-ts@1.18.0 lint
> npm run lint --workspaces && npm run generate:lint


> @chainlink/ccip-sdk@1.18.0 lint
> oxfmt --check ./src && oxlint ./src

Checking formatting...

All matched files use the correct format.
Finished in 111ms on 727 files using 4 threads.
Found 0 warnings and 0 errors.
Finished in 3.2s on 724 files with 106 rules using 4 threads.

> @chainlink/ccip-cli@1.18.0 lint
> oxfmt --check ./src && oxlint ./src

Checking formatting...

All matched files use the correct format.
Finished in 8ms on 43 files using 4 threads.
Found 0 warnings and 0 errors.
Finished in 729ms on 43 files with 106 rules using 4 threads.

> @chainlink/ccip-api-ref@1.18.0 lint
> oxfmt --check . && oxlint .

Checking formatting...

All matched files use the correct format.
Finished in 536ms on 171 files using 4 threads.
Found 0 warnings and 0 errors.
Finished in 1.8s on 121 files with 106 rules using 4 threads.

> @chainlink/ccip-tools-ts@1.18.0 generate:lint
> npm run generate -- --dry


> @chainlink/ccip-tools-ts@1.18.0 generate
> node ./scripts/generate.cjs `grep -lrn '^\s*//\s*generate\b' ./ccip-sdk/src ./ccip-cli/src` --dry

up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_5/usdc-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_1/burn-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_5/usdc-token-pool-cctp-v2.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_1/siloed-lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_1/lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_1/burn-to-address-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_2/usdc-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_2/factory-burn-mint-erc20.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/cctp-through-ccv-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/burn-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/burn-from-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/siloed-lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/token-pool-factory.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/siloed-usdc-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/burn-to-address-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/cross-chain-pool-token.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/burn-with-from-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/advanced-pool-hooks.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/erc20-lockbox.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V2_0_0/cross-chain-token.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_1/burn-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_1/lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_1/usdc-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_1/burn-to-address-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_1/factory-burn-mint-erc20.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_0/siloed-lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_6_0/registry-module-owner-custom.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_0/token-admin-registry.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_0/burn-mint-token-pool-and-proxy.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_0/registry-module-owner-custom.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/abi/V1_5_0/lock-release-token-pool-and-proxy.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/burn-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/burn-mint-with-lock-release-flag-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/siloed-lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/burn-from-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/lock-release-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/burn-to-address-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/cross-chain-pool-token.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/advanced-pool-hooks.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/burn-with-from-mint-token-pool.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/erc20-lockbox.ts
up-to-date ccip-sdk/src/cct/evm/artifacts/bytecode/V2_0_0/cross-chain-token.ts
up-to-date ccip-sdk/src/cct/evm/token-admin-registry/operations/transfer-admin.test.ts
up-to-date ccip-sdk/src/cct/evm/token-admin-registry/operations/accept-admin.test.ts
generated ccip-sdk/src/api/index.ts
generated ccip-cli/src/index.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/LOCK_RELEASE_TOKEN_POOL.ts
up-to-date ccip-sdk/src/evm/abi/TokenAdminRegistry_1_5.ts
up-to-date ccip-sdk/src/evm/abi/LockReleaseTokenPool_1_6_1.ts
up-to-date ccip-sdk/src/evm/abi/MultiTokenPool_2_1.ts
up-to-date ccip-sdk/src/evm/abi/OnRamp_2_0.ts
up-to-date ccip-sdk/src/evm/abi/CCTPVerifier_2_0.ts
up-to-date ccip-sdk/src/evm/abi/OffRamp_2_0.ts
up-to-date ccip-sdk/src/evm/abi/TokenPool_2_0.ts
up-to-date ccip-sdk/src/evm/abi/RMNProxy.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/BASE_TOKEN_POOL.ts
up-to-date ccip-sdk/src/evm/abi/OnRamp_1_6.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/BURN_MINT_TOKEN_POOL.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/CCIP_OFFRAMP.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/CCIP_ROUTER.ts
up-to-date ccip-sdk/src/evm/abi/BurnMintERC677Token.ts
up-to-date ccip-sdk/src/evm/abi/PriceRegistry_1_2.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/FEE_QUOTER.ts
up-to-date ccip-sdk/src/evm/abi/OnRamp_1_5.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/CCIP_COMMON.ts
up-to-date ccip-sdk/src/evm/abi/CommitStore_1_5.ts
up-to-date ccip-sdk/src/evm/abi/OnRamp_1_2.ts
up-to-date ccip-sdk/src/evm/abi/Router.ts
up-to-date ccip-sdk/src/evm/abi/FeeQuoter_2_0.ts
up-to-date ccip-sdk/src/solana/idl/1.6.0/CCIP_CCTP_TOKEN_POOL.ts
up-to-date ccip-sdk/src/evm/abi/VersionedVerifierResolver_2_0.ts
up-to-date ccip-sdk/src/evm/abi/OffRamp_1_6.ts
up-to-date ccip-sdk/src/evm/abi/PoolConfigManager_2_1.ts
up-to-date ccip-sdk/src/evm/abi/CommitStore_1_2.ts
up-to-date ccip-sdk/src/evm/abi/USDCTokenPoolProxy_2_0.ts
up-to-date ccip-sdk/src/evm/abi/LockReleaseTokenPool_1_5.ts
up-to-date ccip-sdk/src/evm/abi/OffRamp_1_2.ts
up-to-date ccip-sdk/src/evm/abi/LockReleaseTokenPool_1_5_1.ts
up-to-date ccip-sdk/src/evm/abi/OffRamp_1_5.ts
up-to-date ccip-sdk/src/evm/abi/FeeQuoter_1_6.ts
up-to-date ccip-sdk/src/evm/abi/CCIPReceiver_2_0.ts
generated ccip-sdk/src/selectors.ts
up-to-date ccip-sdk/src/evm/abi/pool-errors.ts

@SyedAsadKazmi SyedAsadKazmi left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the functionality. Working as expected.

@andrevmatos andrevmatos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callback selection follows the separation in #531 and #537. Select the lane first, then use the destination OffRamp version to decide whether to read the receiver registry.

Please fix the missing v2 callback fields and update the manual-exec output. Add a test through the public estimator with one router serving both OffRamps. Verify that 1.6 skips the registry and 2.0 reads it. Cover a writable receiver account and a non-default token delivery mode.

All 102 focused tests and the SDK type check passed locally. Mocked RPC checks confirmed the missing callback fields.

}
}
return estimateExecComputeUnits({
connection: this.connection,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 — Use the v2 destination data to build the callback. This picks the right instruction, but the public estimator does not read the accounts or writable bitmap from executorArgs or destBlob. It also does not pass the token delivery mode or read the signed receiver from tokenAmounts[0].tokenReceiver.

I captured the callback through the public estimator with one writable account. Both the pre-send and post-send paths passed only the three fixed accounts. The post-send token callback also encoded the zero receiver and DeriveAtaAndCreate instead of the message's receiver and UseAsIs.

Please decode executorArgs before send and the signed destBlob after send. Use the decoded accounts and delivery mode for the callback and token setup. Keep the legacy account handling unchanged for a 1.6 OffRamp.

computeUnits: opts.txGasLimit ?? opts.gasLimit,
// only the transaction's limit: `gasLimit` is the receiver callback's budget, which a
// signed 2.0 message fixes, and is far below what the whole `execute_v2` consumes
computeUnits: opts.txGasLimit,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 — Update manual-exec to match this change. ccip-cli/src/commands/manual-exec.ts:279 prints Estimated gasLimit override and sets argv.gasLimit when the estimate exceeds the signed budget. Solana v2 now correctly ignores that field, so the CLI reports an override it does not apply. Please report the receiver estimate as advisory for Solana v2. Note that --tx-gas-limit controls the transaction budget, not the signed receiver budget.

This branch was successfully deployed

1 active deployment
Preview — 8aacafc6 Deployed Nov 23, 2026 by vercel[bot]
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.

3 participants