|
1 | | -The figure below depicts a simplified, high level view of the CDK PP chain architecture, as well as the flow of transactions through the system. |
| 1 | +# CDK Chain (PP) High-Level Architecture |
2 | 2 |
|
3 | | - |
| 3 | +The figure below depicts a simplified, high-level view of the CDK chain architecture using pessimistic proofs and the flow of transactions through the system. |
4 | 4 |
|
5 | | -## Transaction flow |
| 5 | + |
6 | 6 |
|
7 | | -Here is a step by step flow of transactions starting from when users submit transactions up to when the transactions are settled in L1. |
| 7 | +## Transaction Flow |
| 8 | + |
| 9 | +Here is a step-by-step flow of transactions starting from when users submit transactions up to when the transactions are settled in L1: |
8 | 10 |
|
9 | 11 | 1. A user connects to the chain via a CDK Erigon RPC node and submits a transaction. |
10 | 12 | 2. CDK Erigon RPC node sends the transaction data to the transaction-pool manager. |
11 | 13 | 3. The transaction-pool manager proxies all transaction data to the CDK Erigon sequencer. |
12 | | -4. CDK Erigon sequencer executes transactions, puts the transactions in blocks |
13 | | -5. CDK Erigon sequencer syncs all transaction data with any CDK Erigon RPC node. |
| 14 | +4. CDK Erigon sequencer executes transactions, puts the transactions in blocks, and the blocks fill up batches. |
| 15 | +5. Any CDK Erigon RPC node syncs transaction data from the CDK Erigon sequencer. |
14 | 16 | 6. AggSender gets batch data from the CDK Erigon sequencer, uses the data to generate certificates, and submits the certificates to the AggLayer RPC. |
15 | | -7. The AggLayer RPC checks validity of the certificate by asserting that the balances of the bridge interactions are consistent with the liquidity of the chain |
16 | | -8. After validating the certificates, the AggLayer RPC sends a request to generate a proof, together with the necessary data (including the certificates), to the SP1 prover. |
17 | | -9. Once the proof is received from the SP1 prover, the AggLayer RPC sends it to L1. |
18 | | - |
19 | | - |
20 | | - |
21 | | -## Sequential diagram |
22 | | - |
23 | | -The flow of data is depicted in the squential diagram below. |
24 | | - |
25 | | -1. User submits a tx to the CDK Erigon RPC node. |
26 | | -2. The CDK Erigon RPC node sends tx data to the tx-pool man. |
27 | | -3. The tx-pool man proxies tx data to the CDK Erigon sequencer. |
28 | | -4. CDK Erigon sequencer executes transactions. |
29 | | -5. CDK Erigon sequencer syncs tx data with another CDK Erigon RPC node. |
30 | | -6. AggSender gets batch data from the CDK Erigon sequencer. |
31 | | -7. AggSender submits certificates to the JSON-RPC API. |
32 | | -8. JSON-RPC API checks validity of the certificates. |
33 | | -9. JSON-RPC API requests a proof from SP1 prover. |
34 | | -10. SP1 prover sends back a proof. |
35 | | -11. JSON-RPC API sends proof to L1. |
36 | | - |
37 | | - |
38 | | - |
39 | | -```mermaid |
40 | | -sequenceDiagram |
41 | | - participant User |
42 | | - participant ErigonRPC1 as RPC node 1 |
43 | | - participant tx-pool-man as tx-pool manager |
44 | | - participant Sequencer as Sequencer node |
45 | | - participant ErigonRPC2 as RPC node 2 |
46 | | - participant AggSender as AggSender |
47 | | - participant API as JSON-RPC API |
48 | | - participant SP1-prover as SP1 prover |
49 | | - participant L1 as L1 |
50 | | -
|
51 | | - User->>ErigonRPC1: submits tx |
52 | | - ErigonRPC1->>tx-pool-man: sends tx data |
53 | | - tx-pool-man->>Sequencer: proxies tx data |
54 | | - Sequencer->>Sequencer: sequences transactions |
55 | | - Sequencer->>ErigonRPC2: syncs data |
56 | | - AggSender->>Sequencer: reads batch data |
57 | | - AggSender->>API: sends certificates |
58 | | - API->>ErigonRPC2: checks validity |
59 | | - API->>SP1-prover: requests proof |
60 | | - SP1-prover->>API: returns proof |
61 | | - API->>L1: submits proof |
62 | | -``` |
| 17 | +7. The AggLayer RPC checks the validity of the certificates against the transaction data in the CDK Erigon RPC node. |
| 18 | +8. After validating the certificates, the AggLayer RPC sends a request to generate a proof, together with the necessary data (including the certificates), to the SP1 prover. |
| 19 | +9. Once the proof is received from the SP1 prover, the AggLayer RPC sends it to L1. |
0 commit comments