Skip to content

Commit 53c5ae3

Browse files
tweeeeks
1 parent 427d526 commit 53c5ae3

File tree

3 files changed

+34
-28
lines changed

3 files changed

+34
-28
lines changed

docs/zkEVM/architecture/high-level/smart-contracts/main-contracts.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,30 @@
22
comments: true
33
---
44

5-
## L1 main contracts
5+
## Consensus contracts
6+
7+
The following contracts manage consensus mechanisms. They deal with sequencing and verifying transaction batches across the L1 and L2 realms.
8+
9+
### `PolygonRollupBaseEtrog.sol`
10+
11+
[PolygonRollupBaseEtrog.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/lib/PolygonRollupBaseEtrog.sol) is the base contract for rollups and validiums.
12+
13+
### `PolygonZkEVMEtrog.sol`
14+
15+
[PolygonZkEVMEtrog.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/consensus/zkEVM/PolygonZkEVMEtrog.sol) is the rollup contract that inherits from the base contract.
16+
17+
This contract calls the `onSequenceBatches(...)` function on the `PolygonRollupManager.sol` contract to trigger the verification mechanism after successful sequencing through the `sequenceBatches(...)` call.
18+
19+
### `PolygonValidiumEtrog.sol`
20+
21+
[PolygonValidiumEtrog.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol) is the validium contract that inherits from the base contract.
22+
23+
This contract calls the `onSequenceBatches(...)` function on the `PolygonRollupManager.sol` contract to trigger the verification mechanism after successful sequencing through the `sequenceBatchesValidium(...)` call.
24+
25+
!!! info
26+
- Custom chain contracts also exist at the consensus level and extend from common base contracts.
27+
28+
## Rollup manager
629

730
### `PolygonRollupManager.sol`
831

@@ -18,6 +41,8 @@ It is responsible for the verification workflow by supplying updated exit root d
1841
- Getting exit root data by computing all local exit roots of all rollups.
1942
- Calculating batch rewards.
2043

44+
## Bridge
45+
2146
### `PolygonZkEVMBridgeV2.sol`
2247

2348
The [PolygonZkEVMBridgeV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMBridgeV2.sol) is the main communication mechanism between the L1 and L2 realms. It manages bridging and claiming of assets and messages across environments.
@@ -32,6 +57,8 @@ The [PolygonZkEVMBridgeV2.sol](https://github.com/0xPolygonHermez/zkevm-contract
3257
- Providing access to the global exit root manager via the `IBasePolygonZkEVMGlobalExitRoot`.
3358
- Interacting with the `PolygonZkEVMGlobalExitRootL2.sol` contract which exists in the L2 space as part of the bridge functionality.
3459

60+
## Exit roots
61+
3562
### `PolygonZkEVMGlobalExitRootV2.sol`
3663

3764
The [PolygonZkEVMGlobalExitRootV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMGlobalExitRootV2.sol) contract manages the L1 info tree that represents the current state of the system by updating global exit roots on state changes. It does this task across multiple networks and layers.
@@ -42,29 +69,7 @@ The [PolygonZkEVMGlobalExitRootV2.sol](https://github.com/0xPolygonHermez/zkevm-
4269
- Updating exit roots.
4370
- Retrieving latest exit roots and leaf values.
4471

45-
## L1 consensus contracts
46-
47-
The following contracts manage consensus mechanisms. They deal with sequencing and verifying transaction batches across the L1 and L2 realms.
48-
49-
### `PolygonRollupBaseEtrog.sol`
50-
51-
[PolygonRollupBaseEtrog.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/lib/PolygonRollupBaseEtrog.sol) is the base contract for rollups and validiums.
52-
53-
### `PolygonZkEVMEtrog.sol`
54-
55-
[PolygonZkEVMEtrog.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/consensus/zkEVM/PolygonZkEVMEtrog.sol) is the rollup contract that inherits from the base contract.
56-
57-
This contract calls the `onSequenceBatches(...)` function on the `PolygonRollupManager.sol` contract to trigger the verification mechanism after successful sequencing through the `sequenceBatches(...)` call.
58-
59-
### `PolygonValidiumEtrog.sol`
60-
61-
[PolygonValidiumEtrog.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol) is the validium contract that inherits from the base contract.
62-
63-
This contract calls the `onSequenceBatches(...)` function on the `PolygonRollupManager.sol` contract to trigger the verification mechanism after successful sequencing through the `sequenceBatchesValidium(...)` call.
6472

65-
<!-- custom validium contracts
66-
### `PolygonRollupBaseEtrogNoGap.sol`
67-
### `PolygonValidiumStorageMigration.sol`-->
6873

6974
!!! tip
7075
- For more information, and the Solidity code, check out the [API section](api/PolygonRollupManager.md).

docs/zkEVM/architecture/high-level/smart-contracts/overview.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ The [PolygonRollupManager.sol](https://github.com/0xPolygonHermez/zkevm-contract
3737
![Polygon Solidity smart contract rollup manager](../../../../img/cdk/high-level-architecture/rollup-manager.png){ width=80% }
3838
</center>
3939

40-
41-
4240
## Bridge
4341

4442
The unified bridge contract [PolygonZkEVMBridgeV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMBridgeV2.sol) is responsible for bridging and claiming activity across L1 and L2 chains.

docs/zkEVM/architecture/high-level/smart-contracts/sequencing.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ comments: true
44

55
Transactions flowing through the system reach the smart contract environment after one of two contract call use cases:
66

7-
- Sequence batches requests coming from the sequencer component.
8-
- Verifying batches requests coming from the aggregator component.
7+
- Sequence batches requests coming from the sequencer component in the node.
8+
- Verifying batches requests coming from the aggregator component in the node.
99

10-
This section looks at the sequencing workflow. The diagram below shows the sequencing workflow for rollup (non-validium) stacks.
10+
This section looks at the sequencing workflow. The diagram below shows the sequencing workflow for rollup (non-validium) stacks which calls `sequenceBatches(...)` and `onSequenceBatches(...)`.
1111

1212
![Polygon Solidity smart contract architecture](../../../../img/cdk/high-level-architecture/sequencing-flow.png)
1313

@@ -57,6 +57,9 @@ Stepwise, the function does the following:
5757

5858
## `sequenceBatchesValidium(batches, l2Coinbase, dataAvailabilityMessage)`
5959

60+
!!! info
61+
- This function is not included in the sequence diagram above.
62+
6063
This function is called on the `PolygonValidiumEtrog.sol` contract.
6164

6265
The sequencing logic is nearly the same as for the rollup `sequenceBatches(...)` function except the function takes a `ValidiumBatchData[]` array instead of `BatchData[]`. This means that, instead of passing the actual transaction data, the struct passes the hashes of the transactions.

0 commit comments

Comments
 (0)