Skip to content

Commit

Permalink
add bench crate
Browse files Browse the repository at this point in the history
  • Loading branch information
xqft committed Jan 20, 2025
1 parent d9aee43 commit c756be3
Show file tree
Hide file tree
Showing 7 changed files with 580 additions and 1 deletion.
104 changes: 103 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ members = [
"crates/vm/levm/bench/revm_comparison",
"crates/l2/",
"crates/l2/prover",
"crates/l2/prover/bench",
"crates/l2/contracts",
"crates/l2/sdk",
"cmd/loc",
Expand Down
38 changes: 38 additions & 0 deletions crates/l2/prover/bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[package]
name = "bench"
version = "0.1.0"
edition = "2021"

[dependencies]
ethrex-core.workspace = true
ethrex-rlp.workspace = true
ethrex-vm.workspace = true
ethrex-prover.workspace = true
ethrex-l2.workspace = true

zkvm_interface = { path = "../zkvm/interface", default-features = false }

serde.workspace = true
hex.workspace = true
serde_json.workspace = true
bytes.workspace = true

tokio = { version = "1.21", default-features = false, features = ["full"] }
reqwest = { version = "0.12.9", features = ["json"] }
clap = { version = "4.5.21", features = ["derive"] }

revm = { version = "14.0.3", features = [
"serde",
"std",
"serde-json",
"optional_no_base_fee",
"optional_block_gas_limit",
], default-features = false }

# These dependencies must be kept up to date with the corresponding revm version, otherwise errors may pop up because of trait implementation mismatches
revm-inspectors = { version = "0.8.1" }
revm-primitives = { version = "10.0.0", features = [
"std",
], default-features = false }
futures-util = "0.3.31"
tokio-utils = "0.1.2"
37 changes: 37 additions & 0 deletions crates/l2/prover/bench/src/constants.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Blockchain related constants

use ethrex_core::types::ChainConfig;
use revm_primitives::SpecId;

// Chain config for different forks as defined on https://ethereum.github.io/execution-spec-tests/v3.0.0/consuming_tests/common_types/#fork
pub static CANCUN_CONFIG: ChainConfig = ChainConfig {
chain_id: 1_u64,
homestead_block: Some(0),
dao_fork_block: Some(0),
dao_fork_support: true,
eip150_block: Some(0),
eip155_block: Some(0),
eip158_block: Some(0),
byzantium_block: Some(0),
constantinople_block: Some(0),
petersburg_block: Some(0),
istanbul_block: Some(0),
muir_glacier_block: Some(0),
berlin_block: Some(0),
london_block: Some(0),
arrow_glacier_block: Some(0),
gray_glacier_block: Some(0),
merge_netsplit_block: Some(0),
terminal_total_difficulty: Some(0),
shanghai_time: Some(0),
cancun_time: Some(0),
prague_time: None,
terminal_total_difficulty_passed: false,
verkle_time: None,
};
pub const MAINNET_CHAIN_ID: u64 = 0x1;
pub const MAINNET_SPEC_ID: SpecId = SpecId::CANCUN;

// RPC related constants

pub const RPC_RATE_LIMIT: usize = 100; // requests per second
2 changes: 2 additions & 0 deletions crates/l2/prover/bench/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod constants;
pub mod rpc;
Loading

0 comments on commit c756be3

Please sign in to comment.