-
Notifications
You must be signed in to change notification settings - Fork 118
chore(l2): update prover docs #5105
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive documentation for the ethrex prover system, reorganizing and expanding the existing L2 prover documentation. The changes focus on explaining how zero-knowledge proofs are generated for block execution using stateless execution and execution witnesses.
- Adds new standalone prover documentation explaining stateless execution, execution witnesses, and zkVM integration
- Reorganizes L2 architecture documentation by extracting detailed prover internals into dedicated files
- Adds documentation for data availability, execution witnesses, and developer setup instructions
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/prover/prover.md | New comprehensive guide explaining prover architecture, stateless execution, and L2-specific checks |
| docs/prover/guest_program.md | New detailed documentation of the guest program execution steps and public inputs/outputs |
| docs/l2/fundamentals/execution_witness.md | New explanation of execution witness creation, MPT proofs, and trie restructuring edge cases |
| docs/l2/fundamentals/data_availability.md | New documentation on state diffs, blob data, and KZG commitments for data availability |
| docs/l2/architecture/prover.md | Simplified to high-level overview with references to detailed prover documentation |
| docs/l2/architecture/overview.md | Streamlined by removing detailed prover explanations now in dedicated files |
| docs/developers/l2/prover.md | New developer guide with setup instructions, GPU configuration, and environment variables |
| docs/SUMMARY.md | Updated with new documentation entries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Updated validation steps to clarify state trie root comparison and merkle proof verification.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
| ETHREX_L2_SP1=true | ||
| # Check the if the verification contract is present on your preferred network. Don't define this if you want it to be deployed automatically. | ||
| ETHREX_DEPLOYER_SP1_VERIFIER_ADDRESS=<address> | ||
| # Set to true if you want proofs to be required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Set to true if you want proofs to be required | |
| # Set to true if you want RISC0 proofs to be required |
| - `make rm-db-l2 && make down` | ||
| - `make deploy-l1 && make init-l2` (if running a risc0 prover, see the next step before invoking the L1 contract deployer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `make rm-db-l2 && make down` | |
| - `make deploy-l1 && make init-l2` (if running a risc0 prover, see the next step before invoking the L1 contract deployer) | |
| - `make rm-db-l2 down` | |
| - `make deploy-l1 init-l2` (if running a risc0 prover, see the next step before invoking the L1 contract deployer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the make down will shut down a local L1. We could use the down-l2 or mention to start the L1 again init-l1-docker
| - `make rm-db-l2 && make down` | ||
| - `make deploy-l1 && make init-l2` (if running a risc0 prover, see the next step before invoking the L1 contract deployer) | ||
|
|
||
| - If running with a local L1 (for development), you will need to manually deploy the risc0 contracts by following the instructions [here](https://github.com/risc0/risc0-ethereum/tree/main/contracts/script). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could mention how to deploy the sp1 verifier contract with the deployer
|
We should add more details on the prover's inputs/outputs, what it commits as public values and what remains private, and which computation it does with each value, as this is one of the most critical aspects of the prover (thank you @MauroToscano for the feedback!) |
|
|
||
| ### L1 block proving | ||
|
|
||
| ethrex-prover is able to generate execution proofs of Ethereum Mainnet/Testnet blocks. An example binary was created for this purpose in `crates/l2/prover/bench`. Refer to its README for usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path crates/l2/prover/bench does not exist
| - Start the L2 locally on port `1729`. | ||
| 4. In a new terminal → `make init-prover-<sp1|risc0|exec> # GPU=true`. | ||
|
|
||
| After this initialization we should have the prover running in `dev_mode` → No real proofs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With sp1 or risc0 real proofs will be created
|
|
||
| ## Dev Mode | ||
|
|
||
| To run the blockchain (`proposer`) and prover in conjunction, start the `Prover`, use the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the sentence is more clear with something like this
| To run the blockchain (`proposer`) and prover in conjunction, start the `Prover`, use the following command: | |
| To run the blockchain (`proposer`) and prover in conjunction by starting the `Prover` with: |
| > Used for development purposes. | ||
| 1. `cd crates/l2` | ||
| 2. `make rm-db-l2 && make down` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want you can use:
| 2. `make rm-db-l2 && make down` | |
| 2. `make rm-db-l2 down` |
| - Add the `user` you are using to the `docker` group → command: `sudo usermod -aG docker $USER`. (needs reboot, doing it after CUDA installation) | ||
| - `id -nG` after reboot to check if the user is in the group. | ||
| 2. Install [Rust](https://www.rust-lang.org/tools/install) | ||
| 3. Install [RISC0](https://dev.risczero.com/api/zkvm/install) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to add sp1?
| - `make rm-db-l2 && make down` | ||
| - `make deploy-l1 && make init-l2` (if running a risc0 prover, see the next step before invoking the L1 contract deployer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the make down will shut down a local L1. We could use the down-l2 or mention to start the L1 again init-l1-docker
| Going a bit further, instead of posting the entire transaction, we could just post which accounts have been modified and their new values (this includes deployed contracts and their bytecode of course). This can reduce the size a lot for most cases; in the case of a regular transfer as above, we only need to record balance updates of two accounts, which requires sending just two `(address, balance)` pairs, so (20 + 32) * 2 = 104 bytes, or around half as before. Some other clever techniques and compression algorithms can push down the publishing cost of this and other transactions much further. | ||
|
|
||
| This is called `state diffs`. Instead of publishing entire transactions for data availability, we only publish whatever state they modified. This is enough for anyone to reconstruct the entire state of the chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't post state diffs anymore, we now just post the list of transactions
Organizes and updates some older docs