You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/zkEVM/architecture/high-level/smart-contracts/main-contracts.md
+28-23Lines changed: 28 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,30 @@
2
2
comments: true
3
3
---
4
4
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
6
29
7
30
### `PolygonRollupManager.sol`
8
31
@@ -18,6 +41,8 @@ It is responsible for the verification workflow by supplying updated exit root d
18
41
- Getting exit root data by computing all local exit roots of all rollups.
19
42
- Calculating batch rewards.
20
43
44
+
## Bridge
45
+
21
46
### `PolygonZkEVMBridgeV2.sol`
22
47
23
48
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
32
57
- Providing access to the global exit root manager via the `IBasePolygonZkEVMGlobalExitRoot`.
33
58
- Interacting with the `PolygonZkEVMGlobalExitRootL2.sol` contract which exists in the L2 space as part of the bridge functionality.
34
59
60
+
## Exit roots
61
+
35
62
### `PolygonZkEVMGlobalExitRootV2.sol`
36
63
37
64
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-
42
69
- Updating exit roots.
43
70
- Retrieving latest exit roots and leaf values.
44
71
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.
64
72
65
-
<!-- custom validium contracts
66
-
### `PolygonRollupBaseEtrogNoGap.sol`
67
-
### `PolygonValidiumStorageMigration.sol`-->
68
73
69
74
!!! tip
70
75
- For more information, and the Solidity code, check out the [API section](api/PolygonRollupManager.md).
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.
Copy file name to clipboardExpand all lines: docs/zkEVM/architecture/high-level/smart-contracts/sequencing.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ comments: true
4
4
5
5
Transactions flowing through the system reach the smart contract environment after one of two contract call use cases:
6
6
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.
9
9
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(...)`.
- This function is not included in the sequence diagram above.
62
+
60
63
This function is called on the `PolygonValidiumEtrog.sol` contract.
61
64
62
65
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