Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: CDK: High level architecture #1563

Merged
merged 32 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1dda997
add docs for high level views
kmurphypolygon Oct 1, 2024
25985de
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into…
kmurphypolygon Oct 2, 2024
f148353
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into…
kmurphypolygon Oct 4, 2024
a87a31b
update the doc afta review
kmurphypolygon Oct 4, 2024
1d8817a
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into…
kmurphypolygon Oct 8, 2024
e0e0add
first updates after review
kmurphypolygon Oct 9, 2024
1a6a364
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into…
kmurphypolygon Oct 9, 2024
583480a
updates after review
kmurphypolygon Oct 9, 2024
9dfe7ee
update img and sequence diagram
kmurphypolygon Oct 10, 2024
97cd0d2
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into…
kmurphypolygon Oct 11, 2024
5596b61
update main pic formating
kmurphypolygon Oct 11, 2024
3feacb3
make pic smaller
kmurphypolygon Oct 11, 2024
2090e76
update pic
kmurphypolygon Oct 11, 2024
df1f855
Update docs/cdk/architecture/high-level-views.md
kmurphypolygon Oct 11, 2024
c5b08c5
Merge branch 'cdk/high-level' of https://github.com/0xPolygon/polygon…
kmurphypolygon Oct 11, 2024
6a36ec3
adjust diagram
kmurphypolygon Oct 11, 2024
be978f7
Update docs/cdk/architecture/high-level-views.md
kmurphypolygon Oct 11, 2024
9bed447
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into…
kmurphypolygon Oct 11, 2024
b3b191e
updates to pic after huddle
kmurphypolygon Oct 11, 2024
c82253c
fix conflict
kmurphypolygon Oct 11, 2024
5b06774
update pic and words
kmurphypolygon Oct 11, 2024
025466f
updates to pics and flows
kmurphypolygon Oct 11, 2024
15119c7
correction
kmurphypolygon Oct 11, 2024
6c8ef1a
Merge branch 'main' of https://github.com/0xPolygon/polygon-docs into…
kmurphypolygon Oct 11, 2024
75518e7
update pic
kmurphypolygon Oct 11, 2024
e970275
update pic
kmurphypolygon Oct 11, 2024
92c7ec2
update pic
kmurphypolygon Oct 11, 2024
2f39a0a
update pics to svg
kmurphypolygon Oct 14, 2024
202b0e7
Update docs/cdk/architecture/high-level-views.md
kmurphypolygon Oct 17, 2024
aa58519
Update docs/cdk/architecture/high-level-views.md
kmurphypolygon Oct 17, 2024
739e417
Update docs/cdk/architecture/high-level-views.md
kmurphypolygon Oct 17, 2024
5009e78
Update docs/cdk/architecture/high-level-views.md
kmurphypolygon Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions docs/cdk/architecture/high-level-views.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
## CDK full execution proof (FEP)

The following diagram depicts the CDK FEP stack component layout and details some of the high level communication between components.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved

![High level view of CDK stack](../../img/cdk/cdk-stack.png)

### Component interactions

- Engineers use a CLI to manage the backend components, installing and initializing various modes of operation, such as validium versus rollup for example.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- External applications send transactions to the CDK Erigon RPC node which forwards the transaction data to the sequencer via the transaction pool manager.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- The sequencer sequences transactions batches and synchronizes data with the RPC node.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- The sequencer sender reads batch data from the RPC node.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- The aggregator reads batch data from the sequencer data stream.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- The sequencer sender persists data into the L1 smart contract domain for rollup mode and into DAC nodes for validium mode operations.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- 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.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- Users interact with the bridge service via the bridge UI or API.
- The AggLayer verifies proofs and interacts with the L1 smart contracts.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved

### 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.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved

![High level view of CDK user data flow](../../img/cdk/cdk-user-data-flow.png)

#### 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.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved

```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: Batch 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.
Binary file added docs/img/cdk/cdk-stack.png
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/cdk/cdk-user-data-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down