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 15 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
71 changes: 71 additions & 0 deletions docs/cdk/architecture/high-level-views.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## 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 transaction pool manager proxies manages the transactions coming in from the RPC node and streams the data onto the sequence sender.
vcastellm marked this conversation as resolved.
Show resolved Hide resolved
- The sequencer sequences transactions batches and puts them into the data streamer.
- The data streamer streams data to the sequencer sender and the aggregator.
- The sequencer sender sequences batches into the L1 smart contract domain and persists data into DAC nodes for validium mode operations.
- The aggregator sends batches to the prover and receives proofs in return. It then aggregates the proofs into batches before submitting them 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.
kmurphypolygon marked this conversation as resolved.
Show resolved Hide resolved
- The AggLayer also utilizes the bridge service and interacts with the L1 smart contracts.
Copy link
Collaborator

@vcastellm vcastellm Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AggLayer doesn't interact with the bridge, it only receives proofs from the cdk-node and forwards them to L1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYM? the bridge is not related to the agglayer directly


### 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 Erigon RPC node proxies the data to the CDK Erigon sequencer node.
3. The sequencer sequences the transaction batches.
4. The sequencer puts the batches into the data streamer component.
5. The data streamer component streams the data into the sequence sender. It streams data into the aggregator and AggLayer for rollup and validium mode stacks.
6. In validium mode, the sequencer sender persists transaction data into the DAC nodes.
7. In both modes, the sequencer sender sequences the batches into the L1 smart contracts.
8. In both modes, the aggregator sends the batches to the prover and the prover returns the proofs.
9. The aggregator batches the proofs.
vcastellm marked this conversation as resolved.
Show resolved Hide resolved
10. The aggregator submits the final proof to the AggLayer.
11. 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 DataStreamer as Data Streamer
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 transaction data
Sequencer->>Sequencer: Sequence transaction batches
Sequencer->>DataStreamer: Put batches into Data Streamer
DataStreamer->>SeqSender: Stream data into Sequence Sender
DataStreamer->>Aggregator: Stream data for Rollup & Validium mode
DataStreamer->>AggLayer: Stream data for Rollup & Validium mode
alt Validium Mode
SeqSender->>DACNodes: Persist transaction data
end
SeqSender->>L1: Sequence batches into L1 Smart Contracts (both modes)
Aggregator->>Prover: Send batches to Prover (both modes)
Prover->>Aggregator: Return proofs (both modes)
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