Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ jobs:

- name: Run tests with coverage
env:
# Max total wait for a suite's network locks. A suite that needs several
# locks (e.g. evm/fork.test.ts: sepolia, fuji, solana-devnet, api) gets
# them only when all are free at once, while single-lock suites take them
# in turn: under 10 min it timed out before the other suites finished
# (runs 42860314677, 42839821345). 30 min lets it run once they finish.
# Blocks that need multiple locks acquire them together. Allow a block to
# wait through transient RPC stalls in the suites ahead of it.
NETWORK_LOCK_TIMEOUT_MS: '1800000'
# Node buffers test file output. Log measured durations instead of relying
# on Actions timestamps to distinguish lock waits and slow RPC probes.
NETWORK_TEST_TIMINGS: '1'
# RPC endpoints per network, one secret each; a value may hold
# several endpoints for the same network, comma-separated. Unset
# secrets resolve to the keyless public defaults hard-coded in the
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.18.0] - 2026-11-20

- SDK: export `encodeAddressToAny` and `isCantonPartyId` from the package root. `encodeAddressToAny` encodes an address of any chain family the way CCIP messages carry it, e.g. a Canton party as `keccak256(partyId)`; `isCantonPartyId` checks the `hint::1220<64 hex>` party form it hashes
- CCT SDK (EVM): `registerAdmin` and `generateUnsignedRegisterAdmin` wrap token permission getter `CALL_EXCEPTION`s in `CCTParamsInvalidError` for `tokenAddress`, preserving the cause.
- Solana: add `getTotalFeesEstimate`, which threw `CCIPNotImplementedError` from Solana. It returns `getFee`'s `ccipFee`, plus as `tokenTransferFee` the basis-point fee the source pool takes from the transferred amount: the `finalityTransferFeeBps` of the pool's `ChainConfigV2` for the lane with `finality: 'finalized'` (or 0), its `fastFinalityTransferFeeBps` with a block depth or `'safe'`, when its fee config is enabled. It only applies when the message goes over the Router's 2.0 entrypoint, chosen as `getFee` and `sendMessage` choose it (so not on a 2.0 lane with its sender allowlist enabled, which falls back to 1.6), and to a token whose TokenAdminRegistry entry has pool interface version 2: data-only messages, 1.6 sends and interface-1 pools get `ccipFee` alone. CCTP pools take no pool fee; a fast CCTP transfer, where the pool and its verifier allow one, quotes Circle's fast transfer fee at the `fast_finality_bps` of the pool's CCTP verifier
Expand Down
53 changes: 29 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ carries an audit fix. Record the reason for each exception.
- **Line swap** — `tinypool` forces the 2.x line over `@docusaurus/core`'s `^1`. The
advisory covers all of 1.x, and the fix landed in `2.1.2`. The docs build exercises the
swap.
- **OpenZeppelin line** — a nested override under `@arbitrum/nitro-contracts` moves its
plain `@openzeppelin/contracts` and `@openzeppelin/contracts-upgradeable` to `4.9.6`.
This also covers the nested upgrade executor. The version-named OZ packages stay fixed;
do not bump those.
- **TON validation** — `@ton/ton` uses `zod@4.6.7`. Zod 4.6.6 fixes the unbounded-collection
advisory, and TON 16.3.0 accepts the updated schema behavior. Unit tests cover the TON paths.
- **Fork swap** — `bigint-buffer` maps to `@trufflesuite/bigint-buffer@1.1.10`. The
original `<=1.1.5` has a buffer overflow, and its native build no longer compiles.
- **The faker stub** — `postman-collection` pins `@faker-js/faker@5.5.3` and reads the
Expand All @@ -76,36 +82,33 @@ carries an audit fix. Record the reason for each exception.
- `braces`: GHSA-vfj7-8cjw-p6xm was withdrawn on 2026-10-23. Upstream `3.0.3` replaces
the vendored guard. The root `fill-range` devDependency is no longer necessary.
- `image-size`: Docusaurus accepts patched upstream releases without an override.
The lockfile selects `2.0.4`, which provides the CJS `./fromFile` entry.
The lockfile selects `2.1.0`, which provides the CJS `./fromFile` entry.
Release `2.0.3` and later fix the parser DoS. The fork is no longer necessary.

The old `stream-json` acceptance is also gone; that advisory is not in the current audit.

**Accepted advisories**

A clean install on 2026-11-10 reports 37 audit findings: 23 low, 10 moderate, and 4 high.
The baseline reports 41 findings, including four additional Zod peer-dependency findings.
The regenerated dependency graph no longer reports those four findings. Zod itself remains vulnerable.
After the 2026-11-20 dependency bump, `npm audit` reports 27 findings:
18 low, 8 moderate, and 1 high. The earlier audit reported 32 findings.

- `elliptic` (low, GHSA-848j-6mx2-7j84) — `6.6.1` is the newest release, so no patched
version exists. It reaches the CLI through `ethers` v5
(`@ethers-ext/signer-ledger` → `@ledgerhq/hw-app-eth` → `@ethersproject/*`).
- `@openzeppelin/contracts` and `@openzeppelin/contracts-upgradeable`
(GHSA-93hq-5wgc-jc82 and related) — no fix exists inside the version-named OZ packages
that `@chainlink/contracts-ccip` → `@chainlink/contracts` use. Do not bump those
packages. This repo consumes only vendored ABIs and never compiles or deploys the
affected Solidity.
- `zod@3.25.76` under `@ton/ton@16.3.0` — the fix is `>=4.6.6`. Zod 4 requires two
arguments for `z.record`, and `@ton/ton@16.3.0` uses the one-argument form. A forced
Zod 4 breaks TON support.
The remaining low findings follow this chain.
- The version-named `@openzeppelin/contracts-4.7.3`, `-4.8.3`, and `-5.3.0` packages remain
vulnerable. Policy keeps these names and versions unchanged. They are the only high finding.
`@chainlink/contracts` and `@chainlink/contracts-ccip` stay moderate through those aliases.
This repo consumes only vendored ABIs and never compiles or deploys the affected Solidity.
- `typedoc@0.28.20` → `minimatch@10.2.6` (GHSA-g3hv-75wg-m249) — the fix is `11.0.1`, but
it removes the public `Minimatch#matchOne` API. Wait for a compatible upstream release.
- `deepmerge@4.3.1` — no fix is available.
it removes the public `Minimatch#matchOne` API and breaks the docs build. Keep the
compatible 10.x line until TypeDoc supports minimatch 11.

`npm ls --all` still reports the intentional faker stub as `invalid`.
It also reports two optional-peer mismatches: Solana codecs expect TypeScript 5, and `ws@7` expects `utf-8-validate@5`.
The root provides TypeScript 6 and `utf-8-validate@6`. No required dependency is missing.
Typechecks, unit tests, and the documentation build pass with this tree.
The TON override and the documentation build are the checks for the two compatibility overrides.

## Test Suite Layout

Expand Down Expand Up @@ -150,19 +153,21 @@ describe("EVM to Solana", () => {
});
```

Keep the two rules of the lock system in mind when moving fixtures or adding suites:
Follow these rules when moving fixtures or adding suites:

- **Lock exactly what you touch.** An e2e CLI invocation races every `--rpc` endpoint of its fixture's chains, so pass only those chains' endpoints and lock only those networks. Overshooting (locking a network you never reach) serializes other suites for nothing; undershooting (reaching a network you never locked) reintroduces the rate-limit contention the locks exist to prevent.
- **Acquire related locks together.** Take one lock set per block. Do not wait for another lock while holding part of the set. Use `api` for the production CCIP API and `api-staging` for the staging CCIP API.
- **Prefer uncontended chains for new fixtures.** sepolia/fuji are held by several suites; quieter lanes (see `e2e-helpers.test.ts` endpoint groups and the fixtures in the existing suites) keep a suite parallel with everything else. Verify reachability from CI, not just locally — some public gateways answer residential IPs but hang from datacenter egress.

Each network tag is a directory in a well-known lock root (`<tmpdir>/ccip-tools-ts-network-locks`), created atomically with `fs.mkdir`, so exactly one test process holds a tag at a time. The filesystem is the queue: when a suite finishes, its tags release and the next suite waiting on them starts immediately — there is no batch/round scheduling. Locks auto-release on process exit; crashed holders are detected by pid liveness (or owner-file age) and self-heal on the next acquisition.

Locks are per-machine, so all networked suites must run inside a single CI job/runner. The whole tree runs from one root-level `node --test` invocation over both workspaces' globs (see the `test` script in the root `package.json`) — the locks arbitrate across workspaces exactly as they do within one. That script also raises `--test-concurrency` above the default (`availableParallelism - 1`): on CI's 4-vCPU runners the default would be 3 file slots for the entire tree, and a suite waiting on a lock occupies its slot while it waits, so the extra slots are what let lock-queued suites overlap. Configure via env:

| Variable | Effect |
| ------------------------- | -------------------------------------------------------------------------- |
| `NETWORK_LOCK_DIR` | Lock root directory (default: `<os.tmpdir()>/ccip-tools-ts-network-locks`) |
| `NETWORK_LOCK_TIMEOUT_MS` | Max wait for all locks before failing (default: 60 min) |
| Variable | Effect |
| ------------------------- | ---------------------------------------------------------------------------------------- |
| `NETWORK_LOCK_DIR` | Lock root directory (default: `<os.tmpdir()>/ccip-tools-ts-network-locks`) |
| `NETWORK_LOCK_TIMEOUT_MS` | Max wait for all locks before failing (default: 60 min) |
| `NETWORK_TEST_TIMINGS=1` | Log lock wait and hold times, plus RPC probe and selection times. CI sets this variable. |

### RPC endpoint env vars

Expand Down Expand Up @@ -441,7 +446,7 @@ export type ChainFamily = (typeof ChainFamily)[keyof typeof ChainFamily];
```typescript
// Return type includes _tag for type narrowing at runtime
function decodeExtraArgs(
data: BytesLike,
data: BytesLike
):
| (EVMExtraArgsV1 & { _tag: "EVMExtraArgsV1" })
| (EVMExtraArgsV2 & { _tag: "EVMExtraArgsV2" })
Expand Down Expand Up @@ -503,7 +508,7 @@ export type LogFilter = {
// Continuous polling until cancelled
const controller = new AbortController();
const cancel$ = new Promise((resolve) =>
controller.signal.addEventListener("abort", resolve),
controller.signal.addEventListener("abort", resolve)
);

for await (const log of chain.getLogs({ watch: cancel$ })) {
Expand All @@ -521,7 +526,7 @@ export class EVMChain extends Chain<typeof ChainFamily.EVM> {
constructor(
provider: JsonRpcApiProvider,
network: NetworkInfo,
ctx?: ChainContext,
ctx?: ChainContext
) {
super(network, ctx);
this.provider = provider;
Expand All @@ -535,12 +540,12 @@ export class EVMChain extends Chain<typeof ChainFamily.EVM> {
// Secondary factory: from existing provider
static async fromProvider(
provider: JsonRpcApiProvider,
ctx?: ChainContext,
ctx?: ChainContext
): Promise<EVMChain> {
return new EVMChain(
provider,
networkInfo(Number((await provider.getNetwork()).chainId)),
ctx,
ctx
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions ccip-api-ref/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chainlink/ccip-api-ref",
"version": "1.17.1",
"version": "1.18.0",
"private": true,
"description": "API Reference documentation for CCIP SDK and CLI",
"scripts": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"clsx": "^2.1.1",
"docusaurus-plugin-openapi-docs": "^5.2.0",
"docusaurus-theme-openapi-docs": "^5.2.0",
"focus-trap-react": "^12.0.3",
"focus-trap-react": "12.0.3",
"prism-react-renderer": "^2.4.1",
"react": "19.3.1",
"react-dom": "19.3.1",
Expand Down
12 changes: 6 additions & 6 deletions ccip-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chainlink/ccip-cli",
"version": "1.17.1",
"version": "1.18.0",
"description": "CCIP Command Line Interface, based on @chainlink/ccip-sdk",
"author": "Chainlink devs",
"license": "MIT",
Expand Down Expand Up @@ -46,25 +46,25 @@
"devDependencies": {
"@grpc/proto-loader": "^0.8.1",
"@types/node": "26.6.6",
"@types/update-notifier": "^6.0.8",
"@types/update-notifier": "^6.0.9",
"@types/yargs": "17.0.35",
"tsx": "4.23.15",
"typescript": "7.0.2"
},
"dependencies": {
"@aptos-labs/ts-sdk": "7.5.0",
"@canton-network/dapp-sdk": "^1.8.0",
"@chainlink/ccip-sdk": "^1.17.1",
"@canton-network/dapp-sdk": "^1.9.0",
"@chainlink/ccip-sdk": "^1.18.0",
"@coral-xyz/anchor": "^0.29.0",
"@ethers-ext/signer-ledger": "^6.0.0-beta.1",
"@grpc/grpc-js": "^1.14.6",
"@grpc/grpc-js": "^1.14.7",
"@inquirer/prompts": "8.7.5",
"@ledgerhq/hw-transport": "6.37.0",
"@ledgerhq/hw-app-aptos": "6.40.0",
"@ledgerhq/hw-app-canton": "0.16.0",
"@ledgerhq/hw-app-solana": "7.13.0",
"@ledgerhq/hw-transport-node-hid": "6.33.5",
"@mysten/sui": "2.38.0",
"@mysten/sui": "2.39.1",
"@solana/web3.js": "^1.99.0",
"@ton-community/ton-ledger": "^7.3.0",
"@ton/crypto": "^3.3.0",
Expand Down
30 changes: 2 additions & 28 deletions ccip-cli/src/commands/lane.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,12 @@ describe('e2e command lane EVM <-> Solana (v1.6 and v2.0)', () => {
)
})

it('should show lane config Solana -> Sepolia (v2.0)', { timeout: 120000 }, async () => {
it('should show lane config Solana -> Sepolia (the default)', { timeout: 120000 }, async () => {
const args = buildLaneArgs(
'solana-devnet',
'ethereum-testnet-sepolia',
SOLANA_ONRAMP,
LANE_RPCS,
'--lane-version',
'2.0',
'--format',
'json',
)
Expand All @@ -354,9 +352,9 @@ describe('e2e command lane EVM <-> Solana (v1.6 and v2.0)', () => {

const envelope = JSON.parse(result.stdout)
assert.match(envelope.onRamp, new RegExp(SOLANA_ONRAMP))
// The default is the active 2.0 lane. Its config (`dest_chain_state_v2`) names its offRamp.
assert.equal(envelope.version, '2.0.0')
assert.equal(envelope.onRampConfig.laneVersion, '2.0.0')
// the 2.0 lane config (`dest_chain_state_v2`) names its offRamp
assert.match(envelope.onRampConfig.typeAndVersion, /^ccip-router 2\./)
assert.match(envelope.onRampConfig.offramp, new RegExp(EVM_OFFRAMP_V2, 'i'))
assert.match(envelope.offRamp, new RegExp(EVM_OFFRAMP_V2, 'i'))
Expand All @@ -367,30 +365,6 @@ describe('e2e command lane EVM <-> Solana (v1.6 and v2.0)', () => {
)
})

it('should show lane config Solana -> Sepolia (the default)', { timeout: 120000 }, async () => {
const args = buildLaneArgs(
'solana-devnet',
'ethereum-testnet-sepolia',
SOLANA_ONRAMP,
LANE_RPCS,
'--format',
'json',
)
const result = await spawnCLI(args, 90000)

assert.equal(result.exitCode, 0, result.stdout + result.stderr)

const envelope = JSON.parse(result.stdout)
assert.match(envelope.onRamp, new RegExp(SOLANA_ONRAMP))
// the default is the lane messages are sent over: the 2.0 lane, since its sender allowlist
// was lifted (read 2026-11-14). Same values as the explicit v2.0 test above.
assert.equal(envelope.version, '2.0.0')
assert.equal(envelope.onRampConfig.laneVersion, '2.0.0')
assert.match(envelope.onRampConfig.typeAndVersion, /^ccip-router 2\./)
assert.match(envelope.offRamp, new RegExp(EVM_OFFRAMP_V2, 'i'))
assert.match(envelope.offRampConfig.typeAndVersion, /OffRamp 2\.0\./)
})

it('should show lane config Sepolia -> Solana (v2.0)', { timeout: 120000 }, async () => {
const args = buildLaneArgs(
'ethereum-testnet-sepolia',
Expand Down
2 changes: 1 addition & 1 deletion ccip-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Error.stackTraceLimit = 50 // show more stack frames for better debugging

// generate:nofail
// `const VERSION = '${require('./package.json').version}-${require('child_process').execSync('git rev-parse --short HEAD').toString().trim()}'`
const VERSION = '1.17.1-e0cb3943'
const VERSION = '1.18.0-14d8a1a9'
// generate:end

const require = createRequire(import.meta.url)
Expand Down
13 changes: 10 additions & 3 deletions ccip-cli/src/providers/evm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { after, before, beforeEach, describe, it } from 'node:test'

import { Wallet } from 'ethers'
import { encryptKeystoreJsonSync } from 'ethers'

import { loadEvmWallet } from './evm.ts'

Expand All @@ -30,8 +30,15 @@ before(() => {
foundryDir = join(tmp, 'foundry')
mkdirSync(join(foundryDir, 'keystores'), { recursive: true })

// Encrypted with "" once and reused by every case: scrypt makes each encrypt/decrypt costly.
const keystoreJson = new Wallet(TEST_KEY).encryptSync('')
// These cases test password handling, not scrypt strength. Keep a real encrypted fixture,
// but use a test-only work factor to avoid repeatedly running the expensive default KDF.
const keystoreJson = encryptKeystoreJsonSync(
{ address: TEST_ADDRESS, privateKey: TEST_KEY },
'',
{
scrypt: { N: 1_024 },
},
)
writeFileSync(join(foundryDir, 'keystores', 'passwordless'), keystoreJson)
jsonWalletPath = join(tmp, 'wallet.json')
writeFileSync(jsonWalletPath, keystoreJson)
Expand Down
26 changes: 25 additions & 1 deletion ccip-cli/src/providers/test-endpoints.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import assert from 'node:assert/strict'
import { afterEach, describe, it, mock } from 'node:test'

import { DEFAULT_RPC_ENDPOINTS, reachableRpcEndpoint } from '../../../scripts/test-endpoints.ts'
import {
DEFAULT_RPC_ENDPOINTS,
raceRpcEndpoint,
reachableRpcEndpoint,
} from '../../../scripts/test-endpoints.ts'

describe('reachableRpcEndpoint', () => {
const original = process.env.RPC_BASE_SEPOLIA
const originalTimings = process.env.NETWORK_TEST_TIMINGS
afterEach(() => {
if (original === undefined) delete process.env.RPC_BASE_SEPOLIA
else process.env.RPC_BASE_SEPOLIA = original
if (originalTimings === undefined) delete process.env.NETWORK_TEST_TIMINGS
else process.env.NETWORK_TEST_TIMINGS = originalTimings
mock.restoreAll()
})

Expand Down Expand Up @@ -42,4 +49,21 @@ describe('reachableRpcEndpoint', () => {
})
assert.equal(await reachableRpcEndpoint('RPC_BASE_SEPOLIA'), 'https://a.test')
})

it('reports a probe timeout and the public selection without exposing configured URLs', async () => {
process.env.NETWORK_TEST_TIMINGS = '1'
const privateUrl = 'https://private-key.test/path?token=secret'
process.env.RPC_BASE_SEPOLIA = privateUrl
const log = mock.method(console, 'error', () => {})
const selected = await raceRpcEndpoint(
'RPC_BASE_SEPOLIA',
(url) => (url === privateUrl ? new Promise<boolean>(() => {}) : Promise.resolve(true)),
{ ordered: true, attempts: 1, timeoutMs: 10 },
)
assert.equal(selected, DEFAULT_RPC_ENDPOINTS.RPC_BASE_SEPOLIA.split(',')[0])
const output = log.mock.calls.map(({ arguments: args }) => args.join(' ')).join('\n')
assert.match(output, /rpc-probe .*endpoint=configured-1 .*result=timeout duration_ms=\d+/)
assert.match(output, /rpc-select .*endpoint=gateway\.tenderly\.co result=selected/)
assert.doesNotMatch(output, /private-key|token=secret/)
})
})
Loading
Loading