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

CDK PP Docs Review Env: DO NOT MERGE!!! #2459

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

EmpieichO
Copy link
Contributor

@EmpieichO EmpieichO commented Oct 23, 2024

Hosted url: docs-dev.polygon.technology/2459
CDK PP docs review env: DO NOT MERGE!!!

PR number Doc to review URL in Review Env Sidebar label
2460 docs/cdk/releases/pp-intro-components.md https://docs-dev.polygon.technology/2459/cdk/releases/pp-intro.components/ Pessimistic proofs (PP)
2461 docs/cdk/getting-started/cdk-erigon/resources.md https://docs-dev.polygon.technology/2459/cdk/getting-started/cdk-erigon/resources/ CDK Erigon/ Resources
2462 docs/cdk/architecture/cdk-pp-highlevel-arch.md https://docs-dev.polygon.technology/2459/cdk/architecture/cdk-pp-highlevel-arch/ CDK PP high level view
2463 docs/cdk/getting-started/cli-tool.md https://docs-dev.polygon.technology/2459/cdk/getting-started/cli-tool/ CLI tool

@EmpieichO EmpieichO changed the title CDK PP docs review env: DO NOT MERGE!!! CDK PP Docs Review Env: DO NOT MERGE!!! Oct 23, 2024
Adding new doc: `pp-intro.components.md`
Adding "Pessimistic proofs" to nav
@EmpieichO
Copy link
Contributor Author

Hi @sshrihar

I have created a Dev Env here https://docs-dev.polygon.technology/2459

Can you tell me why clicking on the /cdk/Pessismistic proofs/ throws a 404 ?

Fixing filename ref in nav pp-intro-components.md --> pp-intro.components.md
Remove DAC component
fixing indentation
Update resources.md in the cdk-erigon docs
Add CDK PP high level architecture doc
Update CLI Tool doc
Copy link

sonarcloud bot commented Oct 25, 2024

@sshrihar
Copy link
Collaborator

Hi @sshrihar

I have created a Dev Env here https://docs-dev.polygon.technology/2459

Can you tell me why clicking on the /cdk/Pessismistic proofs/ throws a 404 ?

I tried accessing the url and it redirected me to https://docs-dev.polygon.technology/2459/cdk/releases/pp-intro.components/

@vcastellm vcastellm marked this pull request as draft October 30, 2024 17:39
1. A user connects to the chain via a CDK Erigon RPC node and submits a transaction.
2. CDK Erigon RPC node sends the transaction data to the transaction-pool manager.
3. The transaction-pool manager proxies all transaction data to the CDK Erigon sequencer.
4. CDK Erigon sequencer executes transactions, puts the transactions in blocks, and the blocks fill up batches.

Choose a reason for hiding this comment

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

Suggested change
4. CDK Erigon sequencer executes transactions, puts the transactions in blocks, and the blocks fill up batches.
4. CDK Erigon sequencer executes transactions, puts the transactions in blocks

batches are irrelevant for PP chains... I'm not even sure if the cdk-erigon version we're using for PP deals with batches at all

2. CDK Erigon RPC node sends the transaction data to the transaction-pool manager.
3. The transaction-pool manager proxies all transaction data to the CDK Erigon sequencer.
4. CDK Erigon sequencer executes transactions, puts the transactions in blocks, and the blocks fill up batches.
5. CDK Erigon sequencer syncs all transaction data with any CDK Erigon RPC node.

Choose a reason for hiding this comment

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

It's the opposite, any node syncs from sequencer. Otherwise I'd change syncs for shares with or something similar

@@ -0,0 +1,62 @@
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.

![Figure: CDK PP Architecture](../../img/cdk/cdk-pp-architecture-001.png)

Choose a reason for hiding this comment

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

rename JSON-RPC API for AggLayer RPC json RPC is known to be the api of the execution clients such as erigon...

3. The transaction-pool manager proxies all transaction data to the CDK Erigon sequencer.
4. CDK Erigon sequencer executes transactions, puts the transactions in blocks, and the blocks fill up batches.
5. CDK Erigon sequencer syncs all transaction data with any CDK Erigon RPC node.
6. AggSender gets batch data from the CDK Erigon sequencer, uses the data to generate certificates, and submits the certificates to the JSON-RPC API.

Choose a reason for hiding this comment

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

Suggested change
6. AggSender gets batch data from the CDK Erigon sequencer, uses the data to generate certificates, and submits the certificates to the JSON-RPC API.
6. AggSender gets batch data from the CDK Erigon sequencer, uses the data to generate certificates, and submits the certificates to the AggLayer RPC.

4. CDK Erigon sequencer executes transactions, puts the transactions in blocks, and the blocks fill up batches.
5. CDK Erigon sequencer syncs all transaction data with any CDK Erigon RPC node.
6. AggSender gets batch data from the CDK Erigon sequencer, uses the data to generate certificates, and submits the certificates to the JSON-RPC API.
7. The JSON-RPC API checks validity of the certificates against the transaction data in the CDK Erigon RPC node.

Choose a reason for hiding this comment

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

Suggested change
7. The JSON-RPC API checks validity of the certificates against the transaction data in the CDK Erigon RPC node.
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

Not sure how to write this, but:

  • There is no interaction with erigon, that's for sure (also, remove this interaction from diagram)
  • What really happens:
    • the certificate include bridges to other networks, and the agglayer checks that the amount being bridged out of the network is not greater than the amount that the network has received
    • the certificate include bridges to this network (deposits/claims), the agglayer checks that this claims are valid (verifies that the merkle proofs are correct, and are done towards a valid GER)

| Node = RPC and sequencer | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | Customizable, commonly:<br/>\- Sequencer = 1 node<br/>\- RPC = multiple nodes |
| Contracts | <a href=https://github.com/0xPolygonHermez/zkevm-contracts>zkevm-contracts</a> | |
| CLI | [cdk](https://github.com/0xPolygon/cdk) | Included in [CDK](https://github.com/0xPolygon/cdk) repo |
| AggSender | <a href=https://github.com/0xPolygon/cdk>cdk</a> | Included in [CDK](https://github.com/0xPolygon/cdk) repo |

Choose a reason for hiding this comment

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

The AggSender is just a sub-component of the cdk client. I think that we should be talking about cdk client or cdk node more in the doc... Although it's ok to specify that the AggSender is the specific sub-component that sends the certs to the AL. But note that the AggSender works in conjunction with other sub-components of the cdk such as the bridge syncer and others...

- AggSender is the CDK PP component that accumulates all necessary info in order to generate certificates, which are sent to the SP1 prover via the JSON-RPC API for the generation of pessimistic proofs.
- Transaction pool manager: For storing transactions submitted by users.

### AggLayer-side components

Choose a reason for hiding this comment

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

It feels a bit odd to have a sub section for AL, and not for CDK

- `PolygonZkEVMDeployer`
- `PolygonZkEVMTimelock`
- CLI tool: A single command line interface tool for abstracting away the complexity of deploying or configuring CDK components.
- AggSender is the CDK PP component that accumulates all necessary info in order to generate certificates, which are sent to the SP1 prover via the JSON-RPC API for the generation of pessimistic proofs.

Choose a reason for hiding this comment

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

I don't like the idea of CDK PP. No, there is the cdk. And the cdk happens to be used to give PP functionality, but there is no CDK PP... Again, once we've FEP+PP the same cdk will be used, and in this case we will have the aggsender as well as other components


We henceforth refer to CDK sovereign chains as CDK PP chains.

## CDK PP stack

Choose a reason for hiding this comment

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

Overall, there is a weird level of detail... We list the CLI, but not the syncers? Most importantly, the aggSender looks like a standalone piece of software, when it's clearly just a functionality of the cdk client. I've been talking with some non Polygon folks and they're super confused with what's the CDK / AggLayer. We need to be very careful on how we articulate this things...


Unlike in the CDK FEP chain, the prover in a CDK PP chain is not directly connected to the chain. It in fact resides in the AggLayer.

- JSON-RPC API: A component provided by the AggLayer to interface between the CDK PP chain and the SP1 prover.

Choose a reason for hiding this comment

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

Wouldnt it be better to talk about AggLayer node similar to the aggsender, the RPC is just a part of the AL node... but for sure avoid JSON-RPC it's extremely confusing, people will think about the API of the Ethereum execution clients when they see this, and it has nothing to do with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants