Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a1519e3
Update ZKsyncOSDualVerifier.sol
0xValera Nov 28, 2025
4c52b9b
add EmptyData reverts
0xValera Nov 28, 2025
4724087
add ASSET_ROUTER public getter
0xValera Nov 28, 2025
b55d76e
add initializer modifier
0xValera Nov 30, 2025
79f7429
fix test
0xValera Dec 2, 2025
3fbd2d1
Update L2NativeTokenVault.sol
0xValera Dec 15, 2025
f9a86ef
fix: fix GatewayVotePreparation.s.sol (#1999)
AntonD3 Jan 27, 2026
522d69f
Claude/foundry gateway vote test n1c hd (#2001)
kelemeno Jan 28, 2026
99c2004
chore: fix genesis tool issue with bridgehub contract name (#2005)
antonbaliasnikov Jan 29, 2026
89c632e
chore: fix recompute_hashes.sh with linux regexp for forge 0.0.4 (#2007)
antonbaliasnikov Jan 30, 2026
062ec44
Claude/fix zkfoundry 3 uw f cx (#2010)
kelemeno Feb 2, 2026
117c440
fix: token balance migration fixes (#1985)
zkzoomer Feb 2, 2026
10c95a1
chore: more abis (#2012)
zkzoomer Feb 2, 2026
0f1adab
Merge branch 'draft-v31' of https://github.com/matter-labs/era-contra…
0xValera Feb 4, 2026
dd5c39e
Merge pull request #1852 from matter-labs/vg/oz-zkos-L-01
0xValera Feb 4, 2026
4f01faf
Merge pull request #1872 from matter-labs/vg/oz-zkos-L-02
0xValera Feb 4, 2026
4c0a5be
Merge branch 'vg/merge-v30-non-interop-audit-fixes' of https://github…
0xValera Feb 4, 2026
82a2a35
lint
0xValera Feb 4, 2026
8e1f5b4
Merge pull request #1853 from matter-labs/vg/oz-zkos-L-03
0xValera Feb 4, 2026
f2c22ca
Merge branch 'vg/merge-v30-non-interop-audit-fixes' of https://github…
0xValera Feb 4, 2026
b93341d
Merge pull request #1854 from matter-labs/vg/oz-zkos-L-04
0xValera Feb 4, 2026
b960052
Revert "fix: OZ ZKsync OS non interop v30, L-04"
0xValera Feb 4, 2026
02ac4e9
Merge pull request #2016 from matter-labs/revert-1854-vg/oz-zkos-L-04
0xValera Feb 4, 2026
01ac190
fix: emit GatewayToL1MigrationInitiated (#2014)
zkzoomer Feb 4, 2026
2cf2f57
fix: index chain id on GatewayToL1MigrationInitiated (#2020)
zkzoomer Feb 6, 2026
8411592
Merge branch 'zksync-os-stable' of ssh://github.com/matter-labs/era-c…
kelemeno Feb 10, 2026
171e949
More advanced bootloader and default account unit testing (#2021)
StanislavBreadless Feb 10, 2026
e5d22a7
Merge pull request #2024 from matter-labs/kl/merge-zksyncos
kelemeno Feb 10, 2026
56aecc5
Merge pull request #1978 from matter-labs/kl/v31-upgrade-2
kelemeno Feb 10, 2026
362f018
Across recovery during v31 upgrade (#2022)
StanislavBreadless Feb 11, 2026
5c9d792
interface update (#2019)
kelemeno Feb 12, 2026
224bf18
chore: cleanup `L1AssetTracker` and `L1MessageRoot` (#2031)
nikitastupin-matterlabs Feb 12, 2026
469a4fd
Simple Stage 1 (#1943)
vladbochok Feb 12, 2026
e69bb44
feat: add migration intervals tracking and verifying settlement layer…
0xValera Feb 12, 2026
038545b
implement basic easier upgrades (#2013)
kelemeno Feb 13, 2026
303f8b7
Add Era 2FA validator
vladbochok Feb 16, 2026
50ae288
Revert "Add Era 2FA validator"
vladbochok Feb 16, 2026
648e5f7
add back system contracts testing (#2033)
kelemeno Feb 17, 2026
b5466ed
chore: merge v30 non interop audit fixes (#2017)
0xValera Feb 17, 2026
7a00eae
feat!: mailbox legacy fns deprecation (#2003)
jcsec-security Feb 17, 2026
03634a6
Set of patches for draft-v31 (#2034)
StanislavBreadless Feb 20, 2026
8da2634
feat: Interop fees (#1911)
0xValera Feb 21, 2026
d3335ea
Remove unneeded pausing logic (#2040)
StanislavBreadless Feb 21, 2026
cb4e195
fix: fix RegisterZKChain script (#2046)
AntonD3 Feb 23, 2026
67e517f
Merge branch 'draft-v31' into ad-sync-draft-v31-with-zksync-os
AntonD3 Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
127 changes: 76 additions & 51 deletions .github/workflows/l1-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,8 @@ jobs:
- name: Build l1 contracts
working-directory: l1-contracts
run: |
rm -rf zkstack-out
yarn build:foundry

# Fail if regenerated zkstack-out differs from what was committed
if [ -n "$(git status --porcelain -- zkstack-out)" ]; then
echo "::error::l1-contracts/zkstack-out is out of date. Run 'cd l1-contracts && yarn build:foundry' and commit the changes."
git --no-pager status --porcelain -- zkstack-out
git --no-pager diff -- zkstack-out || true
exit 1
fi

- name: Build l2 contracts
working-directory: l2-contracts
run: |
Expand Down Expand Up @@ -110,6 +101,41 @@ jobs:
- name: Lint errors
run: yarn l1 errors-lint --check

check-zkstack-out:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install foundry-zksync
uses: ./.github/actions/install-zksync-foundry

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.20.8
cache: yarn

- name: Install dependencies
run: yarn

- name: Build and check zkstack-out
working-directory: l1-contracts
run: |
rm -rf zkstack-out
yarn build:foundry

# Fail if regenerated zkstack-out differs from what was committed
if [ -n "$(git status --porcelain -- zkstack-out)" ]; then
echo "::error::l1-contracts/zkstack-out is out of date. Run 'cd l1-contracts && yarn build:foundry' and commit the changes."
git --no-pager status --porcelain -- zkstack-out
git --no-pager diff -- zkstack-out || true
exit 1
fi

check-hashes:
needs: [build]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -235,48 +261,48 @@ jobs:
# run: forge test --match-test MeasureGas --gas-snapshot-check=true

# FIXME: uncomment once fixed.
# test-foundry-zksync:
# needs: [build, lint]
# runs-on: ubuntu-latest
test-foundry-zksync:
needs: [build, lint]
runs-on: ubuntu-latest

# steps:
# - name: Checkout the repository
# uses: actions/checkout@v4
# with:
# submodules: recursive
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18.20.8
# cache: yarn
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.20.8
cache: yarn

# - name: Install foundry-zksync
# uses: ./.github/actions/install-zksync-foundry
- name: Install foundry-zksync
uses: ./.github/actions/install-zksync-foundry

# - name: Install dependencies
# run: yarn
- name: Install dependencies
run: yarn

# - name: Build system contract artifacts
# run: yarn sc build:foundry
- name: Build system contract artifacts
run: yarn sc build:foundry

# - name: Restore artifacts cache
# uses: actions/cache/restore@v3
# with:
# fail-on-cache-miss: true
# key: artifacts-l1-${{ github.sha }}
# path: |
# da-contracts/out
# l1-contracts/cache-forge
# l1-contracts/out
# # TODO: cached `zkout` and the one for tests produce different hashes and so it causes the tests to fail
# l2-contracts/cache-forge
# l2-contracts/zkout
# system-contracts/zkout
- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/cache-forge
l1-contracts/out
# TODO: cached `zkout` and the one for tests produce different hashes and so it causes the tests to fail
l2-contracts/cache-forge
l2-contracts/zkout
system-contracts/zkout

# - name: Run tests
# working-directory: ./l1-contracts
# run: yarn test:zkfoundry
- name: Run tests
working-directory: ./l1-contracts
run: yarn test:zkfoundry

check-verifier-generator-l1:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -368,15 +394,14 @@ jobs:
ref: v1.16

# To ignore coverage for certain directories modify the paths in this step as needed. The
# below default ignores coverage results for the test and script directories. It also ignores
# the ChainRegistrar contract since it is unused. Alternatively, to include coverage in all
# directories, comment out this step. Note that because this filtering applies to the lcov
# file, the summary table generated in the previous step will still include all files and
# directories. The `--rc branch_coverage=1` part keeps branch info in the filtered report,
# since lcov defaults to removing branch info.
# below default ignores coverage results for the test and script directories. Alternatively,
# to include coverage in all directories, comment out this step. Note that because this
# filtering applies to the lcov file, the summary table generated in the previous step will
# still include all files and directories. The `--rc branch_coverage=1` part keeps branch info
# in the filtered report, since lcov defaults to removing branch info.
- name: Filter directories
run: |
lcov --ignore-errors unused --remove lcov.info 'test/*' 'contracts/dev-contracts/*' 'lib/*' '../lib/*' 'lib/' 'deploy-scripts/*' 'contracts/chain-registrar/ChainRegistrar.sol' --output-file lcov.info --rc branch_coverage=1
lcov --ignore-errors unused --remove lcov.info 'test/*' 'contracts/dev-contracts/*' 'lib/*' '../lib/*' 'lib/' 'deploy-scripts/*' --output-file lcov.info --rc branch_coverage=1

# This step posts a detailed coverage report as a comment and deletes previous comments on
# each push. The below step is used to fail coverage if the specified coverage threshold is
Expand Down
93 changes: 46 additions & 47 deletions .github/workflows/system-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,53 +106,52 @@ jobs:
cd system-contracts/bootloader/test_infra
cargo run

# FIXME: uncomment once fixed.
# test-contracts:
# needs: [build, lint]
# runs-on: ubuntu-latest

# steps:
# - name: Checkout the repository
# uses: actions/checkout@v4

# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18.20.8
# cache: yarn

# - name: Run anvil-zksync
# uses: dutterbutter/anvil-zksync-action@v1.3.0
# with:
# mode: run
# protocolVersion: 29
# evmInterpreter: true
# logFilePath: "anvil_zksync.log"
# offline: true

# - name: Install dependencies
# run: yarn

# - name: Restore artifacts cache
# uses: actions/cache/restore@v3
# with:
# fail-on-cache-miss: true
# key: artifacts-system-${{ github.sha }}
# path: |
# system-contracts/zkout
# system-contracts/cache-forge
# system-contracts/bootloader/build
# system-contracts/artifacts-zk
# system-contracts/cache-zk
# system-contracts/typechain
# system-contracts/contracts-preprocessed

# - name: Run tests
# run: yarn sc test

# - name: Print output logs of anvil-zksync
# if: always()
# run: cat anvil_zksync.log
test-contracts:
needs: [build, lint]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.20.8
cache: yarn

- name: Run anvil-zksync
uses: dutterbutter/anvil-zksync-action@v1.3.0
with:
mode: run
protocolVersion: 29
evmInterpreter: true
logFilePath: "anvil_zksync.log"
offline: true

- name: Install dependencies
run: yarn

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-system-${{ github.sha }}
path: |
system-contracts/zkout
system-contracts/cache-forge
system-contracts/bootloader/build
system-contracts/artifacts-zk
system-contracts/cache-zk
system-contracts/typechain
system-contracts/contracts-preprocessed

- name: Run tests
run: yarn sc test

- name: Print output logs of anvil-zksync
if: always()
run: cat anvil_zksync.log

test-contracts-foundry:
needs: [lint]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cache-zk/
cache/
contracts-preprocessed/
era_test_node.log*
foundry.lock
node_modules/
out/
target/
Expand Down
4 changes: 2 additions & 2 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# root
node_modules
CLAUDE.md
AGENTS.md

# l1-contracts
l1-contracts/node_modules
l1-contracts/CLAUDE.md
l1-contracts/AGENTS.md

# l1-contracts-foundry
l1-contracts-foundry/lib
Expand Down
56 changes: 56 additions & 0 deletions l1-contracts/AGENTS.md → AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,62 @@ address result = _tryAddress(target, "someFunction()");
- They mask initialization issues and timing problems
- The codebase should fail fast and clearly, not silently return defaults

### Constructors and Immutables

- ONLY contracts deployed on L1 should have immutables. Contracts on L2 are deployed within zksync os environment and so and so DO NOT SUPPORT CONSTRUCTORS ALL (and so no immutable can be set). It is important that the `*Base` contracts that the L2 contracts inherit from dont have immutables or constructors too.
- If you want to add an immutable for L1, always double check whether it is possible to deterministically obtain from other contracts.
- If there is variable that can be an immutable on L1, but we need a similar field on L2, a common pattern is to create a method in the base contract that can be inherited by both. On L2 it can be either a constant (esp if it is an L2 built-in contract address) or a storage variable that must be initialized within during the genesis. For example, look how `initL2` functions are used.

## Updating test_infra Git Dependencies (Bootloader Tests)

### Problem

The bootloader test infrastructure at `system-contracts/bootloader/test_infra/` uses `nightly-2025-05-23` and has git
dependencies on `zksync-era`. When the git rev in `Cargo.toml` is updated, **do NOT run `cargo update` or regenerate
the entire `Cargo.lock`**. A full re-resolve will pull in latest crates.io versions of transitive dependencies (e.g.,
`crc-fast`, `zerocopy`) that use `stdarch_x86_avx512` intrinsics, which are not stabilized on this nightly toolchain.
This causes CI build failures on x86_64 runners.

### Correct Approach: Selective Lockfile Update

When updating the zksync-era git rev in `Cargo.toml`, update the lockfile by targeting only the git dependencies:

```bash
cd system-contracts/bootloader/test_infra

# Update only the git dependencies, keeping all crates.io deps pinned
cargo update -p zksync_multivm -p zksync_types -p zksync_contracts \
-p zksync_utils -p zksync_state -p zksync_vlog
```

This swaps the git rev for the zksync-era crates while preserving all other dependency versions at their current
(known-working) state.

### If the Lockfile Is Already Broken

If a full `cargo update` was already run and the lockfile has incompatible versions, restore from the last known-good
commit and selectively update:

```bash
cd system-contracts/bootloader/test_infra

# Restore the old working lockfile (find the last commit before the breakage)
git show <last-good-commit>:system-contracts/bootloader/test_infra/Cargo.lock > Cargo.lock

# Then selectively update only git deps
cargo update -p zksync_multivm -p zksync_types -p zksync_contracts \
-p zksync_utils -p zksync_state -p zksync_vlog
```

### Known Incompatible Crate Versions (on nightly-2025-05-23)

These versions require `stdarch_x86_avx512` (stabilized in Rust 1.89) and fail on `nightly-2025-05-23`:

- `crc-fast >= 1.4` (all versions use AVX-512 intrinsics on x86_64)
- `zerocopy >= 0.8.39`

Known-good versions: `crc-fast 1.3.0`, `zerocopy 0.8.27`

## Debugging Strategies

When debugging Solidity compilation or script failures:
Expand Down
Loading
Loading