Skip to content

fix(canton): prod testnet send and manual-exec for ccip-cli and ccip-sdk#278

Open
SyedAsadKazmi wants to merge 3 commits into
mainfrom
fix/canton-prod-testnet-cli-sdk
Open

fix(canton): prod testnet send and manual-exec for ccip-cli and ccip-sdk#278
SyedAsadKazmi wants to merge 3 commits into
mainfrom
fix/canton-prod-testnet-cli-sdk

Conversation

@SyedAsadKazmi

Copy link
Copy Markdown
Contributor

Fix Canton prod testnet CCIP flows (Sepolia ↔ Canton) in ccip-tools-ts. Canton support already exists; this patch set addresses gaps that blocked prod testnet lanes.

SDK fixes

  • Correct ACS template package names for prod testnet (ccip-runtime, etc.)
  • Fix CCIPReceiver resolution and requiredCCVs matching on execute
  • Fix CCV override handling for token-pool manual exec
  • Fix Canton send/execute details (fee token config, gas limit encoding, ledger scoping)
  • Honor chainId in canton-config when synchronizer alias is generic (global) so prod testnet resolves to canton:TestNet instead of defaulting to canton:DevNet

CLI fixes

  • Resolve -r / --indexer / ccvs from canton-config where appropriate
  • Filter mixed --rpc lists so EVM endpoints aren’t raced against Canton ledger URLs
  • Pass message receiver hash to Canton manual-exec by default
  • Avoid redundant source tx re-fetch in show after send

Known limitations / workarounds

  • --only-get-fee on Canton source — not useful today; Canton has no scalar upfront fee (getFee returns 0). Real cost is computed in the on-chain send command.

    • [TODO: implement Canton fee quoting or document EDS/registry-based estimate]
  • Gas estimation on Canton sourceestimateReceiveExecution calls typeAndVersion on the source OnRamp/router; CantonChain.typeAndVersion is not implemented, so positive --estimate-gas-limit fails for Canton→EVM sends. **

    • [TODO: implement Canton OnRamp typeAndVersion or a Canton-specific gas estimator]
  • Workaround: pass --estimate-gas-limit -101 (skips estimation when <= -100) and set gas explicitly, e.g. -x gasLimit=200000

Tested

  • Sepolia → Canton: data + token send and manual exec
  • Canton → Sepolia: data + token send (with --estimate-gas-limit -101 + -x gasLimit=…)

@SyedAsadKazmi SyedAsadKazmi requested review from a team, PabloMansanet and aelmanaa as code owners June 25, 2026 16:54
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ccip-tools-ts Ready Ready Preview, Comment Jun 26, 2026 3:37pm

Request Review

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

Coverage Report

ℹ tests 968
ℹ suites 261
ℹ pass 968
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 63558.882542

> @chainlink/ccip-cli@1.9.2 test
> node --test

✔ src/commands/e2e-helpers.test.ts (124.230273ms)
Verbose mode enabled
▶ getCtx
  ▶ output — always stdout
    ✔ output.write goes to stdout (2.057254ms)
    ✔ output.table goes to stdout (1.137731ms)
  ✔ output — always stdout (4.808493ms)
  ▶ logger — always stderr
    ✔ logger.info goes to stderr (0.903294ms)
    ✔ logger.warn goes to stderr (0.462923ms)
    ✔ logger.error goes to stderr (0.406528ms)
  ✔ logger — always stderr (2.050472ms)
  ▶ verbose mode
    ✔ logger.debug is a no-op when verbose is false (0.565273ms)
    ✔ logger.debug goes to stderr when verbose is true (1.649324ms)
  ✔ verbose mode (2.427685ms)
  ▶ destroy signal
    ✔ returns a working destroy function (15.186437ms)
    ✔ calling destroy twice does not throw (0.646195ms)
  ✔ destroy signal (16.05206ms)
✔ getCtx (26.421459ms)
▶ lane-latency command
  ✔ should output JSON format correctly (6.864325ms)
  ✔ should resolve chain IDs to chain selectors (0.973474ms)
  ✔ should use custom API URL when provided (4.624229ms)
  ✔ should output log format correctly (0.874159ms)
  ✔ should handle chain IDs as input (0.641747ms)
  ✔ should handle chain selectors as input (1.758698ms)
  ✔ should throw CCIPApiClientNotAvailableError when --no-api flag is set (1.377167ms)
  ✔ should work normally when --no-api flag is false (0.771598ms)
  ✔ should forward blockConfirmations to API URL (0.688564ms)
  ✔ should not include numOfBlocks when blockConfirmations is not provided (0.789ms)
  ▶ CCIP_API environment variable integration
    ✔ should respect CCIP_API=false environment variable (0.599116ms)
  ✔ CCIP_API environment variable integration (0.843803ms)
✔ lane-latency command (22.825527ms)
▶ e2e command lane EVM v1.5
  ✔ should show lane config Sepolia -> Fuji (v1.5) in JSON (5207.862043ms)
  ✔ should show lane config Sepolia -> Fuji (v1.5) in pretty format (4423.330386ms)
✔ e2e command lane EVM v1.5 (9633.208286ms)
▶ e2e command lane EVM v2.0
  ✔ should show lane config Sepolia -> Fuji (v2.0) in JSON (3035.947918ms)
✔ e2e command lane EVM v2.0 (3036.187585ms)
▶ e2e command lane EVM <-> Aptos (v1.6)
  ✔ should show lane config Sepolia -> Aptos (v1.6) (4044.107201ms)
  ✔ should show lane config Aptos -> Sepolia (v1.6) (3427.204335ms)
✔ e2e command lane EVM <-> Aptos (v1.6) (7471.71627ms)
▶ e2e command lane EVM <-> Solana (v1.6)
  ✔ should show lane config Sepolia -> Solana (v1.6) (6131.985009ms)
  ✔ should show lane config Solana -> Sepolia (v1.6) (6045.044176ms)
✔ e2e command lane EVM <-> Solana (v1.6) (12177.371333ms)
▶ e2e command lane EVM <-> TON (v1.6)
  ✔ should show lane config TON -> Sepolia (v1.6) (25638.065253ms)
  ✔ should show lane config Sepolia -> TON (v1.6) (17597.329932ms)
✔ e2e command lane EVM <-> TON (v1.6) (43235.794068ms)
▶ selectRequest non-interactive behavior
  ✔ returns the single request without prompting (1.525603ms)
  ✔ returns the request matching logIndex (0.199142ms)
  ✔ throws CCIPInteractiveRequiredError for multiple requests without logIndex (1.622424ms)
✔ selectRequest non-interactive behavior (5.184575ms)
▶ CCIPInteractiveRequiredError
  ✔ has correct code and is not transient (0.293146ms)
  ✔ uses default recovery when none provided (0.405535ms)
  ✔ preserves context fields (0.258462ms)
✔ CCIPInteractiveRequiredError (1.154051ms)
▶ preprocessArgv TTY auto-detection
  ✔ --interactive flag is defined in globalOpts (0.356765ms)
✔ preprocessArgv TTY auto-detection (0.557299ms)
▶ search messages command
  ✔ should throw CCIPApiClientNotAvailableError when --no-api flag is set (2.490552ms)
  ✔ should output JSON format correctly (12.984743ms)
  ✔ should pass sender filter to API (2.810649ms)
  ✔ should pass receiver filter to API (3.555647ms)
  ✔ should resolve source chain to selector (2.615035ms)
  ✔ should resolve dest chain to selector (2.427615ms)
  ✔ should pass manual-exec-only filter to API (2.670548ms)
  ✔ should treat limit 0 as unlimited (5.685989ms)
  ✔ should respect limit parameter (6.458128ms)
  ✔ should warn when no results found (1.279565ms)
  ✔ should use custom API URL when provided (3.058831ms)
  ✔ should warn on negative limit and fall back to default (1.807499ms)
  ✔ should output log format (2.152883ms)
✔ search messages command (52.083814ms)
▶ e2e command show EVM
  ▶ pretty format (default)
    ✔ should show complete CCIP transaction details EVM to EVM (9031.281728ms)
  ✔ pretty format (default) (9032.572874ms)
  ▶ json format
    ✔ should output a single valid JSON envelope with all expected fields (6303.244227ms)
  ✔ json format (6303.532384ms)
  ▶ log format
    ✔ should output in log format with object assignments (7494.621282ms)
  ✔ log format (7494.944084ms)
  ▶ verbose flag
    ✔ should work with verbose flag enabled (6872.353979ms)
  ✔ verbose flag (6872.656082ms)
  ▶ error handling
    ✔ should handle invalid transaction hash gracefully (33498.152578ms)
    ✔ should require transaction hash argument (1687.329087ms)
  ✔ error handling (35185.793556ms)
  ✔ should show complete CCIP transaction details EVM to Aptos (7827.289542ms)
  ✔ should show complete CCIP transaction details EVM to Solana (6628.199661ms)
✔ e2e command show EVM (79347.112704ms)
▶ e2e command show Solana
  ✔ should show complete CCIP transaction details Solana to EVM (5016.836156ms)
✔ e2e command show Solana (5017.146475ms)
▶ e2e command show Aptos
  ✔ should show complete CCIP transaction details Aptos to EVM (14930.461464ms)
✔ e2e command show Aptos (14930.662921ms)
﹣ e2e command show TON (0.062777ms) # SKIP
▶ formatCCIPError
  ✔ should return null for non-CCIPError instances (1.926491ms)
  ✔ should format CCIPError with code and message (0.8266ms)
  ✔ should include help section with recovery hint (0.309698ms)
  ✔ should include note section for transient errors (0.353499ms)
  ✔ should include retry timing for transient errors with retryAfterMs (0.843823ms)
  ✔ should not include note section for permanent errors (0.276025ms)
  ✔ should format error with structured output (0.419542ms)
  ✔ should include stack trace when verbose is true (0.508417ms)
  ✔ should not include stack trace when verbose is false (0.26849ms)
✔ formatCCIPError (8.161131ms)
▶ yieldResolved
  ✔ throws if a promise rejects while the generator is paused after a yield (16.624055ms)
✔ yieldResolved (16.877978ms)
▶ canton/signer
  ▶ Ed25519TransactionSigner constructor
    ✔ constructs with a valid 64-char hex seed (6.384179ms)
    ✔ constructs with a 0x-prefixed seed (0.589478ms)
    ✔ throws when seed is too short (0.953718ms)
    ✔ throws when seed is too long (0.252321ms)
    ✔ throws when seed contains non-hex characters (0.231ms)
    ✔ computes the correct Canton fingerprint (0.99763ms)
    ✔ produces different fingerprints for different seeds (1.103897ms)
  ✔ Ed25519TransactionSigner constructor (12.591579ms)
  ▶ Ed25519TransactionSigner.sign()
    ✔ returns a PartySignatures structure (1.424294ms)
    ✔ includes the correct party ID (0.813796ms)
    ✔ produces a signature with correct properties (1.047232ms)
    ✔ produces a valid Ed25519 signature (64 bytes) (0.632108ms)
    ✔ produces a cryptographically valid signature (1.444773ms)
    ✔ produces different signatures for different hashes (0.650583ms)
    ✔ produces different signatures for different signers (same hash) (0.890871ms)
    ✔ handles empty hash (edge case) (0.530539ms)
  ✔ Ed25519TransactionSigner.sign() (8.610118ms)
  ▶ Ed25519TransactionSigner.getFingerprint()
    ✔ returns the fingerprint computed during construction (0.484363ms)
    ✔ returns a 68-character hex string (0.446291ms)
  ✔ Ed25519TransactionSigner.getFingerprint() (1.101923ms)
  ▶ Integration: multiple signers with same party
    ✔ allows multiple signers for the same party with different keys (0.914364ms)
  ✔ Integration: multiple signers with same party (1.045078ms)
✔ canton/signer (24.387475ms)
▶ fetchChainsFromRpcs
  ✔ lets duplicate tx-hash race endpoints query before aborting losers (14.374683ms)
  ✔ chainGetter: returns chain from first winning endpoint and destroys late arrivals (52.914637ms)
  ✔ chainGetter: resolves a pending request once the endpoint connects (Branch 2) (21.304097ms)
  ✔ chainGetter: rejects with CCIPRpcNotFoundError when all endpoints fail to connect (1.568132ms)
  ✔ chainGetter: rejects immediately with CCIPRpcNotFoundError once family is already exhausted (0.712638ms)
  ✔ txHash: rejects with CCIPTransactionNotFoundError when tx not on any chain (1.059925ms)
  ✔ txHash: Branch-4 (txOnlyRacer) is destroyed via catch when it loses the tx race (10.377292ms)
  ✔ txHash: chain connecting after txFoundIn is set is immediately destroyed without calling getTransaction (23.852559ms)
  ✔ txHash: Branch-2 chain given to a pending chainGetter is NOT destroyed when it cannot find the tx (13.022442ms)
  ✔ txFoundIn shared across families: SVM txOnlyRacer is destroyed after EVM wins (35.683997ms)
✔ fetchChainsFromRpcs (177.787281ms)
▶ isCantonLedgerUrl
  ✔ matches Canton JSON Ledger API paths (0.172031ms)
  ✔ does not match EVM JSON-RPC URLs (0.188791ms)
✔ isCantonLedgerUrl (0.494251ms)
▶ filterEndpointsForFamily
  ✔ gives Canton only ledger URLs (0.16136ms)
  ✔ gives EVM only non-ledger URLs (0.114974ms)
✔ filterEndpointsForFamily (0.366202ms)
▶ resolveRouter
  ✔ returns explicit CLI -r for any source family (0.215272ms)
  ✔ returns undefined for EVM source without -r (0.086651ms)
✔ resolveRouter (0.392161ms)
▶ resolveCliIndexer
  ✔ prefers explicit CLI --indexer values (0.212727ms)
  ✔ falls back to canton-config indexerUrl when the lane involves Canton (0.105456ms)
  ✔ does not fall back to canton-config indexerUrl for EVM-only lanes (0.098313ms)
  ✔ returns undefined when neither CLI nor config provides an indexer (0.076322ms)
✔ resolveCliIndexer (0.627139ms)
▶ resolveCliRouter
  ✔ prefers explicit CLI -r on Canton source (0.124672ms)
  ✔ prefers explicit CLI -r on EVM source even when canton-config has senderInstanceId (0.08007ms)
  ✔ falls back to canton-config senderInstanceId for Canton source (0.078917ms)
  ✔ does not fall back to senderInstanceId for EVM source (0.102491ms)
✔ resolveCliRouter (0.519619ms)
ℹ tests 112
ℹ suites 38
ℹ pass 112
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 103567.483779
---------------------------------------|---------|----------|---------|---------|-------------------
File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------------------------|---------|----------|---------|---------|-------------------
All files                              |   73.91 |    78.17 |   59.42 |   73.91 |                   
 ccip-cli/src                          |   90.16 |    59.25 |      75 |   90.16 |                   
  index.ts                             |   90.16 |    59.25 |      75 |   90.16 | ...68-169,175-180 
 ccip-cli/src/commands                 |   52.56 |    72.26 |   61.66 |   52.56 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  lane-latency.ts                      |   72.56 |     90.9 |   33.33 |   72.56 | ...,63-70,105-111 
  lane.ts                              |   85.25 |       70 |     100 |   85.25 | ...34-137,141-143 
  manual-exec.ts                       |   21.94 |      100 |       0 |   21.94 | ...33-143,145-317 
  parse.ts                             |   57.14 |      100 |       0 |   57.14 | 46-50,57-64,66-91 
  search.ts                            |   81.25 |      100 |       0 |   81.25 | 24-29             
  send.ts                              |      14 |      100 |       0 |      14 | ...90-221,223-500 
  show.ts                              |   78.33 |    61.72 |     100 |   78.33 | ...16-319,349-350 
  supported-tokens.ts                  |   16.85 |      100 |       0 |   16.85 | ...61-335,337-350 
  token.ts                             |   22.72 |      100 |       0 |   22.72 | ...3,60-67,69-132 
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   87.96 |    75.32 |   96.42 |   87.96 | ...91-601,609-617 
 ccip-cli/src/commands/search          |   49.19 |    82.85 |    12.5 |   49.19 |                   
  messages.ts                          |   49.19 |    82.85 |    12.5 |   49.19 | ...89-211,213-248 
 ccip-cli/src/providers                |   60.97 |    86.72 |      45 |   60.97 |                   
  aptos.ts                             |   51.47 |      100 |       0 |   51.47 | ...,95-96,105-136 
  canton.ts                            |   85.39 |    96.29 |      90 |   85.39 | 179-197,248-267   
  evm.ts                               |    36.3 |      100 |       0 |    36.3 | ...69-104,116-168 
  index.ts                             |   83.97 |    82.71 |      90 |   83.97 | ...20-222,289-337 
  solana.ts                            |   47.44 |      100 |       0 |   47.44 | ...02-103,112-137 
  sui.ts                               |   64.28 |      100 |       0 |   64.28 | 10-14             
  ton.ts                               |   15.03 |      100 |       0 |   15.03 | 24-153            
 ccip-sdk/src                          |   95.04 |    85.15 |   93.84 |   95.04 |                   
  chain.ts                             |   94.12 |    74.65 |   81.25 |   94.12 | ...2224,2257-2258 
  commits.ts                           |   72.47 |    95.23 |      50 |   72.47 | 75-123            
  execution.ts                         |   92.45 |    92.59 |     100 |   92.45 | 137-144,156-163   
  explorer.ts                          |     100 |      100 |     100 |     100 |                   
  extra-args.ts                        |     100 |    89.47 |     100 |     100 | 213,248,285,300   
  fetch.ts                             |   98.76 |     94.8 |   97.14 |   98.76 | ...66-567,643-644 
  gas.ts                               |   93.28 |    61.29 |     100 |   93.28 | ...92-196,250-261 
  http-status.ts                       |     100 |      100 |     100 |     100 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  messages.ts                          |   88.53 |    45.09 |     100 |   88.53 | ...30-231,255-256 
  networks.ts                          |     100 |      100 |     100 |     100 |                   
  offchain.ts                          |   94.19 |       80 |     100 |   94.19 | ...25-227,236-237 
  requests.ts                          |   94.41 |    86.62 |     100 |   94.41 | ...23-624,649-654 
  supported-chains.ts                  |     100 |      100 |     100 |     100 |                   
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   96.83 |     90.6 |     100 |   96.83 | ...56-357,598-606 
 ccip-sdk/src/api                      |   90.48 |       85 |   88.88 |   90.48 |                   
  index.ts                             |   90.48 |       85 |   88.88 |   90.48 | ...03-806,809-812 
 ccip-sdk/src/aptos                    |   62.46 |    69.76 |   61.01 |   62.46 |                   
  exec.ts                              |   29.31 |      100 |       0 |   29.31 | 18-58             
  hasher.ts                            |   75.89 |       80 |   66.66 |   75.89 | 17-36,50-56       
  index.ts                             |    66.5 |    77.14 |   64.28 |    66.5 | ...1008,1012-1023 
  logs.ts                              |   86.86 |    52.72 |   85.71 |   86.86 | ...08-214,216-227 
  send.ts                              |    25.8 |      100 |       0 |    25.8 | ...2,63-80,93-124 
  token.ts                             |   23.75 |       75 |     100 |   23.75 | 35-156            
  types.ts                             |   65.97 |      100 |       0 |   65.97 | 26-33,65-89       
 ccip-sdk/src/canton                   |   33.84 |    90.47 |   11.22 |   33.84 |                   
  ccv-addresses.ts                     |     100 |    91.42 |     100 |     100 | 18,21             
  events.ts                            |   33.13 |      100 |       0 |   33.13 | ...65-477,483-492 
  index.ts                             |   27.22 |       80 |     4.1 |   27.22 | ...2111,2114-2116 
  types.ts                             |   88.05 |      100 |       0 |   88.05 | 55-62,149-159     
 ccip-sdk/src/canton/client            |   56.35 |     61.9 |   21.21 |   56.35 |                   
  client.ts                            |   54.46 |       60 |   21.21 |   54.46 | ...08-727,742-762 
  index.ts                             |     100 |      100 |     100 |     100 |                   
 ...dk/src/canton/explicit-disclosures |   74.44 |    68.86 |   52.17 |   74.44 |                   
  acs.ts                               |   87.37 |    68.57 |   88.88 |   87.37 | ...07,561,581-582 
  eds.ts                               |   54.79 |      100 |       0 |   54.79 | ...79-386,390-395 
 ccip-sdk/src/canton/token-metadata    |   62.64 |      100 |       0 |   62.64 |                   
  client.ts                            |   62.64 |      100 |       0 |   62.64 | 104-163,170-174   
 ...dk/src/canton/transfer-instruction |   52.15 |      100 |       0 |   52.15 |                   
  client.ts                            |   52.15 |      100 |       0 |   52.15 | 92-175,182-186    
 ccip-sdk/src/errors                   |    86.8 |    74.13 |   48.09 |    86.8 |                   
  CCIPError.ts                         |     100 |      100 |     100 |     100 |                   
  codes.ts                             |     100 |      100 |     100 |     100 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  pure.ts                              |     100 |       75 |     100 |     100 | 32                
  recovery.ts                          |     100 |      100 |     100 |     100 |                   
  specialized.ts                       |   83.81 |    68.96 |   45.16 |   83.81 | ...3609,3746-3755 
  utils.ts                             |   94.44 |    81.48 |     100 |   94.44 | 15,17,22,24       
 ccip-sdk/src/evm                      |   87.78 |    77.52 |   91.95 |   87.78 |                   
  const.ts                             |     100 |      100 |     100 |     100 |                   
  errors.ts                            |   89.87 |    79.24 |     100 |   89.87 | ...76,224-227,232 
  extra-args.ts                        |   94.47 |    61.01 |     100 |   94.47 | ...11-212,328-340 
  fork.test.data.ts                    |     100 |      100 |     100 |     100 |                   
  gas.ts                               |   97.97 |    53.33 |     100 |   97.97 | 72-73,75          
  hasher.ts                            |     100 |     92.3 |     100 |     100 | 135               
  index.ts                             |      80 |    75.63 |   88.88 |      80 | ...2377,2379-2426 
  logs.ts                              |    99.4 |    92.39 |     100 |    99.4 | 62-63             
  messages.ts                          |     100 |      100 |     100 |     100 |                   
  offchain.ts                          |   81.25 |    33.33 |     100 |   81.25 | 11,13-14          
  types.ts                             |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/evm/viem                 |   79.76 |    90.62 |   69.23 |   79.76 |                   
  client-adapter.ts                    |     100 |       90 |     100 |     100 | 48,74             
  index.ts                             |     100 |      100 |     100 |     100 |                   
  wallet-adapter.ts                    |   63.09 |     90.9 |   55.55 |   63.09 | ...91-124,131-157 
 ccip-sdk/src/hasher                   |   94.29 |    78.94 |     100 |   94.29 |                   
  common.ts                            |     100 |      100 |     100 |     100 |                   
  hasher.ts                            |     100 |    66.66 |     100 |     100 | 19                
  index.ts                             |     100 |      100 |     100 |     100 |                   
  merklemulti.ts                       |   93.43 |       78 |     100 |   93.43 | ...06-307,315-316 
 ccip-sdk/src/shared                   |   90.29 |    76.92 |     100 |   90.29 |                   
  bcs-codecs.ts                        |   90.15 |       75 |     100 |   90.15 | 75-87             
  constants.ts                         |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/solana                   |   75.73 |    69.74 |   81.11 |   75.73 |                   
  cleanup.ts                           |   26.95 |    66.66 |   33.33 |   26.95 | ...59-101,114-227 
  exec.ts                              |   69.11 |    62.96 |   66.66 |   69.11 | ...69-473,513-514 
  fork.test.data.ts                    |     100 |      100 |     100 |     100 |                   
  gas.ts                               |   92.06 |    68.57 |     100 |   92.06 | ...,81-90,170-171 
  hasher.ts                            |   96.49 |    81.81 |     100 |   96.49 | 64-67             
  index.ts                             |    79.1 |    74.48 |   83.01 |    79.1 | ...1771,1775-1808 
  logs.ts                              |   65.54 |     60.6 |     100 |   65.54 | ...28-129,134-141 
  offchain.ts                          |     100 |      100 |     100 |     100 |                   
  patchBorsh.ts                        |   78.31 |       50 |     100 |   78.31 | ...47,65-66,72-78 
  send.ts                              |    77.6 |    33.33 |      80 |    77.6 | ...52-360,403-442 
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   72.91 |    66.66 |   72.72 |   72.91 | ...42-444,476-491 
 ccip-sdk/src/sui                      |    34.7 |    86.66 |      20 |    34.7 |                   
  discovery.ts                         |   14.86 |      100 |       0 |   14.86 | ...49-185,188-222 
  events.ts                            |   30.76 |       50 |      25 |   30.76 | ...19-288,310-311 
  exec.ts                              |   31.81 |      100 |       0 |   31.81 | 32-75,87-132      
  hasher.ts                            |   98.18 |    66.66 |     100 |   98.18 | 34,50             
  index.ts                             |   39.55 |    93.18 |   18.91 |   39.55 | ...17-818,822-823 
  objects.ts                           |   18.93 |      100 |       0 |   18.93 | ...33-184,195-338 
 ccip-sdk/src/sui/manuallyExec         |   54.12 |       75 |      50 |   54.12 |                   
  encoder.ts                           |    83.9 |    66.66 |     100 |    83.9 | 51-58,73-77,82    
  index.ts                             |   34.35 |      100 |       0 |   34.35 | 46-131            
 ccip-sdk/src/ton                      |   79.17 |     77.7 |   79.26 |   79.17 |                   
  exec.ts                              |     100 |      100 |     100 |     100 |                   
  extra-args.ts                        |   98.66 |    72.72 |     100 |   98.66 | 156-157,222       
  hasher.ts                            |   78.07 |    77.77 |      75 |   78.07 | 100-108,156-187   
  index.ts                             |   75.72 |    71.75 |    65.9 |   75.72 | ...1363,1370-1371 
  logs.ts                              |     100 |    94.54 |     100 |     100 | 74-79,111         
  send.ts                              |   95.93 |       70 |     100 |   95.93 | 37-44             
  types.ts                             |   91.24 |    81.25 |     100 |   91.24 | ...61-63,71-74,92 
  utils.ts                             |    63.1 |    77.77 |    90.9 |    63.1 | ...37-395,397-400 
---------------------------------------|---------|----------|---------|---------|-------------------

@RodrigoAD RodrigoAD left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @SyedAsadKazmi for the fixes! Left you some comments. Although we should get a review from @andrevmatos

Comment thread ccip-cli/src/commands/send.ts Outdated
const sourceNetwork = networkInfo(argv.source)
const destNetwork = networkInfo(argv.dest)
const cantonConfig = loadCantonConfig(argv.cantonConfig, logger)
const router = resolveCliRouter(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's probably best to not have chain specific logic inside the CLI commands. This affects to other resolve... functions.

Something like this, that follows other patterns like fetchChainsFromRpcs might be better

// providers/index.ts
function resolveRouter(argv, sourceNetwork) {
   const cantonConfig = loadCantonConfig(argv.cantonConfig)
   // ...

@andrevmatos can you give us your thoughts here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved router/indexer resolution into providers/index.ts as resolveRouter / resolveIndexer, following the same pattern as fetchChainsFromRpcs (commands pass argv + network/chain context; canton-config loading stays in the providers layer). Low-level helpers remain in canton.ts for unit tests.

}

/** Extract RawInstanceAddress.unpack strings from a list field on createArgument. */
function extractStringListField(createArgument: unknown, fieldName: string): string[] {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This function is quite hard to understand, what's its purpose? Can we simplify it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Split the monolithic extractStringListField into smaller helpers:

  • readCreateArgumentField - flat object or { fields: [{ label, value }] }
  • asLedgerList - bare array vs { list } / { elements }
  • extractRawInstanceAddressUnpack - one RawInstanceAddress entry -> unpack hex
  • extractRequiredCCVs - composes the above for CCIPReceiver requiredCCVs

Removed the separate requiredCCVsLength helper; callers use extractRequiredCCVs(...).length when needed.

Comment thread ccip-sdk/src/canton/ccv-addresses.ts Outdated
import { id as keccak256Utf8 } from 'ethers'

/** Normalize a hex CCV InstanceAddress for comparison (lowercase, no 0x). */
export function normalizeCcvHex(value: string): string {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've seen this in acs.ts too. Let's avoid the duplication. Also, I think there's some general utils in the repo for this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Consolidated the duplicated helpers into utils.ts:

  • Exported normalizeHex, hashedUtf8Hex, and isCantonPartyId
  • acs.ts and ccv-addresses.ts now import these instead of local copies (removed the duplicate isCantonPartyId / normalizeHex in acs.ts and normalizeCcvHex in ccv-addresses.ts)
  • getAddressBytes uses hashedUtf8Hex for Canton party hashing as well

Comment thread ccip-sdk/src/canton/index.ts Outdated
tokenMetadataClient: TokenMetadataClient,
ccipParty: string,
indexerUrl = MAINNET_INDEXER_URLS[0]!,
ledgerParty?: string,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should probably make this required, defaulting to ccipParty doesn't make too much sense for users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made ledgerParty required on the constructor and fromClient, removed the ?? ccipParty fallback, and updated the CantonConfig docs to clarify party (user ledger / actAs) vs ccipParty (CCIP operator). fromUrl now validates that ctx.cantonConfig.party is set and passes it through explicitly.

Comment thread ccip-sdk/src/utils.ts Outdated
}

/** Daml party ID: `hint::1220<64-hex-fingerprint>` (not a 3-part instrument id). */
function isCantonPartyId(address: string): boolean {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as other utilities, I've seen them duplicated in different places.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved with this.

@RodrigoAD RodrigoAD left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@SyedAsadKazmi LGTM, let's wait for @andrevmatos 👍

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