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
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,9 +62,8 @@ This contract calls the `onSequenceBatches(...)` function on the `PolygonRollupM
62
62
63
63
This contract calls the `onSequenceBatches(...)` function on the `PolygonRollupManager.sol` contract to trigger the verification mechanism after successful sequencing through the `sequenceBatchesValidium(...)` call.
Copy file name to clipboardExpand all lines: docs/zkEVM/architecture/high-level/smart-contracts/overview.md
+48-11Lines changed: 48 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,31 +6,68 @@ comments: true
6
6
7
7
## Polygon smart contract architecture
8
8
9
-
The diagram below details the Polygon Solidity smart contract architecture.
9
+
Chain stacks at the node level direct transaction data into the L2 and L1 realms via smart contract calls. The system stores state in binary tree structures containing verifiable local and global exit roots.
10
10
11
-
It shows the key contracts that manage rollup and validium stack behavior, and describes the relationships between them.
11
+
The diagram below details the Polygon Solidity smart contract architecture.
The stacks direct transaction data into the L2 and L1 realms via smart contract calls. The system stores state in binary tree structures containing verifiable local and global exit roots.
15
+
There are four key contract types built into the system design:
16
+
17
+
- The [consensus contract set](#consensus-contracts).
In the Ethereum realm, the set of consensus contracts and the methods they expose fuel the sequencing and verification mechanisms triggered by stack components, such as the sequencer and aggregator, at the node level.
These contracts define the type of chain, i.e. validium or non-validium, and there is usually a single contract per CDK chain that supplies custom functionality.
16
31
17
-
In the Ethereum realm, the set of consensus contracts and the methods they expose fuel the sequencing and verification mechanisms triggered by stack components such as the sequencer and aggregator. We also note the main rollup management contract which is responsible for creating, updating, and verifying rollups.
32
+
## Rollup manager
18
33
19
-
In the L2 realm, the L2 bridge contract manages bridging and claiming activity between L1 and L2, and the exit root mechanisms that govern state at this layer.
34
+
The [PolygonRollupManager.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonRollupManager.sol)contract is responsible for creating, updating, and verifying CDK rollup and validium chains.
20
35
21
-
Back in L1, the system state as a whole is stored on binary trees with data and/or exit roots written into their leaves. Updates at the leaf-level trigger exit root updates which are then available to the consensus contracts via the L1 bridge contract.
The main contracts for the zkEVM rollup stack are [PolygonRollupManager.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonRollupManager.sol)which is responsible for managing rollup and validium transaction batches.
42
+
The L1/L2 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.
26
43
27
-
The L1 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.
In the L1 realm, the bridge also manages the complex exit root mechanism governing system state. In the L2 realm, there is a lighter exit root mechanism that governs state at this layer.
49
+
50
+
## Global exit roots
51
+
52
+
System state as a whole is stored on binary trees with data and/or exit roots written into their leaves.
53
+
54
+
Local updates at the leaf-level trigger exit root updates at the top of the trees which are then available to the global exit root trees and the consensus contracts via the L1 bridge contract.
28
55
29
56
The [PolygonZkEVMGlobalExitRootV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMGlobalExitRootV2.sol) contract manages the exit roots across multiple networks at the Ethereum L1 level.
The L2 exit root management contract, [PolygonZkEVMGlobalExitRootL2.sol](https://github.com/0xPolygon/cdk-validium-contracts/blob/main/contracts/PolygonZkEVMGlobalExitRootL2.sol) has a lighter exit root mechanism.
The CDK validium stacks use the [cdk-validium-contracts](https://github.com/0xPolygon/cdk-validium-contracts/tree/main) which has slightly adjusted behavior to take account of validium components, such as in the [PolygonZkEVMGlobalExitRootL2.sol](https://github.com/0xPolygon/cdk-validium-contracts/blob/main/contracts/PolygonZkEVMGlobalExitRootL2.sol) contract for example.
70
+
CDK validium stacks use the [cdk-validium-contracts](https://github.com/0xPolygon/cdk-validium-contracts/tree/main) which has slightly adjusted behavior to take account of validium components and CDK custom requirements.
34
71
35
72
The CDK repo is a fork of the zkEVM main contracts repo and all contracts, therefore, extend from common interfaces.
0 commit comments