Skip to content

Conversation

@andrevmatos
Copy link
Collaborator

@andrevmatos andrevmatos commented Dec 5, 2025

  • Allow fetching an UnsignedTx object containing raw data, before signature, which can be signed and sent by users.
  • logger injection option
  • get rid of more node stuff on SDK
  • get rid of getWallet methods, now wallet is passed directly to sendMessage, executeReport methods

@andrevmatos andrevmatos self-assigned this Dec 5, 2025
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Coverage Report

ℹ tests 266
ℹ suites 71
ℹ pass 266
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 7886.251902

> @chainlink/[email protected] test
> node --test

▶ e2e command show EVM
  ▶ pretty format (default)
    ✔ should show complete CCIP transaction details EVM to EVM (6494.136373ms)
  ✔ pretty format (default) (6495.066377ms)
  ▶ json format
    ✔ should output valid JSON with all expected fields (5585.017347ms)
  ✔ json format (5585.254008ms)
  ▶ log format
    ✔ should output in log format with object assignments (5704.646563ms)
  ✔ log format (5704.900206ms)
  ▶ verbose flag
    ✔ should work with verbose flag enabled (6432.228101ms)
  ✔ verbose flag (6432.451989ms)
  ▶ error handling
    ✔ should handle invalid transaction hash gracefully (2031.265549ms)
    ✔ should require transaction hash argument (1306.868339ms)
  ✔ error handling (3338.487638ms)
  ✔ should show complete CCIP transaction details EVM to Aptos (6508.495682ms)
  ✔ should show complete CCIP transaction details EVM to Solana (40524.47996ms)
✔ e2e command show EVM (74590.25152ms)
▶ e2e command show Solana
  ✔ should show complete CCIP transaction details Solana to EVM (5126.9568ms)
✔ e2e command show Solana (5127.25716ms)
▶ e2e command show Aptos
  ✔ should show complete CCIP transaction details Aptos to EVM (5415.959067ms)
✔ e2e command show Aptos (5416.136798ms)
ℹ tests 10
ℹ suites 8
ℹ pass 10
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 85262.061444
------------------------|---------|----------|---------|---------|----------------------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                
------------------------|---------|----------|---------|---------|----------------------------------
All files               |   64.89 |    76.35 |   58.28 |   64.89 |                                  
 ccip-cli/src           |   90.47 |      100 |     100 |   90.47 |                                  
  index.ts              |   90.47 |      100 |     100 |   90.47 | 70-71,76-81                      
 ccip-cli/src/commands  |   55.71 |    84.05 |   56.75 |   55.71 |                                  
  index.ts              |     100 |      100 |     100 |     100 |                                  
  manual-exec.ts        |   60.21 |      100 |       0 |   60.21 | 41-98,105-115,117-236            
  parse.ts              |   38.09 |      100 |       0 |   38.09 | 18-22,29-36,38-63                
  send.ts               |   12.91 |      100 |       0 |   12.91 | 37-134,141-148,150-333           
  show.ts               |   93.33 |       88 |     100 |   93.33 | 72-81                            
  supported-tokens.ts   |    22.8 |      100 |       0 |    22.8 | ...,73-80,82-178,180-235,237-250 
  types.ts              |     100 |      100 |     100 |     100 |                                  
  utils.ts              |   85.91 |    82.24 |      90 |   85.91 | ...4,427,429-439,447-455,465-471 
 ccip-cli/src/providers |   63.07 |    62.16 |   22.72 |   63.07 |                                  
  aptos.ts              |    52.8 |      100 |       0 |    52.8 | ...-58,66-70,78-85,91-92,101-125 
  evm.ts                |   44.61 |      100 |       0 |   44.61 | 20,31-65                         
  index.ts              |   83.93 |    58.82 |   83.33 |   83.93 | ...4-136,154-161,167-169,179-193 
  solana.ts             |      50 |      100 |       0 |      50 | ...0-51,59-71,79-85,89-90,99-118 
 ccip-sdk/src           |   93.74 |    87.92 |   95.55 |   93.74 |                                  
  chain.ts              |   99.61 |    86.66 |     100 |   99.61 | 117-118                          
  commits.ts            |     100 |    93.75 |     100 |     100 | 41                               
  execution.ts          |   84.17 |      100 |      75 |   84.17 | 118-139                          
  extra-args.ts         |     100 |    84.61 |     100 |     100 | 70,89                            
  gas.ts                |   98.49 |    92.85 |     100 |   98.49 | 77-78                            
  index.ts              |     100 |      100 |     100 |     100 |                                  
  offchain.ts           |     100 |      100 |     100 |     100 |                                  
  requests.ts           |   76.75 |    76.47 |   85.71 |   76.75 | ...4,281,306-307,311-312,335-357 
  supported-chains.ts   |     100 |      100 |     100 |     100 |                                  
  types.ts              |     100 |      100 |     100 |     100 |                                  
  utils.ts              |   94.14 |    89.44 |     100 |   94.14 | ...1,426-431,465-466,473,530-538 
 ccip-sdk/src/aptos     |   56.53 |    71.85 |   60.31 |   56.53 |                                  
  exec.ts               |   29.31 |      100 |       0 |   29.31 | 18-58                            
  hasher.ts             |   75.45 |       80 |   66.66 |   75.45 | 15-34,48-54                      
  index.ts              |   56.45 |    69.51 |   61.36 |   56.45 | ...4-677,681-716,720-813,817-828 
  logs.ts               |   85.96 |    71.05 |   85.71 |   85.96 | 148,151-178,210-212              
  send.ts               |    25.2 |      100 |       0 |    25.2 | 10-51,62-79,92-123               
  token.ts              |   21.79 |       75 |     100 |   21.79 | 34-155                           
  types.ts              |   67.32 |      100 |       0 |   67.32 | 25-32,77-101                     
  utils.ts              |     100 |      100 |     100 |     100 |                                  
 ccip-sdk/src/evm       |   65.07 |    70.37 |   62.31 |   65.07 |                                  
  const.ts              |     100 |      100 |     100 |     100 |                                  
  errors.ts             |   86.17 |    79.71 |     100 |   86.17 | ...0-101,112-113,155-157,198-216 
  hasher.ts             |     100 |     87.5 |     100 |     100 | 121                              
  index.ts              |   57.09 |       70 |   57.69 |   57.09 | ...1267-1288,1292-1365,1369-1418 
  logs.ts               |    34.9 |    41.17 |      25 |    34.9 | ...75,87-169,198-199,211-239,254 
  messages.ts           |     100 |      100 |     100 |     100 |                                  
  offchain.ts           |    80.3 |    55.17 |      75 |    80.3 | ...6-127,144-146,150-164,190-195 
 ccip-sdk/src/hasher    |    94.1 |    78.94 |     100 |    94.1 |                                  
  common.ts             |     100 |      100 |     100 |     100 |                                  
  hasher.ts             |     100 |    66.66 |     100 |     100 | 17                               
  index.ts              |     100 |      100 |     100 |     100 |                                  
  merklemulti.ts        |   93.22 |       78 |     100 |   93.22 | ...4-245,249-250,296-297,305-306 
 ccip-sdk/src/solana    |    50.4 |    66.94 |   55.55 |    50.4 |                                  
  cleanup.ts            |   12.55 |      100 |       0 |   12.55 | 30-231                           
  exec.ts               |     9.2 |      100 |       0 |     9.2 | ...9-263,265-340,342-381,383-500 
  hasher.ts             |   96.46 |    81.81 |     100 |   96.46 | 63-66                            
  index.ts              |   68.98 |    64.67 |    64.7 |   68.98 | ...1385-1538,1542-1566,1570-1591 
  offchain.ts           |   76.97 |     64.7 |      50 |   76.97 | ...9,85-87,91-94,107-108,123-139 
  patchBorsh.ts         |   64.63 |    57.14 |      75 |   64.63 | 29-48,64-65,71-77                
  send.ts               |   13.29 |      100 |       0 |   13.29 | ...8-154,156-245,258-323,325-376 
  types.ts              |   73.91 |      100 |       0 |   73.91 | 35-46                            
  utils.ts              |   56.06 |    78.94 |      70 |   56.06 | ...4-252,264-265,276-289,331-396 
 ccip-sdk/src/sui       |    73.2 |    73.33 |   17.07 |    73.2 |                                  
  hasher.ts             |   98.14 |    66.66 |     100 |   98.14 | 32,48                            
  index.ts              |   64.51 |    83.33 |   10.52 |   64.51 | ...3-294,298-299,303-304,308-309 
------------------------|---------|----------|---------|---------|----------------------------------

They allow fetching `UnsignedTx`, which can be signed and sent in ways
other than injected Signer wallet.
`simulateAndSendTxs` now is also smarter on fitting as many instructions
as possible inside the same tx
ccip-sdk doesn't have static or cached `getWallet` anymore; instead, it
receives a `opts.wallet` directly in the `sendMessage` and
`executeReport` methods;
users are then expected to provide compatible wallets, like done by the
CLI without overriding any method in the SDK.
@andrevmatos andrevmatos marked this pull request as ready for review December 7, 2025 06:16
@andrevmatos andrevmatos requested a review from a team as a code owner December 7, 2025 06:16
@andrevmatos andrevmatos requested a review from Copilot December 7, 2025 06:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces significant architectural changes to the CCIP SDK, focusing on decoupling wallet management from the SDK and adding support for unsigned transaction generation. The changes enable users to manage their own signing workflows while maintaining backward compatibility through CLI implementations.

Key Changes:

  • Replaced internal wallet management with direct wallet injection into sendMessage and executeReport methods
  • Added generateUnsignedSendMessage and generateUnsignedExecuteReport methods for all chain families to support manual transaction signing workflows
  • Introduced optional logger injection throughout the SDK to replace hardcoded console usage

Reviewed changes

Copilot reviewed 48 out of 49 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
package.json Updated dependencies (eslint-plugin-jsdoc, prettier) and added bigint-buffer override
ccip-sdk/src/types.ts Added Logger and WithLogger types for logger injection support
ccip-sdk/src/utils.ts Added logger parameter to functions, removed node util import, added util backfill
ccip-sdk/src/chain.ts Moved network to base class, removed getWalletAddress, added generateUnsigned* methods
ccip-sdk/src/evm/index.ts Refactored sendMessage/executeReport to use wallet parameter, added generateUnsigned* methods
ccip-sdk/src/solana/index.ts Similar wallet refactoring for Solana, removed getWallet methods
ccip-sdk/src/aptos/index.ts Similar wallet refactoring for Aptos chain
ccip-cli/src/providers/*.ts Moved wallet loading logic from SDK to CLI provider files
ccip-cli/src/commands/*.ts Updated commands to use new context-based logging and wallet loading
Comments suppressed due to low confidence (1)

ccip-sdk/src/evm/logs.ts:1

  • The topics array structure changed from a flat array to nested arrays. The first topic should remain flat while the second topic is now wrapped in an array. This should be [request.log.topics[0], [toBeHex(request.lane.destChainSelector, 32)]] to maintain the correct structure where only the destChainSelector is an array of possible values.
import {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

it('should handle zero', () => {
const result = toLeArray(0n)
assert.deepEqual(result, new Uint8Array([0x00]))
assert.deepEqual(result, new Uint8Array([]))
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

The test expectation changed from [0x00] to [] for toLeArray(0n), but there's no explanation for this behavioral change. This could be a breaking change that needs documentation or a test that validates the new behavior is correct.

Copilot uses AI. Check for mistakes.
key: altAddr,
state: {
deactivationSlot: BigInt(0),
deactivationSlot: 2n ** 64n - 1n,
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Using 2n ** 64n - 1n as a magic number for non-deactivated lookup tables. Consider extracting this to a named constant like MAX_UINT64 or NON_DEACTIVATED_SLOT for better code clarity.

Copilot uses AI. Check for mistakes.
// generate:nofail
// `const VERSION = '${require('./package.json').version}-${require('child_process').execSync('git rev-parse --short HEAD').toString().trim()}'`
const VERSION = '0.91.0-9e5d987'
const VERSION = '0.91.0-0161da7'
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

Hardcoded version string should be updated via the generation script. The comment indicates this is auto-generated between generate:nofail and generate:end markers, but the value appears to have been manually updated.

Copilot uses AI. Check for mistakes.
...RPCS,
'--rpcs-file',
'.gitignore', // Disable rpcs file loading
'package.json', // Disable rpcs file loading
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Using 'package.json' as a dummy file to disable rpcs file loading is fragile. If package.json is removed or renamed, this test will break. Consider using a dedicated test fixture or a non-existent file path that's explicitly documented as intentional.

Suggested change
'package.json', // Disable rpcs file loading
'__nonexistent_rpcs_file__.json', // Intentionally non-existent file to disable rpcs file loading

Copilot uses AI. Check for mistakes.
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.

1 participant