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

perf(l2): add prover benchmarks from RPC downloaded blocks #1705

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

Conversation

xqft
Copy link
Contributor

@xqft xqft commented Jan 13, 2025

Motivation

We want to benchmark the L2 prover against rsp, using Ethereum mainnet/testnet blocks. For this we need to fetch state from an Ethereum chain.

Description

  • adds l2/prover/bench crate
  • adds basic state fetching functions from the JSON-RPC API

Copy link

github-actions bot commented Jan 13, 2025

| File                                                                              | Lines | Diff |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/runner/levm_runner.rs           | 390   | -2   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ethrex/ethrex.rs                              | 352   | -2   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/blockchain/fork_choice.rs                  | 188   | +9   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/blockchain/payload.rs                      | 480   | -35  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/common/types/fork_id.rs                    | 110   | -303 |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/common/types/genesis.rs                    | 355   | -6   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/proposer/prover_server.rs               | 459   | +9   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/bench/src/constants.rs           | 30    | +30  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/bench/src/lib.rs                 | 2     | +2   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/bench/src/main.rs                | 47    | +47  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/bench/src/rpc/asynch.rs          | 189   | +189 |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/bench/src/rpc/blocking.rs        | 164   | +164 |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/bench/src/rpc/db.rs              | 126   | +126 |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/bench/src/rpc/mod.rs             | 32    | +32  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/zkvm/interface/risc0/src/main.rs | 44    | +3   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/zkvm/interface/sp1/src/main.rs   | 45    | +3   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/prover/zkvm/interface/src/lib.rs        | 164   | +44  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/l2/utils/test_data_io.rs                   | 92    | +6   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/discv4.rs                   | 905   | -11  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/kademlia.rs                 | 472   | -15  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/net.rs                      | 892   | -246 |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/rlpx/connection.rs          | 534   | -17  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/rlpx/eth/backend.rs         | 99    | -9   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/rlpx/frame.rs               | 205   | +1   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync.rs                     | 601   | -6   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/types.rs                    | 147   | -82  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/engine/fork_choice.rs       | 278   | -4   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/client.rs               | 27    | -1   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/api.rs               | 159   | -2   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/in_memory.rs         | 373   | -8   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/libmdbx.rs           | 722   | -9   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/redb.rs              | 670   | -13  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/utils.rs             | 32    | -2   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/storage.rs                   | 1152  | -8   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/db.rs                                   | 243   | +146 |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/errors.rs                               | 119   | +4   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/execution_db.rs                         | 129   | -55  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/constants.rs                   | 35    | -14  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/db/mod.rs                      | 58    | -4   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/errors.rs                      | 245   | -2   |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/opcode_handlers/environment.rs | 329   | -11  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/opcode_handlers/system.rs      | 582   | -37  |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/vm.rs                          | 1040  | -235 |
+-----------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/vm.rs                                   | 818   | -1   |
+-----------------------------------------------------------------------------------+-------+------+

Total lines added: +815
Total lines removed: 1140
Total lines changed: 1955

@xqft xqft changed the base branch from main to l2/touched_state January 15, 2025 20:46
github-merge-queue bot pushed a commit that referenced this pull request Jan 24, 2025
…based approach (#1709)

**Motivation**

A `ExecutionDB` is created from a block's pre-execution but the current
implementation is incorrect and not all needed data gets stored. The
goal is to replace this with another approach, using an auxiliary
"caching" database that will retrieve data from a `Store` or an RPC
endpoint (like in #1705) during the pre-execution of a block, finally
resulting in a db that contains all the needed execution data.

**Description**

- replace `ExecutionDB::from_exec()` to use the `CacheDB`, rename it to
`from_store()`
- some refactors
Base automatically changed from l2/touched_state to main January 24, 2025 14:39
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.

1 participant