Skip to content

fix(l2): bench crate #2647

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

Merged
merged 6 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions crates/l2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ ethereum-types.workspace = true
ethrex-common.workspace = true
ethrex-rlp.workspace = true
ethrex-rpc.workspace = true
ethrex-blockchain = { workspace = true, features = ["l2"] }
ethrex-blockchain.workspace = true
ethrex-storage.workspace = true
ethrex-trie.workspace = true
ethrex-vm = { workspace = true, features = ["l2"] }
ethrex-vm.workspace = true
ethrex-levm.workspace = true
ethrex-dev = { path = "../../crates/blockchain/dev", default-features = false }
ethrex-metrics = { path = "../blockchain/metrics", default-features = false }
Expand All @@ -36,7 +36,7 @@ directories = "5.0.1"
toml = { version = "0.8.19", features = ["parse"] }
bincode = "1.3.3"

zkvm_interface = { path = "./prover/zkvm/interface/", features = ["l2"] }
zkvm_interface = { path = "./prover/zkvm/interface/" }

[dev-dependencies]
rand = "0.8.5"
Expand All @@ -53,5 +53,6 @@ unnecessary_cast = "warn"
panic = "deny"

[features]
default = []
default = ["l2"]
metrics = ["ethrex-metrics/l2"]
l2 = ["ethrex-blockchain/l2", "ethrex-vm/l2", "zkvm_interface/l2"]
3 changes: 2 additions & 1 deletion crates/l2/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ethrex-rlp.workspace = true
ethrex-blockchain.workspace = true

# l2
ethrex-l2.workspace = true
ethrex-l2 = { path = "../", default-features = false }
ethrex-sdk.workspace = true

zkvm_interface = { path = "./zkvm/interface", default-features = false }
Expand Down Expand Up @@ -60,6 +60,7 @@ l2 = [
"ethrex-vm/l2",
"zkvm_interface/l2",
"ethrex-blockchain/l2",
"ethrex-l2/l2",
] # the prover can work with either l1 or l2 blocks

[lints.clippy]
Expand Down
1 change: 0 additions & 1 deletion crates/l2/prover/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ethrex-vm.workspace = true
ethrex-storage.workspace = true
ethrex-rlp.workspace = true
ethrex-prover.workspace = true
ethrex-l2.workspace = true
ethrex-trie.workspace = true
ethrex-levm.workspace = true

Expand Down
1 change: 0 additions & 1 deletion crates/l2/prover/bench/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{fs::File, io::Write};

use clap::Parser;
use ethrex_l2::utils::prover::proving_systems::ProverType;
use ethrex_prover_bench::{
cache::{load_cache, write_cache, Cache},
rpc::{db::RpcDB, get_block, get_latest_block_number},
Expand Down
8 changes: 5 additions & 3 deletions crates/l2/prover/bench/src/rpc/db.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::cell::RefCell;
use std::collections::HashMap;

use crate::constants::{CANCUN_CONFIG, RPC_RATE_LIMIT};
Expand All @@ -9,8 +8,8 @@ use ethrex_common::{
types::{AccountInfo, AccountState, Block, Fork, TxKind},
Address, H256, U256,
};
use ethrex_levm::db::gen_db::GeneralizedDatabase;
use ethrex_levm::db::Database as LevmDatabase;
use ethrex_levm::vm::GeneralizedDatabase;
use ethrex_storage::{hash_address, hash_key};
use ethrex_trie::{Node, PathRLP, Trie};
use ethrex_vm::backends::levm::{CacheDB, LEVM};
Expand Down Expand Up @@ -541,7 +540,10 @@ fn get_potential_child_nodes(proof: &[NodeRLP], key: &PathRLP) -> Option<Vec<Nod
let mut variants = Vec::with_capacity(node.partial.len());
while {
variants.push(Node::from(node.clone()));
node.partial.next().is_some()
node.partial.next();
!node.partial.is_empty() // skip the last nibble, which is the leaf flag.
// if we encode a leaf with its flag missing, it’s going to be encoded as an
// extension.
} {}
Some(variants)
}
Expand Down
Loading