diff --git a/docs/cdk/architecture/high-level-views.md b/docs/cdk/architecture/high-level-views.md new file mode 100644 index 00000000..22ae747b --- /dev/null +++ b/docs/cdk/architecture/high-level-views.md @@ -0,0 +1,64 @@ +## CDK full execution proof (FEP) + +The diagram below depicts a simplified architectural layout of the CDK FEP stack and indicates at a high level how components communicate. + +![High level view of CDK stack](../../img/cdk/cdk-stack.svg) + +### Component interactions + +- The CLI tool is the starting point. Developers, or chain administrators in particular, can use the CLI tool to build and configure chains in various modes of operation, such as validiums and rollups. +- Once a chain is configured with the CLI, users can submit transactions through the CDK Erigon RPC node. These transactions are relayed to the `tx-pool manager` before the sequencer selects and executes them. +- The sequencer sequences transactions batches and synchronizes data with the RPC node. +- The sequencer sender reads batch data from the RPC node. +- The aggregator reads batch data from the sequencer data stream. +- The sequencer sender persists data into the L1 smart contract domain for rollup mode and into DAC nodes for validium mode operations. +- The aggregator sends batches to the prover and receives proofs in return. Together with the prover, it aggregates the proofs into batches before submitting the final proofs to the AggLayer or L1, depending on the chosen settlement layer. +- Users interact with the bridge service via the bridge UI or API. +- The AggLayer verifies proofs and interacts with the L1 smart contracts. + +### User data flow + +The following diagram is a sequential depiction of the user data flow for the CDK FEP stack in validium mode using a mock prover and having an AggLayer connection. + +![High level view of CDK user data flow](../../img/cdk/cdk-user-data-flow.svg) + +#### Sequential interactions + +1. User sends a transaction to the CDK Erigon RPC node. +2. The CDK Erigon RPC node proxies the data to the CDK Erigon sequencer node and syncs the batch data between the sequencer and the RPC nodes. +3. The sequencer sequences the transaction batches. +4. The sequencer sender reads batches from the RPC node. +5. In validium mode only, the sequencer sender persists transaction data into the DAC nodes. +6. The sequencer sender sequences the batches into the L1 smart contracts. +7. The aggregator reads batches from the sequencer data stream. +8. The aggregator sends batches to the provers. +9. The aggregator submits the final proof to the AggLayer. +10. The AggLayer submits the final proof to the L1 smart contract domain. + +```mermaid +sequenceDiagram + participant User + participant ErigonRPC as CDK Erigon RPC Node + participant Sequencer as CDK Erigon Sequencer Node + participant SeqSender as Sequence Sender + participant Aggregator + participant AggLayer + participant DACNodes as DAC Nodes + participant Prover + participant L1 as L1 Smart Contracts + + User->>ErigonRPC: Send transaction + ErigonRPC->>Sequencer: Proxy and sync transaction data + Sequencer->>Sequencer: Sequence transaction batches + SeqSender->>ErigonRPC: Reads batches + SeqSender->>DACNodes: Persist transaction data (validium mode only) + SeqSender->>L1: Sequence batches into L1 Smart Contracts + Aggregator->>Prover: Send batches to Prover + Prover->>Aggregator: Return proofs + Aggregator->>Aggregator: Aggregate the proofs + Aggregator->>AggLayer: Submit final proof + AggLayer->>L1: Submit final proof to L1 Smart Contract Domain +``` + +!!! tip + Detailed AggLayer flows will be published soon. diff --git a/docs/img/cdk/cdk-stack.svg b/docs/img/cdk/cdk-stack.svg new file mode 100644 index 00000000..fcc67564 --- /dev/null +++ b/docs/img/cdk/cdk-stack.svg @@ -0,0 +1,37 @@ + + + + + + + + CDK full execution proof (FEP) component stack:Usersends transactionreads batches from sequencer data streamsends batches for proving / receives proofsin returnsubmits final proofproxies data tocli:Devcallstx-pool-managersequence-senderaggregatorproverDAC nodespersists data for validium modeBridge serviceBridge UI:Userviews bridge txreads batches L1ZKEVM contracts AggLayerAggLayer componentssettles proofscdk-erigonRPCSequencersyncing datareads DAC data for validium modepersists data for rollup modereads data from L1 for rollup modecdk-node \ No newline at end of file diff --git a/docs/img/cdk/cdk-user-data-flow.svg b/docs/img/cdk/cdk-user-data-flow.svg new file mode 100644 index 00000000..5ef9fb39 --- /dev/null +++ b/docs/img/cdk/cdk-user-data-flow.svg @@ -0,0 +1,37 @@ + + + + + + + + CDK components:User1. sends tx3. sequences batchessequence-senderaggregator L1L1 contracts6. sequences batches8. sends batches to be provenDAC node7. reads batches from sequencer data stream5. persists tx data for validium mode only9. submits final proof10. AggLayer submits final proof to L1cdk-erigon(trusted sequencer)2. proxies/syncs datacdk-erigon(RPC node)AggLayer RPC4. reads batchesproverAggLayer \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 82b27e76..32556b8f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -78,6 +78,7 @@ nav: - Quickly test a running stack: cdk/how-to/quick-test-stack.md - Connect to CDK testnets: cdk/how-to/connect-testnet.md - Architecture: + - High level views: cdk/architecture/high-level-views.md - CDK rollup: cdk/architecture/cdk-zkevm.md - CDK validium: cdk/architecture/cdk-validium.md - Unified bridge - STB: cdk/architecture/staking-the-bridge.md