v0.2.6 Release - 18 September 2025
This release refactors CCIPLocalSimulatorFork.sol so it can deliver more than one message to more than one chain in a same call.
Changelog
Dependencies
Package | Version |
---|---|
@chainlink/contracts-ccip | 1.6.0 |
@chainlink/contracts | 1.4.0 |
Added
- Added
switchChainAndRouteMessage(uint256[] memory chainIds)
function which is an overlap of already existingswitchChainAndRouteMessage(chainId)
in theCCIPLocalSimulatorFork.sol
contract. This new function can be used to route multiple CCIP messages to multiple chains in a single call.
Changed
- Refactored
CCIPLocalSimulatorFork.sol
so it can route all CCIP messages sent from a loop and not just the first one
Basic usage
The main change is that now one can:
- Simulate sending one message to destination chain (was already possible)
- Simulate sending multiple messages to a single destination chain at once
- Simulate sending multiple messages to multiple destination chains at once
We accomplished that by introducing the new switchChainAndRouteMessage(uint256[] forkIds)
function which is an overlap of an existing switchChainAndRouteMessage(uint256 forkId)
function.
How to use it?
- Simulate sending one message to destination chain (was already possible)
- => call
switchChainAndRouteMessage(uint256 forkId)
- => call
- Simulate sending multiple messages to a single destination chain at once
- => call
switchChainAndRouteMessage(uint256 forkId)
(it will deliver all messages, not just the first one)
- => call
- Simulate sending multiple messages to multiple destination chains at once
- => call
switchChainAndRouteMessage(uint256[] forkIds)
(one can pass chains A, B, C here, it will deliver all messages to their target chains without duplication)
- => call
Basically no matter when one calls it, it will loop through all unprocessed CCIP messages and try to deliver them to appropriate destination chains. However, keep in mind that if one doesn’t pass correct forkIds, undelivered messages would be lost due to nature of Foundry.
Testing the release
To test this release install @chainlink-local
using the following commands:
Foundry (git)
forge install smartcontractkit/[email protected]
and then set remappings to: @chainlink/local/=lib/chainlink-local/
in either remappings.txt
or foundry.toml
file
Hardhat (npm)
npm install @chainlink/[email protected]
and then create the following contract and compile it:
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {CCIPLocalSimulator} from "@chainlink/local/src/ccip/CCIPLocalSimulator.sol";
Remix IDE
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {CCIPLocalSimulator} from "https://github.com/smartcontractkit/chainlink-local/blob/v0.2.6/src/ccip/CCIPLocalSimulator.sol";
PRs included
- Add codeowners file by @andrejrakic in #44
- 0.2.6 Release by @andrejrakic in #46
Full Changelog: v0.2.5...v0.2.6