Skip to content

Retrieve FTF lane feature#163

Merged
andrevmatos merged 13 commits intomainfrom
FTF-capability
Mar 4, 2026
Merged

Retrieve FTF lane feature#163
andrevmatos merged 13 commits intomainfrom
FTF-capability

Conversation

@PabloMansanet
Copy link
Contributor

Fully fork tested, with a caveat:

There was a recent rename of the token pool method getMinBlockConfirmation() to getMinBlockConfirmations() (note the plural). To keep with the patterns in this codebase, we only generate our token pool ABI based on the latest upstream code, so we only check for the existence of the plural.

Current staging deployments are mostly on the older naming, with only the Lombard LBTC pool (as far as I know) using the plural form. This means our fork tests can only check the Lombard case (FTF disabled). As soon as more pools migrate, we'll be able to add fork tests that verify FTF support in other pools.

@PabloMansanet PabloMansanet requested a review from a team as a code owner March 3, 2026 11:55
@vercel
Copy link

vercel bot commented Mar 3, 2026

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

Project Deployment Actions Updated (UTC)
ccip-tools-ts Ready Ready Preview, Comment Mar 4, 2026 3:56pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

👋 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
Copy link

github-actions bot commented Mar 3, 2026

Coverage Report

ℹ tests 691
ℹ suites 212
ℹ pass 689
ℹ fail 0
ℹ cancelled 0
ℹ skipped 2
ℹ todo 0
ℹ duration_ms 47998.904874

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

(node:4455) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
▶ lane-latency command
  ✔ should output JSON format correctly (5.847889ms)
  ✔ should resolve chain IDs to chain selectors (0.808236ms)
  ✔ should use custom API URL when provided (2.313802ms)
  ✔ should output log format correctly (1.280043ms)
  ✔ should handle chain IDs as input (1.841843ms)
  ✔ should handle chain selectors as input (1.096506ms)
  ✔ should throw CCIPApiClientNotAvailableError when --no-api flag is set (1.044226ms)
  ✔ should work normally when --no-api flag is false (0.50391ms)
  ▶ CCIP_API environment variable integration
    ✔ should respect CCIP_API=false environment variable (0.479073ms)
  ✔ CCIP_API environment variable integration (0.647817ms)
✔ lane-latency command (17.479847ms)
▶ e2e command show EVM
  ▶ pretty format (default)
    ✔ should show complete CCIP transaction details EVM to EVM (7892.812736ms)
  ✔ pretty format (default) (7893.901504ms)
  ▶ json format
    ✔ should output valid JSON with all expected fields (6003.42585ms)
  ✔ json format (6003.663062ms)
  ▶ log format
    ✔ should output in log format with object assignments (10868.418599ms)
  ✔ log format (10868.695385ms)
  ▶ verbose flag
    ✔ should work with verbose flag enabled (6867.883336ms)
  ✔ verbose flag (6868.130937ms)
  ▶ error handling
    ✔ should handle invalid transaction hash gracefully (6121.781683ms)
    ✔ should require transaction hash argument (1692.660999ms)
  ✔ error handling (7814.759151ms)
  ✔ should show complete CCIP transaction details EVM to Aptos (6821.467012ms)
  ✔ should show complete CCIP transaction details EVM to Solana (10540.347372ms)
✔ e2e command show EVM (56814.439107ms)
▶ e2e command show Solana
  ✔ should show complete CCIP transaction details Solana to EVM (10527.552646ms)
✔ e2e command show Solana (10527.899823ms)
▶ e2e command show Aptos
  ✔ should show complete CCIP transaction details Aptos to EVM (5695.102518ms)
✔ e2e command show Aptos (5695.32888ms)
﹣ e2e command show TON (0.057197ms) # SKIP
(node:4457) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
▶ formatCCIPError
  ✔ should return null for non-CCIPError instances (1.706621ms)
  ✔ should format CCIPError with code and message (0.642988ms)
  ✔ should include help section with recovery hint (0.281534ms)
  ✔ should include note section for transient errors (0.383485ms)
  ✔ should include retry timing for transient errors with retryAfterMs (0.395086ms)
  ✔ should not include note section for permanent errors (0.259043ms)
  ✔ should format error with structured output (0.270875ms)
  ✔ should include stack trace when verbose is true (0.463875ms)
  ✔ should not include stack trace when verbose is false (0.247301ms)
✔ formatCCIPError (6.782811ms)
ℹ tests 28
ℹ suites 12
ℹ pass 28
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 73212.207741
-------------------------------|---------|----------|---------|---------|---------------------------
File                           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s         
-------------------------------|---------|----------|---------|---------|---------------------------
All files                      |   71.97 |    77.31 |   57.66 |   71.97 |                           
 ccip-cli/src                  |   89.09 |       80 |      50 |   89.09 |                           
  index.ts                     |   89.09 |       80 |      50 |   89.09 | 50-52,63-64,86-90,96-97   
 ccip-cli/src/commands         |   54.47 |    72.24 |    54.9 |   54.47 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  lane-latency.ts              |   72.97 |     87.5 |   33.33 |   72.97 | 41-55,62-69,103-109       
  manual-exec.ts               |   27.11 |      100 |       0 |   27.11 | 56-120,127-137,139-234    
  parse.ts                     |   57.14 |      100 |       0 |   57.14 | 46-50,57-64,66-91         
  send.ts                      |   16.29 |      100 |       0 |   16.29 | 52-153,160-167,169-356    
  show.ts                      |   90.07 |    63.63 |      60 |   90.07 | ...74-176,185-186,226-227 
  supported-tokens.ts          |   21.72 |      100 |       0 |   21.72 | ...99-195,197-252,254-267 
  token.ts                     |   22.72 |      100 |       0 |   22.72 | 24-53,60-67,69-132        
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   85.29 |    73.38 |    92.3 |   85.29 | ...85-595,603-611,621-627 
 ccip-cli/src/providers        |    54.1 |       76 |   17.39 |    54.1 |                           
  aptos.ts                     |   53.65 |      100 |       0 |   53.65 | ...70,78-85,91-92,101-123 
  evm.ts                       |   46.03 |      100 |       0 |   46.03 | 20,31-63                  
  index.ts                     |   82.05 |    73.33 |      80 |   82.05 | 51-52,195-234             
  solana.ts                    |   50.42 |      100 |       0 |   50.42 | ...-71,79-85,89-90,99-117 
  sui.ts                       |   64.28 |      100 |       0 |   64.28 | 10-14                     
  ton.ts                       |   14.58 |      100 |       0 |   14.58 | 22-144                    
 ccip-sdk/src                  |   94.85 |    86.98 |   92.95 |   94.85 |                           
  chain.ts                     |   93.77 |       82 |   68.75 |   93.77 | ...00-1105,1193,1326-1336 
  commits.ts                   |     100 |    94.73 |     100 |     100 | 52                        
  execution.ts                 |   92.19 |     92.3 |     100 |   92.19 | 130-137,149-156           
  explorer.ts                  |     100 |      100 |     100 |     100 |                           
  extra-args.ts                |     100 |    86.66 |     100 |     100 | 169,204                   
  gas.ts                       |   88.88 |       50 |     100 |   88.88 | 100-111,134-138           
  http-status.ts               |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |   92.97 |    83.78 |     100 |   92.97 | ...37,157,172-174,176-182 
  requests.ts                  |   90.76 |    83.33 |     100 |   90.76 | ...64-368,433-434,438-439 
  supported-chains.ts          |     100 |      100 |     100 |     100 |                           
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   95.55 |    90.39 |     100 |   95.55 | ...70,734-735,751,816-824 
 ccip-sdk/src/api              |   95.91 |    80.32 |   85.71 |   95.91 |                           
  index.ts                     |   95.91 |    80.32 |   85.71 |   95.91 | ...29-330,394-395,444-449 
 ccip-sdk/src/aptos            |    56.5 |    69.46 |   56.66 |    56.5 |                           
  exec.ts                      |   29.31 |      100 |       0 |   29.31 | 18-58                     
  hasher.ts                    |   76.31 |       80 |   66.66 |   76.31 | 19-38,52-58               
  index.ts                     |   58.02 |    75.34 |   59.52 |   58.02 | ...84-719,723-825,829-840 
  logs.ts                      |   78.52 |    56.52 |      75 |   78.52 | ...90-196,200-233,264-268 
  send.ts                      |    25.2 |      100 |       0 |    25.2 | 10-51,62-79,92-123        
  token.ts                     |   23.75 |       75 |     100 |   23.75 | 35-156                    
  types.ts                     |   65.62 |      100 |       0 |   65.62 | 25-32,64-88               
 ccip-sdk/src/errors           |   87.26 |     77.4 |   47.54 |   87.26 |                           
  CCIPError.ts                 |     100 |      100 |     100 |     100 |                           
  codes.ts                     |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  recovery.ts                  |     100 |      100 |     100 |     100 |                           
  specialized.ts               |   84.49 |    72.72 |   44.82 |   84.49 | ...68,3289-3298,3319-3328 
  utils.ts                     |   94.44 |    81.48 |     100 |   94.44 | 15,17,22,24               
 ccip-sdk/src/evm              |   81.25 |     70.6 |   81.81 |   81.25 |                           
  const.ts                     |     100 |      100 |     100 |     100 |                           
  errors.ts                    |   86.42 |    79.22 |     100 |   86.42 | ...12-113,159-161,202-220 
  extra-args.ts                |   94.44 |    61.66 |     100 |   94.44 | ...82-183,208-209,326-338 
  fork.test.data.ts            |     100 |      100 |     100 |     100 |                           
  gas.ts                       |      98 |    53.84 |     100 |      98 | 72-73,75                  
  hasher.ts                    |     100 |    72.72 |     100 |     100 | 108,134,164               
  index.ts                     |   74.56 |    74.52 |   81.48 |   74.56 | ...39,1556-1599,1647-1654 
  logs.ts                      |   34.32 |    68.42 |      25 |   34.32 | ...13-214,229-258,275-302 
  messages.ts                  |   91.81 |    46.15 |     100 |   91.81 | ...47-248,257-258,282-283 
  offchain.ts                  |   56.25 |      100 |       0 |   56.25 | 10-16                     
  types.ts                     |     100 |    93.33 |     100 |     100 | 18                        
 ccip-sdk/src/evm/viem         |   77.72 |       92 |   69.23 |   77.72 |                           
  client-adapter.ts            |     100 |     92.3 |     100 |     100 | 48                        
  index.ts                     |     100 |      100 |     100 |     100 |                           
  wallet-adapter.ts            |   63.09 |     90.9 |   55.55 |   63.09 | ...6,53-73,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 | ...59-260,306-307,315-316 
 ccip-sdk/src/shared           |   88.05 |    69.23 |     100 |   88.05 |                           
  bcs-codecs.ts                |   87.87 |    66.66 |     100 |   87.87 | 75-87,104-106             
  constants.ts                 |     100 |      100 |     100 |     100 |                           
 ccip-sdk/src/solana           |   52.77 |    69.06 |   54.76 |   52.77 |                           
  cleanup.ts                   |   12.22 |      100 |       0 |   12.22 | 29-229                    
  exec.ts                      |    9.43 |      100 |       0 |    9.43 | ...68-343,345-384,386-498 
  hasher.ts                    |   96.58 |    81.81 |     100 |   96.58 | 67-70                     
  index.ts                     |   72.93 |    74.01 |    64.7 |   72.93 | ...10,1514-1538,1542-1563 
  logs.ts                      |   74.19 |    27.27 |     100 |   74.19 | ...,50-51,53-54,56-88,119 
  offchain.ts                  |   62.22 |      100 |       0 |   62.22 | 29-45                     
  patchBorsh.ts                |   65.06 |    57.14 |      75 |   65.06 | 30-49,65-66,72-78         
  send.ts                      |   13.93 |      100 |       0 |   13.93 | ...57-246,259-325,327-366 
  types.ts                     |   74.46 |      100 |       0 |   74.46 | 36-47                     
  utils.ts                     |   54.27 |    77.77 |   54.54 |   54.27 | ...40-353,395-458,464-479 
 ccip-sdk/src/sui              |   31.59 |    88.88 |   17.85 |   31.59 |                           
  discovery.ts                 |   15.13 |      100 |       0 |   15.13 | 20-36,49-185,188-218      
  events.ts                    |   19.85 |      100 |       0 |   19.85 | ...18-275,280-398,407-428 
  hasher.ts                    |   98.16 |    66.66 |     100 |   98.16 | 33,49                     
  index.ts                     |    37.6 |    92.85 |   17.94 |    37.6 | ...61-862,866-867,871-872 
  objects.ts                   |   19.04 |      100 |       0 |   19.04 | ...04-119,133-183,194-336 
 ccip-sdk/src/sui/manuallyExec |   39.46 |      100 |       0 |   39.46 |                           
  encoder.ts                   |   47.67 |      100 |       0 |   47.67 | 42-86                     
  index.ts                     |    34.3 |      100 |       0 |    34.3 | 48-137                    
 ccip-sdk/src/ton              |   74.12 |    82.48 |   64.78 |   74.12 |                           
  exec.ts                      |     100 |      100 |     100 |     100 |                           
  hasher.ts                    |   77.95 |    77.77 |      75 |   77.95 | 99-107,155-186            
  index.ts                     |   69.84 |    76.06 |   52.27 |   69.84 | ...10,1217-1218,1225-1226 
  logs.ts                      |     100 |    98.43 |     100 |     100 | 56                        
  send.ts                      |   96.39 |    73.91 |     100 |   96.39 | 38-45                     
  types.ts                     |   77.94 |    69.23 |   66.66 |   77.94 | ...-73,91,118-131,133-136 
  utils.ts                     |   60.88 |    83.72 |    87.5 |   60.88 | ...55-261,269-327,329-332 
-------------------------------|---------|----------|---------|---------|---------------------------

@PabloMansanet PabloMansanet changed the title Retrieve FTF capability for a lane/onramp/token? triplet Retrieve FTF feature for a lane Mar 4, 2026
@PabloMansanet PabloMansanet changed the title Retrieve FTF feature for a lane Retrieve FTF lane feature Mar 4, 2026
@PabloMansanet PabloMansanet dismissed aelmanaa’s stale review March 4, 2026 13:06

Changes addressed

Copy link
Collaborator

@andrevmatos andrevmatos left a comment

Choose a reason for hiding this comment

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

Proposed some changes, to allow the existing implementation of getLaneFeatures to use only existing methods (instead of hitting the contracts directly).

With those changes, I think we can move this implementation to the concrete generic implementation inside Chain.getLaneFeatures, and will serve everyone (i.e. once they start supporting v2, it is).

Comment on lines +661 to +664
const tokenPool = (await onRampContract.getPoolBySourceToken(
opts.destChainSelector,
opts.token,
)) as string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use the existing method instead of hitting the contract directly? This may make it more generic in the future

Suggested change
const tokenPool = (await onRampContract.getPoolBySourceToken(
opts.destChainSelector,
opts.token,
)) as string
const { tokenPool } = await this.getRegistryTokenConfig(
await this.getTokenAdminRegistryFor(onRamp),
opts.token,
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does a lot more thoug, right? The registry path does typeAndVersion (line 997) + getStaticConfig (line 1017) + getTokenConfig (line 1434) = 3 calls, vs the current single getPoolBySourceToken call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per our chat: let's approach in a followup

Comment on lines +675 to +680
const poolContract = new Contract(
tokenPool,
interfaces.TokenPool_v2_0,
this.provider,
) as unknown as TypedContract<typeof TokenPool_2_0_ABI>
const minBlockConfirmations = Number(await poolContract.getMinBlockConfirmations())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just for consistency, can we add minBlockConfirmations? as part of the EVM-specific return type of getTokenPoolConfig method, return it in there if pool is >=v2, and then use that method here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I'm not sure about this one, I think it confuses things a bit for the sake of consistency. minBlockConfirmations is its own method in the ABI and it's not marked as "config" anywhere. Just like it's lane features and not lane config, I don't think this value should come from getTokenPoolConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per our chat: let's approach in a followup

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, please, just don't forget it 😅

Comment on lines +675 to +680
const poolContract = new Contract(
tokenPool,
interfaces.TokenPool_v2_0,
this.provider,
) as unknown as TypedContract<typeof TokenPool_2_0_ABI>
const minBlockConfirmations = Number(await poolContract.getMinBlockConfirmations())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, please, just don't forget it 😅

@andrevmatos andrevmatos merged commit a2b2769 into main Mar 4, 2026
12 checks passed
@andrevmatos andrevmatos deleted the FTF-capability branch March 4, 2026 18:09
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