Skip to content

Commit eb514ad

Browse files
committed
add bench crate
1 parent 95154c0 commit eb514ad

File tree

7 files changed

+580
-1
lines changed

7 files changed

+580
-1
lines changed

Cargo.lock

Lines changed: 103 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ members = [
1818
"crates/vm/levm/bench/revm_comparison",
1919
"crates/l2/",
2020
"crates/l2/prover",
21+
"crates/l2/prover/bench",
2122
"crates/l2/contracts",
2223
"crates/l2/sdk",
2324
"cmd/loc",

crates/l2/prover/bench/Cargo.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[package]
2+
name = "bench"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
ethrex-core.workspace = true
8+
ethrex-rlp.workspace = true
9+
ethrex-vm.workspace = true
10+
ethrex-prover.workspace = true
11+
ethrex-l2.workspace = true
12+
13+
zkvm_interface = { path = "../zkvm/interface", default-features = false }
14+
15+
serde.workspace = true
16+
hex.workspace = true
17+
serde_json.workspace = true
18+
bytes.workspace = true
19+
20+
tokio = { version = "1.21", default-features = false, features = ["full"] }
21+
reqwest = { version = "0.12.9", features = ["json"] }
22+
clap = { version = "4.5.21", features = ["derive"] }
23+
24+
revm = { version = "14.0.3", features = [
25+
"serde",
26+
"std",
27+
"serde-json",
28+
"optional_no_base_fee",
29+
"optional_block_gas_limit",
30+
], default-features = false }
31+
32+
# These dependencies must be kept up to date with the corresponding revm version, otherwise errors may pop up because of trait implementation mismatches
33+
revm-inspectors = { version = "0.8.1" }
34+
revm-primitives = { version = "10.0.0", features = [
35+
"std",
36+
], default-features = false }
37+
futures-util = "0.3.31"
38+
tokio-utils = "0.1.2"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Blockchain related constants
2+
3+
use ethrex_core::types::ChainConfig;
4+
use revm_primitives::SpecId;
5+
6+
// Chain config for different forks as defined on https://ethereum.github.io/execution-spec-tests/v3.0.0/consuming_tests/common_types/#fork
7+
pub static CANCUN_CONFIG: ChainConfig = ChainConfig {
8+
chain_id: 1_u64,
9+
homestead_block: Some(0),
10+
dao_fork_block: Some(0),
11+
dao_fork_support: true,
12+
eip150_block: Some(0),
13+
eip155_block: Some(0),
14+
eip158_block: Some(0),
15+
byzantium_block: Some(0),
16+
constantinople_block: Some(0),
17+
petersburg_block: Some(0),
18+
istanbul_block: Some(0),
19+
muir_glacier_block: Some(0),
20+
berlin_block: Some(0),
21+
london_block: Some(0),
22+
arrow_glacier_block: Some(0),
23+
gray_glacier_block: Some(0),
24+
merge_netsplit_block: Some(0),
25+
terminal_total_difficulty: Some(0),
26+
shanghai_time: Some(0),
27+
cancun_time: Some(0),
28+
prague_time: None,
29+
terminal_total_difficulty_passed: false,
30+
verkle_time: None,
31+
};
32+
pub const MAINNET_CHAIN_ID: u64 = 0x1;
33+
pub const MAINNET_SPEC_ID: SpecId = SpecId::CANCUN;
34+
35+
// RPC related constants
36+
37+
pub const RPC_RATE_LIMIT: usize = 100; // requests per second

crates/l2/prover/bench/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod constants;
2+
pub mod rpc;

0 commit comments

Comments
 (0)