Skip to content

Commit 198dd4d

Browse files
0xValerazkzoomer
andauthored
docs: migrate docs from era-contracts (#4579)
## What ❔ There was still some documentation present in `era-contracts` repository. Since we try to store all of the docs in `zksync-era` currently it leads to duplication of docs and negative work whenever someone pushes new docs/changes to `era-contracts` instead of `zksync-era`. This PR moves/corrects all of the docs from `era-contracts` that was missed here. This is not a permanent solution, since `zksync-era` repo will be deprecated eventually, but it's the best solution we agreed upon as protocol team for the time being. The respective PR in `era-contracts` is [here](matter-labs/era-contracts#1845). <!-- 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? --> <!-- 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`. --------- Co-authored-by: zkzoomer <[email protected]>
1 parent 9ea1794 commit 198dd4d

29 files changed

+845
-611
lines changed

docs/src/SUMMARY.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
- [Chain genesis](specs/contracts/chain_management/chain_genesis.md)
7070
- [Standard Upgrade process](specs/contracts/chain_management/upgrade_process.md)
7171
- [Bridging](specs/contracts/bridging/overview.md)
72+
- [Asset Router and NTV](specs/contracts/bridging/asset_router_and_ntv/overview.md)
7273
- [Asset Router](specs/contracts/bridging/asset_router_and_ntv/asset_router.md)
7374
- [Native token vault](specs/contracts/bridging/asset_router_and_ntv/native_token_vault.md)
7475
- [Interop](specs/contracts/interop/overview.md)
@@ -77,7 +78,7 @@
7778
- [Interop messages](specs/contracts/interop/interop_messages.md)
7879
- [Examples](specs/contracts/interop/examples/README.md)
7980
- [Cross-chain message](specs/contracts/interop/examples/cross_chain_message.md)
80-
- [Settlement Contracts](specs/contracts/settlement_contracts/zkchain_basics.md)
81+
- [Settlement Contracts](specs/contracts/settlement_contracts/overview.md)
8182
- [L1 <> L2 communication](specs/contracts/settlement_contracts/priority_queue/README.md)
8283
- [Handling L1→L2 operations](specs/contracts/settlement_contracts/priority_queue/l1_l2_communication/l1_to_l2.md)
8384
- [L2→L1 communication](specs/contracts/settlement_contracts/priority_queue/l1_l2_communication/l2_to_l1.md)
@@ -91,25 +92,26 @@
9192
- [Custom DA support](specs/contracts/settlement_contracts/data_availability/custom_da.md)
9293
- [Rollup DA support](specs/contracts/settlement_contracts/data_availability/rollup_da.md)
9394
- [Standard pubdata format](specs/contracts/settlement_contracts/data_availability/standard_pubdata_format.md)
94-
- [State diff compression v1 spec](specs/contracts/settlement_contracts/data_availability/state_diff_compression_v1_spec.md)
9595
- [Gateway](specs/contracts/gateway/overview.md)
9696
- [Chain migration](specs/contracts/gateway/chain_migration.md)
9797
- [L1->L2 messaging via gateway](specs/contracts/gateway/messaging_via_gateway.md)
9898
- [L2->L1 messaging via gateway](specs/contracts/gateway/l2_gw_l1_messaging.md)
9999
- [Gateway protocol versioning](specs/contracts/gateway/gateway_protocol_upgrades.md)
100100
- [DA handling on Gateway](specs/contracts/gateway/gateway_da.md)
101-
- [Consensus](specs/contracts/consensus/README.md)
102-
- [Consensus Registry](specs/contracts/consensus/consensus-registry.md)
103101
- [zkEVM](specs/contracts/zkevm/overview.md)
104102
- [Batches and blocks on ZKsync](specs/contracts/zkevm/batches_and_blocks_on_zksync.md)
105103
- [Bootloader](specs/contracts/zkevm/bootloader.md)
106104
- [System contracts](specs/contracts/zkevm/system_contracts.md)
107-
- [Precompiles](specs/contracts/zkevm/precompiles.md)
108105
- [Account abstraction](specs/contracts/zkevm/account_abstraction.md)
109106
- [Fee model](specs/contracts/zkevm/zksync_fee_model.md)
107+
- [EVM Emulation](specs/contracts/evm_emulation/technical_overview.md)
108+
- [Differences from Cancun EVM](specs/contracts/evm_emulation/differences_from_cancun_evm.md)
109+
- [EVM Gas Emulation](specs/contracts/evm_emulation/evm_gas_emulation.md)
110+
- [EVM Predeploys List](specs/contracts/evm_emulation/evm_predeploys_list.md)
110111
- [Upgrade history](specs/upgrade_history/gateway_upgrade/README.md)
111112
- [Gateway upgrade diff](specs/upgrade_history/gateway_upgrade/gateway_diff_review.md)
112113
- [Gateway upgrade process](specs/upgrade_history/gateway_upgrade/upgrade_process_no_gateway_chain.md)
114+
- [V27 EVM Emulation Upgrade](specs/upgrade_history/v27_evm_emulation/v27_evm_emulation.md)
113115
- [Prover](specs/prover/overview.md)
114116
- [Getting Started](specs/prover/getting_started.md)
115117
- [ZK Terminology](specs/prover/zk_terminology.md)

docs/src/specs/contracts/README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<!--- WIP --->
2-
31
# ZK Stack contracts specs
42

53
The order of the files here only roughly represents the order of reading. A lot of topics are intertwined, so it is recommended to read everything first to have a complete picture and then refer to specific documents for more details.
@@ -13,6 +11,7 @@ The order of the files here only roughly represents the order of reading. A lot
1311
- [Chain genesis](../contracts/chain_management/chain_genesis.md)
1412
- [Standard Upgrade process](../contracts/chain_management/upgrade_process.md)
1513
- [Bridging](../contracts/bridging/overview.md)
14+
- [Asset Router and NTV](../contracts/bridging/asset_router_and_ntv/overview.md)
1615
- [Asset Router](../contracts/bridging/asset_router_and_ntv/asset_router.md)
1716
- [Native token vault](../contracts/bridging/asset_router_and_ntv/native_token_vault.md)
1817
- [Interop](../contracts/interop/overview.md)
@@ -21,7 +20,7 @@ The order of the files here only roughly represents the order of reading. A lot
2120
- [Interop messages](../contracts/interop/interop_messages.md)
2221
- [Examples](../contracts/interop/examples/README.md)
2322
- [Cross-chain message](../contracts/interop/examples/cross_chain_message.md)
24-
- [Settlement Contracts](../contracts/settlement_contracts/zkchain_basics.md)
23+
- [Settlement Contracts](../contracts/settlement_contracts/overview.md)
2524
- [L1 <> L2 communication](../contracts/settlement_contracts/priority_queue/README.md)
2625
- [Handling L1→L2 operations](../contracts/settlement_contracts/priority_queue/l1_l2_communication/l1_to_l2.md)
2726
- [L2→L1 communication](../contracts/settlement_contracts/priority_queue/l1_l2_communication/l2_to_l1.md)
@@ -35,22 +34,22 @@ The order of the files here only roughly represents the order of reading. A lot
3534
- [Custom DA support](../contracts/settlement_contracts/data_availability/custom_da.md)
3635
- [Rollup DA support](../contracts/settlement_contracts/data_availability/rollup_da.md)
3736
- [Standard pubdata format](../contracts/settlement_contracts/data_availability/standard_pubdata_format.md)
38-
- [State diff compression v1 spec](../contracts/settlement_contracts/data_availability/state_diff_compression_v1_spec.md)
3937
- [Gateway](../contracts/gateway/overview.md)
4038
- [Chain migration](../contracts/gateway/chain_migration.md)
4139
- [L1->L2 messaging via gateway](../contracts/gateway/messaging_via_gateway.md)
4240
- [L2->L1 messaging via gateway](../contracts/gateway/l2_gw_l1_messaging.md)
4341
- [Gateway protocol versioning](../contracts/gateway/gateway_protocol_upgrades.md)
4442
- [DA handling on Gateway](../contracts/gateway/gateway_da.md)
45-
- [Consensus](../contracts/consensus/README.md)
46-
- [Consensus Registry](../contracts/consensus/consensus-registry.md)
4743
- [zkEVM](../contracts/zkevm/overview.md)
4844
- [Batches and blocks on ZKsync](../contracts/zkevm/batches_and_blocks_on_zksync.md)
4945
- [Bootloader](../contracts/zkevm/bootloader.md)
5046
- [System contracts](../contracts/zkevm/system_contracts.md)
51-
- [Precompiles](../contracts/zkevm/precompiles.md)
5247
- [Account abstraction](../contracts/zkevm/account_abstraction.md)
5348
- [Fee model](../contracts/zkevm/zksync_fee_model.md)
49+
- [EVM Emulation](../contracts/evm_emulation/technical_overview.md)
50+
- [Differences from Cancun EVM](../contracts/evm_emulation/differences_from_cancun_evm.md)
51+
- [EVM Gas Emulation](../contracts/evm_emulation/evm_gas_emulation.md)
52+
- [EVM Predeploys List](../contracts/evm_emulation/evm_predeploys_list.md)
5453

5554
![Reading order](./img/reading_order.png)
5655

@@ -68,10 +67,10 @@ The repository contains the following sections:
6867

6968
This section is for auditors of the codebase. It includes some of the important invariants that the system relies on and which if broken could have bad consequences.
7069

71-
- Assuming that the accepting CTM is correct & efficient, the L1→GW part of the L1→GW→L3 transaction never fails. It is assumed that the provided max amount for gas is always enough for any transaction that can realistically come from L1.
70+
- Assuming that the accepting CTM is correct & efficient, the L1→GW part of the L1→GW→L2 transaction never fails. It is assumed that the provided max amount for gas is always enough for any transaction that can realistically come from L1.
7271
- GW → L1 migration never fails. If it is possible to get into a state where the migration is not possible to finish, then the chain is basically lost. There are some exceptions where for now it is the expected behavior. (check out the “Migration invariants & protocol upgradability” section)
7372
- The general consistency of chains when migration between different settlement layers is done. Including the feasibility of emergency upgrades, etc. I.e. whether the whole system is thought-through.
74-
- Preimage attacks in the L3→L1 tree, we apply special prefixes to ensure that the tree structure is fixed, i.e. all logs are 88 bytes long (this is for backwards compatibility reasons). For batch leaves and chain id leaves we use special prefixes.
73+
- Preimage attacks in the L2→L1 tree, we apply special prefixes to ensure that the tree structure is fixed, i.e. all logs are 88 bytes long (this is for backwards compatibility reasons). For batch leaves and chain id leaves we use special prefixes.
7574
- Data availability guarantees. Whether rollup users can always restore all their storage slots, etc. An example of a potential tricky issue can be found in “Security notes for Gateway-based rollups” [in this document](./gateway/gateway_da.md).
7675

7776
The desired properties of the system are that funds can not be stolen from the L1 contracts, and that L2 constracts are executed securely.
258 KB
Loading
144 KB
Loading
252 KB
Loading
770 KB
Loading
512 KB
Loading

0 commit comments

Comments
 (0)