Commit ea3c161
authored
feat: split gw ctm deployer (#4615)
## What ❔
For the purposes of zksync os integration, we had to split
GatewayCTMDeployer into multiple contracts.
Also, we had to adapt some of the scripts to work fine with the latest
zksync os workflows
## Why ❔
<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- The `Why` has to be clear to non-Matter Labs entities running their
own ZK Chain -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->
## Is this a breaking change?
- [ ] Yes
- [ ] No
## Operational changes
<!-- Any config changes? Any new flags? Any changes to any scripts? -->
<!-- Please add anything that non-Matter Labs entities running their own
ZK Chain may need to know -->
## 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.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.1 parent 1032e2a commit ea3c161
File tree
11 files changed
+213
-76
lines changed- zkstack_cli/crates
- config/src/forge_interface/gateway_vote_preparation
- zkstack/src/commands/chain
- args/init
- gateway
- init
11 files changed
+213
-76
lines changed- .github/workflows/slither.yaml+1-1
- .gitignore-1
- .prettierignore+3-1
- AllContractsHashes.json+423-353
- configs/genesis/zksync-os/latest.json+35-19
- l1-contracts/AGENTS.md+133
- l1-contracts/contracts/bridge/asset-tracker/IL1AssetTracker.sol+2
- l1-contracts/contracts/bridge/asset-tracker/IL2AssetTracker.sol+6
- l1-contracts/contracts/bridge/asset-tracker/L1AssetTracker.sol+1
- l1-contracts/contracts/bridge/asset-tracker/L2AssetTracker.sol+2
- l1-contracts/contracts/common/L1ContractErrors.sol+10-8
- l1-contracts/contracts/interop/InteropCenter.sol+2-1
- l1-contracts/contracts/interop/InteropErrors.sol+2
- l1-contracts/contracts/l2-system/zksync-os/SystemContext.sol+38
- l1-contracts/contracts/state-transition/chain-deps/GatewayCTMDeployer.sol-506
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployer.sol+225
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerCTM.sol+30
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerCTMBase.sol+168
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerCTMZKsyncOS.sol+30
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerDA.sol+46
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerProxyAdmin.sol+37
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerValidatorTimelock.sol+46
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerVerifiers.sol+57
- l1-contracts/contracts/state-transition/chain-deps/gateway-ctm-deployer/GatewayCTMDeployerVerifiersZKsyncOS.sol+66
- l1-contracts/deploy-scripts/gateway/GatewayCTMDeployerHelper.sol+892-273
- l1-contracts/deploy-scripts/gateway/GatewayVotePreparation.s.sol+78-31
- l1-contracts/deploy-scripts/utils/Types.sol+1-1
- l1-contracts/deploy-scripts/utils/Utils.sol+34-5
- l1-contracts/deploy-scripts/utils/bytecode/BytecodeUtils.s.sol+1-1
- l1-contracts/deploy-scripts/utils/deploy/Create2FactoryUtils.s.sol+2-5
- l1-contracts/deploy-scripts/utils/deploy/L1L2DeployUtils.sol+53
- l1-contracts/package.json+3-3
- l1-contracts/selectors+134-46
- l1-contracts/test/foundry/l1/integration/AssetRouterTest.t.sol+47
- l1-contracts/test/foundry/l1/integration/AssetTrackerTest.t.sol+191-4
- l1-contracts/test/foundry/l1/integration/BridgehubNormalTest.t.sol+136-14
- l1-contracts/test/foundry/l1/integration/Bridgehub_7702.t.sol+21-2
- l1-contracts/test/foundry/l1/integration/ChainRegistrationSender.t.sol+38-14
- l1-contracts/test/foundry/l1/integration/DeploymentTest.t.sol+22
- l1-contracts/test/foundry/l1/integration/L1ChainAssetHandlerTest.t.sol+92-3
- l1-contracts/test/foundry/l1/integration/L1GatewayTests.t.sol+132-2
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/GW_CTMDeployer.t.sol-46
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2AssetRouterAttributesEncodingRegressionTestAbstract.t.sol+127
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2AssetRouterReceiveMessageAccessControlRegressionTestAbstract.t.sol+134
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2AssetRouterReceiveMessageValueForwardingRegressionTestAbstract.t.sol+216
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2AssetTracker.t.sol+45-4
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2BridgehubAliasRegressionTestAbstract.t.sol+139
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2Erc20TestAbstract.t.sol+13-3
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2GatewayTestAbstract.t.sol+50-20
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropDestinationChainRegressionTestAbstract.t.sol+180
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropExecuteBundleTestAbstract.t.sol+26-2
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropHandlerReentrancyRegressionTestAbstract.t.sol+292
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropHandlerTestAbstract.t.sol+203-8
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropIndirectCallValueRegressionTestAbstract.t.sol+674
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropLibraryBasicTestAbstract.t.sol+55-4
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropNativeTokenDifferentBaseTestAbstract.t.sol+14-2
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropNativeTokenSimpleTestAbstract.t.sol+20-5
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropTestUtils.sol+48-5
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2InteropUnbundleTestAbstract.t.sol+53-3
- l1-contracts/test/foundry/l1/integration/l2-tests-abstract/L2NativeTokenVaultTestAbstract.t.sol+630-1
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/GW_CTMDeployerL1Test.t.sol-55
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2AssetRouterAttributesEncodingRegressionL1Test.t.sol+62
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2AssetRouterReceiveMessageAccessControlRegressionL1Test.t.sol+66
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2AssetRouterReceiveMessageValueForwardingRegressionL1Test.t.sol+64
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2BridgehubAliasRegressionL1Test.t.sol+59
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2InteropDestinationChainRegressionL1Test.t.sol+63
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2InteropHandlerReentrancyRegressionL1Test.t.sol+61
- l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2InteropIndirectCallValueRegressionL1Test.t.sol+63
- l1-contracts/test/foundry/l1/integration/upgrade-envs/script-out/local-core.toml+3-3
- l1-contracts/test/foundry/l1/integration/upgrade-envs/script-out/local-ctm.toml+72-80
- l1-contracts/test/foundry/l1/unit/concrete/Bridge/AssetTracker/GWAssetTracker.t.sol+738
- l1-contracts/test/foundry/l1/unit/concrete/Bridgehub/L1MessageRoot_PlaceholderRegressionTest.t.sol+248
- l1-contracts/test/foundry/l1/unit/concrete/Bridgehub/L2MessageVerificationDepthRegression.t.sol+265
- l1-contracts/test/foundry/l1/unit/concrete/Bridgehub/MessageRoot.t.sol+33-5
- l1-contracts/test/foundry/l1/unit/concrete/GatewayCTMDeployer/GatewayCTMDeployerZKsyncOS.t.sol+246
- l1-contracts/test/foundry/l1/unit/concrete/Libraries/UnsafeBytes.t.sol+101
- l1-contracts/test/foundry/l2/unit/GatewayCTMDeployer/GatewayCTMDeployer.t.sol+171-72
- l1-contracts/test/foundry/unit/utils/GatewayCTMDeployerTestUtils.sol+110
- l1-contracts/test/foundry/zksync-os/unit/SystemContextTest.t.sol+126
- l1-contracts/zkstack-out/IDeployCTM.sol/IDeployCTM.json+3-3
- l1-contracts/zkstack-out/IL2AssetTracker.sol/IL2AssetTracker.json+25
- tools/zksync-os-genesis-gen/src/consts.rs+41-19
- tools/zksync-os-genesis-gen/src/genesis.rs+10-5
- tools/zksync-os-genesis-gen/src/utils.rs+11-2
Lines changed: 5 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | | - | |
| 6 | + | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 17 | | |
27 | 18 | | |
28 | 19 | | |
| |||
52 | 43 | | |
53 | 44 | | |
54 | 45 | | |
55 | | - | |
56 | | - | |
| 46 | + | |
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
60 | 50 | | |
61 | 51 | | |
62 | 52 | | |
63 | | - | |
| 53 | + | |
64 | 54 | | |
65 | 55 | | |
66 | 56 | | |
| |||
70 | 60 | | |
71 | 61 | | |
72 | 62 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 63 | | |
85 | 64 | | |
86 | 65 | | |
| |||
91 | 70 | | |
92 | 71 | | |
93 | 72 | | |
94 | | - | |
| 73 | + | |
95 | 74 | | |
96 | 75 | | |
97 | 76 | | |
| |||
107 | 86 | | |
108 | 87 | | |
109 | 88 | | |
110 | | - | |
| 89 | + | |
111 | 90 | | |
112 | 91 | | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
Lines changed: 25 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| |||
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
63 | | - | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
68 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
69 | 81 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
78 | 92 | | |
79 | 93 | | |
80 | 94 | | |
| |||
141 | 155 | | |
142 | 156 | | |
143 | 157 | | |
144 | | - | |
145 | 158 | | |
146 | 159 | | |
147 | 160 | | |
148 | 161 | | |
149 | 162 | | |
150 | 163 | | |
151 | 164 | | |
152 | | - | |
| 165 | + | |
153 | 166 | | |
154 | 167 | | |
155 | 168 | | |
| |||
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
37 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| |||
44 | 61 | | |
45 | 62 | | |
46 | 63 | | |
47 | | - | |
| 64 | + | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
| |||
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
57 | | - | |
| 74 | + | |
58 | 75 | | |
59 | 76 | | |
60 | 77 | | |
| |||
Lines changed: 42 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
66 | 79 | | |
67 | 80 | | |
68 | 81 | | |
| |||
83 | 96 | | |
84 | 97 | | |
85 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
86 | 102 | | |
87 | 103 | | |
88 | 104 | | |
| |||
93 | 109 | | |
94 | 110 | | |
95 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
96 | 115 | | |
97 | 116 | | |
98 | 117 | | |
| |||
131 | 150 | | |
132 | 151 | | |
133 | 152 | | |
134 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
135 | 157 | | |
136 | 158 | | |
137 | | - | |
138 | 159 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
142 | 169 | | |
143 | 170 | | |
144 | 171 | | |
| |||
217 | 244 | | |
218 | 245 | | |
219 | 246 | | |
220 | | - | |
| 247 | + | |
221 | 248 | | |
| 249 | + | |
222 | 250 | | |
223 | 251 | | |
224 | 252 | | |
225 | 253 | | |
226 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
227 | 262 | | |
228 | 263 | | |
229 | 264 | | |
| |||
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
53 | 64 | | |
54 | 65 | | |
55 | 66 | | |
| |||
469 | 480 | | |
470 | 481 | | |
471 | 482 | | |
472 | | - | |
| 483 | + | |
473 | 484 | | |
474 | 485 | | |
475 | 486 | | |
476 | 487 | | |
477 | 488 | | |
478 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
479 | 493 | | |
480 | 494 | | |
481 | 495 | | |
482 | 496 | | |
483 | | - | |
| 497 | + | |
484 | 498 | | |
485 | 499 | | |
486 | 500 | | |
| |||
0 commit comments