Skip to content

Commit 8da2634

Browse files
0xValerazkzoomerDeniallugomm-zkRaid5594
authored
feat: Interop fees (#1911)
# What ❔ This is a sister PR to matter-labs/zksync-era#4612 [WIP], to be filled <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. --------- Signed-off-by: Danil <deniallugo@gmail.com> Co-authored-by: zkzoomer <sergio@zkzoomer.io> Co-authored-by: Danil <deniallugo@gmail.com> Co-authored-by: Marcin M <128217157+mm-zk@users.noreply.github.com> Co-authored-by: Raid Ateir <ateirraid@gmail.com> Co-authored-by: Raid5594 <52794079+Raid5594@users.noreply.github.com> Co-authored-by: Vladislav Volosnikov <vladyan18@gmail.com> Co-authored-by: EmilLuta <evl@matterlabs.dev> Co-authored-by: EmilLuta <EmilLuta@users.noreply.github.com> Co-authored-by: AntonD3 <74021421+AntonD3@users.noreply.github.com> Co-authored-by: Stanislav Bezkorovainyi <stanislavbezkor@gmail.com> Co-authored-by: kelemeno <kl@matterlabs.dev> Co-authored-by: kelemeno <34402761+kelemeno@users.noreply.github.com> Co-authored-by: mm <mm@matterlabs.dev> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Alexander Melnikov <sanekmelnikov@gmail.com> Co-authored-by: nikitastupin-matterlabs <178824211+nikitastupin-matterlabs@users.noreply.github.com> Co-authored-by: Anton Baliasnikov <aba@matterlabs.dev> Co-authored-by: zksync[bot] <zksync[bot]@users.noreply.github.com>
1 parent 03634a6 commit 8da2634

File tree

88 files changed

+5229
-1153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+5229
-1153
lines changed

.markdownlintignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# root
22
node_modules
3+
CLAUDE.md
4+
AGENTS.md
35

46
# l1-contracts
57
l1-contracts/node_modules
6-
l1-contracts/CLAUDE.md
7-
l1-contracts/AGENTS.md
88

99
# l1-contracts-foundry
1010
l1-contracts-foundry/lib
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,56 @@ address result = _tryAddress(target, "someFunction()");
4646
- If you want to add an immutable for L1, always double check whether it is possible to deterministically obtain from other contracts.
4747
- 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.
4848

49+
## Updating test_infra Git Dependencies (Bootloader Tests)
50+
51+
### Problem
52+
53+
The bootloader test infrastructure at `system-contracts/bootloader/test_infra/` uses `nightly-2025-05-23` and has git
54+
dependencies on `zksync-era`. When the git rev in `Cargo.toml` is updated, **do NOT run `cargo update` or regenerate
55+
the entire `Cargo.lock`**. A full re-resolve will pull in latest crates.io versions of transitive dependencies (e.g.,
56+
`crc-fast`, `zerocopy`) that use `stdarch_x86_avx512` intrinsics, which are not stabilized on this nightly toolchain.
57+
This causes CI build failures on x86_64 runners.
58+
59+
### Correct Approach: Selective Lockfile Update
60+
61+
When updating the zksync-era git rev in `Cargo.toml`, update the lockfile by targeting only the git dependencies:
62+
63+
```bash
64+
cd system-contracts/bootloader/test_infra
65+
66+
# Update only the git dependencies, keeping all crates.io deps pinned
67+
cargo update -p zksync_multivm -p zksync_types -p zksync_contracts \
68+
-p zksync_utils -p zksync_state -p zksync_vlog
69+
```
70+
71+
This swaps the git rev for the zksync-era crates while preserving all other dependency versions at their current
72+
(known-working) state.
73+
74+
### If the Lockfile Is Already Broken
75+
76+
If a full `cargo update` was already run and the lockfile has incompatible versions, restore from the last known-good
77+
commit and selectively update:
78+
79+
```bash
80+
cd system-contracts/bootloader/test_infra
81+
82+
# Restore the old working lockfile (find the last commit before the breakage)
83+
git show <last-good-commit>:system-contracts/bootloader/test_infra/Cargo.lock > Cargo.lock
84+
85+
# Then selectively update only git deps
86+
cargo update -p zksync_multivm -p zksync_types -p zksync_contracts \
87+
-p zksync_utils -p zksync_state -p zksync_vlog
88+
```
89+
90+
### Known Incompatible Crate Versions (on nightly-2025-05-23)
91+
92+
These versions require `stdarch_x86_avx512` (stabilized in Rust 1.89) and fail on `nightly-2025-05-23`:
93+
94+
- `crc-fast >= 1.4` (all versions use AVX-512 intrinsics on x86_64)
95+
- `zerocopy >= 0.8.39`
96+
97+
Known-good versions: `crc-fast 1.3.0`, `zerocopy 0.8.27`
98+
4999
## Debugging Strategies
50100

51101
When debugging Solidity compilation or script failures:

AllContractsHashes.json

Lines changed: 429 additions & 419 deletions
Large diffs are not rendered by default.
File renamed without changes.

configs/genesis/era/latest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"minor": 31,
55
"patch": 0
66
},
7-
"genesis_root": "0x26ff4c90ceb9b60cc86feb88f416a6214cb9a64a360d686526b1d85067e56519",
7+
"genesis_root": "0xd14523fbdf862f8c90ad9c8d4f15633f71685ca0b3a87395051af05a665521e4",
88
"genesis_rollup_leaf_index": 104,
9-
"genesis_batch_commitment": "0x521dd5afd12900722822f74a13b5d515074bb084bc03bafe0068eceed22a1d25",
10-
"bootloader_hash": "0x0100098b957008dda66d37766dc973bac46b3b69405d9cd584aa64548a17f43f",
11-
"default_aa_hash": "0x010005f77c5bcc9dfe0869ea74a11c79eee954e100d1f79c3fe19f98307b3689",
9+
"genesis_batch_commitment": "0x3bce47b3d7a1c55c8dd067392a1a084f2470265f5a71461bcf28fe927af7195d",
10+
"bootloader_hash": "0x01000997783d068e1865ddd522fd4d99fb4385e5f32bd876b953fa1415a28112",
11+
"default_aa_hash": "0x010005f9b417b825b2e9faaf9c727b7afd29c5a1b65269ff6f429320b7b87e4b",
1212
"evm_emulator_hash": "0x01000d8bae37b82f311186426184866498b357f41d7a02ced11f3e3fbfbacd63",
1313
"prover": {
1414
"recursion_scheduler_level_vk_hash": "0x1ffc56111a5cfaf5db387f6a31408ad20217e9bc1f31f2f5c1bd38b0d6d7968b",

configs/genesis/era/latest.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
protocol_semantic_version = 133143986176
2-
genesis_root = "0x26ff4c90ceb9b60cc86feb88f416a6214cb9a64a360d686526b1d85067e56519"
2+
genesis_root = "0xd14523fbdf862f8c90ad9c8d4f15633f71685ca0b3a87395051af05a665521e4"
33
genesis_rollup_leaf_index = 104
4-
genesis_batch_commitment = "0x521dd5afd12900722822f74a13b5d515074bb084bc03bafe0068eceed22a1d25"
5-
bootloader_hash = "0x0100098b957008dda66d37766dc973bac46b3b69405d9cd584aa64548a17f43f"
6-
default_aa_hash = "0x010005f77c5bcc9dfe0869ea74a11c79eee954e100d1f79c3fe19f98307b3689"
4+
genesis_batch_commitment = "0x3bce47b3d7a1c55c8dd067392a1a084f2470265f5a71461bcf28fe927af7195d"
5+
bootloader_hash = "0x01000997783d068e1865ddd522fd4d99fb4385e5f32bd876b953fa1415a28112"
6+
default_aa_hash = "0x010005f9b417b825b2e9faaf9c727b7afd29c5a1b65269ff6f429320b7b87e4b"
77
evm_emulator_hash = "0x01000d8bae37b82f311186426184866498b357f41d7a02ced11f3e3fbfbacd63"
88

99
[prover]

l1-contracts/contracts/bridge/asset-tracker/AssetTrackerErrors.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ error InvalidCanonicalTxHash(bytes32);
1515
error InvalidChainMigrationNumber(uint256, uint256);
1616
// 0x24ef4f8a
1717
error InvalidEmptyMessageRoot(bytes32 expectedMessageRoot, bytes32 providedMessageRoot);
18+
// 0x768dc598
19+
error InvalidFeeRecipient();
1820
// 0x532a43fc
1921
error InvalidFunctionSignature(bytes4 functionSignature);
2022
// 0xfbf8ed35
@@ -51,6 +53,8 @@ error OnlyGatewaySettlementLayer();
5153
error OnlyWhitelistedSettlementLayer(address, address);
5254
// 0x174996d5
5355
error RegisterNewTokenNotAllowed();
56+
// 0xaad86dcd
57+
error SettlementFeePayerNotAgreed(address payer, uint256 chainId);
5458
// 0x90ed63bb
5559
error TokenBalanceNotMigratedToGateway(bytes32, uint256, uint256);
5660
// 0x03a5ba47

0 commit comments

Comments
 (0)