Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
85fb7f7
feat: Add Mock Data Feeds contracts
andrejrakic Jun 8, 2024
d79388c
feat: Add MockOffchainAggregator contract that expose minAnswer and m…
andrejrakic Jun 8, 2024
0f5e71f
chore: Forge install @chainlink/contracts@v1.1.1
andrejrakic Jun 8, 2024
2bb3a03
feat: Add mock data feeds smoke test
andrejrakic Jun 8, 2024
f1e3c14
chore: List upcoming release in Changelog
andrejrakic Jun 8, 2024
8235aaf
feat: Add unit tests for mock data feeds contracts
andrejrakic Jun 23, 2024
c5780d3
feat: Add smoke test for mock data feeds using Hardhat
andrejrakic Jun 23, 2024
3318bab
feat: Add forking test example and prepare for beta release
andrejrakic Jun 24, 2024
eae01b6
Merge branch 'main' into develop
andrejrakic Aug 13, 2024
54ff7b0
Support for CCIP v1.5 and preparing for 0.2.2-beta release (#19)
andrejrakic Sep 12, 2024
32543f6
chore: Add CCIP v1.5 config details to Register for all available tes…
andrejrakic Oct 4, 2024
e601b3b
fix: Use the latest version of EVM2EVMOffRamp contract in the switchC…
andrejrakic Oct 10, 2024
be7007e
chore: Prepare repo for the 0.2.2 release
andrejrakic Oct 15, 2024
ffcb38e
Merge branch 'main' into develop
andrejrakic Nov 14, 2024
2d294dc
Merge branch 'main' into develop
andrejrakic Dec 10, 2024
a9d3fff
Support for Chainlink Data Streams (#25)
andrejrakic Dec 10, 2024
6620d59
chore: Include JavaScript Data Strems scripts into package.json
andrejrakic Dec 10, 2024
d43f3e4
Update README to include installation instructions for Foundry (solde…
EmanHerawy Jan 28, 2025
1243ad3
Data Streams fixes - v0.2.4-beta.0 release candidate (#34)
andrejrakic Feb 23, 2025
649b3b9
Fix year in CHANGELOG (#35)
andrejrakic Feb 23, 2025
eb2fca7
fix: Fix incorrect import path (#36)
andrejrakic Feb 23, 2025
08f53fc
chore: Prepare for 0.2.4 release
andrejrakic Mar 25, 2025
bf41d58
Merge branch 'main' into develop
andrejrakic May 9, 2025
b429481
Add support for CCIP v1.6 (#38)
andrejrakic May 14, 2025
46faf3a
fix: Update npm authentication token in publish workflows
andrejrakic May 16, 2025
9fbeafb
chore: Prepare for v0.2.5-beta.0 release, bump @chainlink/contracts t…
andrejrakic May 20, 2025
92fd9ac
chore: Prepare for 0.2.5 release
andrejrakic Jun 10, 2025
0769abf
V0.2.6-beta release (#41)
andrejrakic Jun 11, 2025
6caea04
Merge branch 'main' into develop
andrejrakic Sep 10, 2025
c71aa37
CCIP Fork: Route multiple messages to multiple chains at once (#45)
andrejrakic Sep 10, 2025
e318825
chore: Prepare repo for 0.2.6 release
andrejrakic Sep 18, 2025
cf78654
Merge branch 'main' into develop
andrejrakic Oct 2, 2025
585ae93
chore: Bump @chainlink/contracts to v1.5.0 and @chainlink/contracts-c…
andrejrakic Oct 3, 2025
1263371
DEVREL-144 : Data Streams billing mechanism (#47)
andrejrakic Oct 9, 2025
34d88d8
fix: Update Node.js version to 22 in publish workflow and refine vers…
andrejrakic Oct 10, 2025
b50710a
chore: Prepare for v0.2.7 release
andrejrakic Nov 9, 2025
382c10a
DEVREL-155: Auto populate Register.sol (#51)
Nalon Jan 14, 2026
2600e9d
Improved update register helper
Nalon Mar 5, 2026
51503ca
feat: Add Data Stream Report Schemas V1, V5-V13 (#55)
andrejrakic May 5, 2026
691ce48
chore: Prepare for v0.2.8 release
andrejrakic May 5, 2026
8453f1a
Merge branch 'main' into develop
andrejrakic May 5, 2026
78fe544
Merge branch 'main' into develop
andrejrakic May 6, 2026
643284b
fix: Improve the algorithm for handling multiple offramps in ccipLoca…
andrejrakic May 6, 2026
f7ede06
Correct v1.6 destTokenAddress and sourcePoolAddress encoding (#60)
andrejrakic May 7, 2026
f33cc51
chore: Prepare repo for v0.2.9 release
andrejrakic May 19, 2026
fdb0cc7
Correct v1.6 sender encoding in CCIPLocalSimulatorFork (#65)
Nalon Sep 22, 2026
dd13ac9
chore: prepare repo for v0.2.10-beta release
Nalon Sep 22, 2026
58456f4
DEVREL 205: Chainlink Local V3 (#54)
andrejrakic Sep 28, 2026
3317898
fix: split Register into data shards to keep the runtime under EIP-17…
magiodev-cll Sep 29, 2026
d86ac74
docs: regenerate the API reference (#70)
magiodev-cll Sep 29, 2026
0ee0b84
chore: prepare repo for v0.3.0-beta.0 release (#71)
andrejrakic Sep 29, 2026
bc57581
chore: merge main into release/v0.3.0
andrejrakic Oct 5, 2026
7676368
chore: prepare repo for v0.3.0 release
andrejrakic Oct 5, 2026
33bbf5e
Merge pull request #72 from smartcontractkit/release/v0.3.0
andrejrakic Oct 5, 2026
82bde84
ci: pin foundry-toolchain to a commit SHA
andrejrakic Oct 5, 2026
46c25af
Merge pull request #74 from smartcontractkit/fix/pin-foundry-toolchain
andrejrakic Oct 5, 2026
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
175 changes: 175 additions & 0 deletions .github/scripts/consumer-smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#!/usr/bin/env bash
# Consumer smoke test for the @chainlink/local npm tarball.
#
# Packs the repo (npm pack), then builds two throwaway consumer projects that install ONLY the
# published tarball (plus hardhat for the Hardhat consumer) and run two Solidity tests against it:
# 1. The README usage example (test/smoke/ccip/ReadmeUsageExample.t.sol), copied verbatim.
# 2. A CCIPLocalSimulatorFork smoke test asserting known Sepolia network details.
#
# Assumes `npm ci` has already been run in the repo (this script does not install repo devDependencies).
# Needs network access to registry.npmjs.org (tarball deps) and github.com (forge-std is a git dependency).
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"

WORK_DIR="$(mktemp -d "${TMPDIR:-/tmp}/chainlink-local-consumer-smoke.XXXXXX")"
cleanup() { rm -rf "$WORK_DIR"; }
trap cleanup EXIT

log() { printf '\n==> %s\n' "$1"; }

# ---------------------------------------------------------------------------
# 1. Pack the repo and sanity-check the tarball / repo state around npm pack.
# ---------------------------------------------------------------------------
log "Packing repo with npm pack"
PACK_DIR="$WORK_DIR/pack"
mkdir -p "$PACK_DIR"

(cd "$REPO_ROOT" && npm pack --silent --pack-destination "$PACK_DIR")

shopt -s nullglob
TGZ_FILES=("$PACK_DIR"/*.tgz)
shopt -u nullglob
if [[ ${#TGZ_FILES[@]} -ne 1 ]]; then
echo "FAIL: expected exactly one tarball in $PACK_DIR, found ${#TGZ_FILES[@]}" >&2
exit 1
fi
TGZ="${TGZ_FILES[0]}"
log "Tarball: $TGZ"

log "Checking repo remappings.txt is unchanged after npm pack (prepack/postpack must restore it)"
(cd "$REPO_ROOT" && git diff --exit-code -- remappings.txt)
echo "OK: remappings.txt unchanged"

log "Checking tarball's package/remappings.txt uses the node_modules variant"
TARBALL_REMAPPINGS="$(tar -xzO -f "$TGZ" package/remappings.txt)"
EXPECTED_REMAPPINGS="$(cat "$REPO_ROOT/remappings-npm.txt")"
if [[ "$TARBALL_REMAPPINGS" != "$EXPECTED_REMAPPINGS" ]]; then
echo "FAIL: tarball package/remappings.txt does not match repo remappings-npm.txt" >&2
echo "--- tarball ---" >&2
echo "$TARBALL_REMAPPINGS" >&2
echo "--- expected (remappings-npm.txt) ---" >&2
echo "$EXPECTED_REMAPPINGS" >&2
exit 1
fi
echo "OK: tarball remappings.txt matches the node_modules variant"

README_TEST_SRC="$REPO_ROOT/test/smoke/ccip/ReadmeUsageExample.t.sol"
if [[ ! -f "$README_TEST_SRC" ]]; then
echo "FAIL: $README_TEST_SRC not found" >&2
exit 1
fi

# ---------------------------------------------------------------------------
# 2. Shared second test: CCIPLocalSimulatorFork smoke test against Sepolia network details.
# ---------------------------------------------------------------------------
write_network_details_test() {
local dest="$1"
cat > "$dest" <<'EOF'
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
import {CCIPLocalSimulatorFork} from "@chainlink/local/src/ccip/CCIPLocalSimulatorFork.sol";
import {Register} from "@chainlink/local/src/ccip/Register.sol";

contract NetworkDetailsSmokeTest is Test {
function test_sepoliaNetworkDetailsAndStrictRouting() public {
CCIPLocalSimulatorFork ccipLocalSimulatorFork = new CCIPLocalSimulatorFork();

Register.NetworkDetails memory details = ccipLocalSimulatorFork.getNetworkDetails(11155111);
assertEq(details.chainSelector, 16015286601757825753);
assertTrue(ccipLocalSimulatorFork.getStrictRouting());
}
}
EOF
}

# ---------------------------------------------------------------------------
# 3. Hardhat 3 consumer (npm install of the tarball only, plus hardhat).
# ---------------------------------------------------------------------------
log "Building Hardhat 3 consumer"
HH_DIR="$WORK_DIR/hardhat-consumer"
mkdir -p "$HH_DIR/test"
cd "$HH_DIR"

cat > package.json <<EOF
{
"name": "chainlink-local-consumer-hardhat-smoke",
"private": true,
"type": "module",
"version": "0.0.0"
}
EOF

npm install --silent --no-audit --no-fund "$TGZ" hardhat@3.1.10

cat > hardhat.config.ts <<'EOF'
import { defineConfig } from "hardhat/config";

export default defineConfig({
solidity: {
version: "0.8.24",
settings: {
evmVersion: "cancun",
},
},
});
EOF

cp "$README_TEST_SRC" test/ReadmeUsageExample.t.sol
write_network_details_test test/NetworkDetails.t.sol

log "Running npx hardhat test solidity (Hardhat consumer)"
npx hardhat test solidity

# ---------------------------------------------------------------------------
# 4. Foundry consumer (npm install of the tarball only).
# ---------------------------------------------------------------------------
log "Building Foundry (npm) consumer"
FOUNDRY_DIR="$WORK_DIR/foundry-consumer"
mkdir -p "$FOUNDRY_DIR/test"
cd "$FOUNDRY_DIR"

cat > package.json <<EOF
{
"name": "chainlink-local-consumer-foundry-smoke",
"private": true,
"version": "0.0.0"
}
EOF

npm install --silent --no-audit --no-fund "$TGZ"

cat > foundry.toml <<'EOF'
[profile.default]
libs = ["node_modules"]
evm_version = "cancun"
EOF

# Exact lines from README's "Foundry (npm)" installation section.
cat > remappings.txt <<'EOF'
@chainlink/local/=node_modules/@chainlink/local/
@chainlink/contracts-ccip/=node_modules/@chainlink/contracts-ccip/
@chainlink/contracts/=node_modules/@chainlink/contracts/
@openzeppelin/contracts@4.8.3/=node_modules/@openzeppelin/contracts-4.8.3/
@openzeppelin/contracts@5.3.0/=node_modules/@openzeppelin/contracts-5.3.0/
forge-std/=node_modules/forge-std/src/
EOF

# Fail when README drifts from the remappings tested here.
while IFS= read -r line; do
if ! grep -qxF "$line" "$REPO_ROOT/README.md"; then
echo "FAIL: README.md no longer lists the Foundry (npm) remapping: $line" >&2
exit 1
fi
done < remappings.txt

cp "$README_TEST_SRC" test/ReadmeUsageExample.t.sol
write_network_details_test test/NetworkDetails.t.sol

log "Running forge test (Foundry consumer)"
forge test

log "Consumer smoke tests passed"
144 changes: 144 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Test

on:
pull_request:
push:
branches:
- main
- develop
- 'devrel-205/**'
workflow_dispatch: {}

permissions:
contents: read

concurrency:
group: test-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
FOUNDRY_VERSION: v1.8.3
NODE_VERSION: '22'

jobs:
foundry:
name: Foundry (build, fmt, non-fork tests)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1.9.1
with:
version: ${{ env.FOUNDRY_VERSION }}

- name: forge build
run: forge build

- name: forge fmt --check
run: forge fmt --check

- name: forge test (non-fork)
run: forge test --no-match-path 'test/e2e/**'

hardhat:
name: Hardhat (Solidity + JS unit tests)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1.9.1
with:
version: ${{ env.FOUNDRY_VERSION }}

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- name: npm ci
run: npm ci

- name: Hardhat Solidity tests (unit + smoke only)
run: npx hardhat test solidity $(ls test/unit/*/*.t.sol test/smoke/*/*.t.sol)

- name: JS unit tests
run: npm run js-unit-test

- name: Data Streams JS smoke tests
run: node --test test/smoke/data-streams/*.test.js

consumer-smoke:
name: Consumer smoke (npm tarball)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1.9.1
with:
version: ${{ env.FOUNDRY_VERSION }}

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- name: npm ci
run: npm ci

- name: Run consumer smoke script
run: bash .github/scripts/consumer-smoke.sh

fork:
name: Fork tests (manual, needs RPC secrets)
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 45
env:
ETHEREUM_SEPOLIA_RPC_URL: ${{ secrets.ETHEREUM_SEPOLIA_RPC_URL }}
ARBITRUM_SEPOLIA_RPC_URL: ${{ secrets.ARBITRUM_SEPOLIA_RPC_URL }}
AVALANCHE_FUJI_RPC_URL: ${{ secrets.AVALANCHE_FUJI_RPC_URL }}
BASE_SEPOLIA_RPC_URL: ${{ secrets.BASE_SEPOLIA_RPC_URL }}
ETHEREUM_MAINNET_RPC_URL: ${{ secrets.ETHEREUM_MAINNET_RPC_URL }}
ARBITRUM_MAINNET_RPC_URL: ${{ secrets.ARBITRUM_MAINNET_RPC_URL }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1.9.1
with:
version: ${{ env.FOUNDRY_VERSION }}

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- name: npm ci
run: npm ci

- name: forge test (fork suites, serial)
run: forge test -j 1 --match-path 'test/e2e/**'

- name: Hardhat JS fork tests
run: npm run hardhat-test-js
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
[submodule "lib/chainlink-ccip"]
path = lib/chainlink-ccip
url = https://github.com/smartcontractkit/chainlink-ccip
[submodule "lib/openzeppelin-contracts-4.8.3"]
path = lib/openzeppelin-contracts-4.8.3
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-5.3.0"]
path = lib/openzeppelin-contracts-5.3.0
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/chainlink-ace"]
path = lib/chainlink-ace
url = https://github.com/smartcontractkit/chainlink-ace
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Chainlink Local is a developer-focused testing package that simulates Chainlink
- Local mode (`CCIPLocalSimulator`, `DataStreamsLocalSimulator`) lets developers test app logic quickly without waiting for live offchain systems.
- Fork mode (`CCIPLocalSimulatorFork`, `DataStreamsLocalSimulatorFork`) runs against forked networks so integrations behave closer to real testnet conditions.
- The intent is parity of user app behavior between local/fork testing and testnet deployment (minus environment-specific addresses/config).
- It is available for usage in Foundry, Hardhat 3, Hardhat 2 and Remix IDE environments.
- It is available for usage in Foundry, Hardhat 3 and Remix IDE environments (V3 / 0.3.x). Hardhat 2 JavaScript users stay on 0.2.x.
- Official documentation is available at: https://docs.chain.link/chainlink-local

## Goal
Expand Down Expand Up @@ -70,7 +70,7 @@ For the full release workflow (beta, stable, branch policy, CHANGELOG requiremen
### Current core npm dependency versions
| Package | Version |
| --- | --- |
| `@chainlink/contracts-ccip` | `1.6.2` |
| `@chainlink/contracts-ccip` | `2.0.0` |
| `@chainlink/contracts` | `1.5.0` |

## Dependency Update Playbook
Expand Down
Loading
Loading