Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/pr_perf_build_block_bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Benchmark Block building
on:
workflow_dispatch:
#pull_request:
#branches: ["**"]
#branches: ["**"]

permissions:
pull-requests: write
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Benchmarks
uses: boa-dev/criterion-compare-action@v3
with:
cwd: "cmd/ethrex/bench"
cwd: "benches/benches"
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cwd should point to the crate root (where Cargo.toml resides). The benches crate root is benches, not benches/benches. Update to cwd: 'benches' so cargo bench runs correctly.

Suggested change
cwd: "benches/benches"
cwd: "benches"

Copilot uses AI. Check for mistakes.
benchName: "build_block_benchmark"
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 18 additions & 2 deletions 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
@@ -1,5 +1,6 @@
[workspace]
members = [
"benches",
"cmd/ethrex",
"crates/blockchain",
"crates/blockchain/dev",
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ WORKDIR /ethrex
# This layer is fast and will be invalidated on any source change.
FROM chef AS planner

COPY benches ./benches
COPY crates ./crates
COPY tooling ./tooling
COPY metrics ./metrics
Expand All @@ -39,6 +40,7 @@ RUN cargo chef cook --release --recipe-path recipe.json
RUN curl -L -o /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.8.29/solc-static-linux \
&& chmod +x /usr/bin/solc

COPY benches ./benches
COPY crates ./crates
COPY cmd ./cmd
COPY metrics ./metrics
Expand Down
31 changes: 31 additions & 0 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[package]
name = "ethrex-benches"
version.workspace = true
edition.workspace = true
authors.workspace = true
documentation.workspace = true

[dependencies]
ethrex.workspace = true
ethrex-blockchain.workspace = true
ethrex-common.workspace = true
ethrex-config.workspace = true
ethrex-storage.workspace = true

bytes.workspace = true
tokio.workspace = true
serde_json.workspace = true

[dev-dependencies]
criterion = { version = "0.5.1", features = [
"html_reports",
"async_futures",
"async_tokio",
] }
secp256k1.workspace = true
tempfile.workspace = true
ethrex-l2-rpc.workspace = true

[[bench]]
name = "build_block_benchmark"
harness = false
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl ValueFormatter for GasMeasurementFormatter {
}

fn read_private_keys() -> Vec<SecretKey> {
let file = include_str!("../../../fixtures/keys/private_keys_l1.txt");
let file = include_str!("../../fixtures/keys/private_keys_l1.txt");
file.lines()
.map(|line| {
let line = line.trim().strip_prefix("0x").unwrap();
Expand All @@ -122,7 +122,7 @@ async fn setup_genesis(accounts: &Vec<Address>) -> (Store, Genesis) {
if std::fs::exists(&storage_path).unwrap_or(false) {
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::fs::exists does not exist. Use std::fs::try_exists(&storage_path).unwrap_or(false) or Path::new(&storage_path).exists().

Suggested change
if std::fs::exists(&storage_path).unwrap_or(false) {
if storage_path.path().exists() {

Copilot uses AI. Check for mistakes.
std::fs::remove_dir_all(&storage_path).unwrap();
}
let genesis_file = include_bytes!("../../../fixtures/genesis/l1-dev.json");
let genesis_file = include_bytes!("../../fixtures/genesis/l1-dev.json");
let mut genesis: Genesis = serde_json::from_slice(genesis_file).unwrap();
let store = Store::new(storage_path, EngineType::RocksDB).unwrap();
for address in accounts {
Expand Down
35 changes: 10 additions & 25 deletions cmd/ethrex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ ethrex-storage.workspace = true
ethrex-storage-rollup = { workspace = true, optional = true }
ethrex-vm.workspace = true

tikv-jemallocator = { version = "0.6.0", optional = true, features = ["stats", "unprefixed_malloc_on_supported_platforms"] }
tikv-jemallocator = { version = "0.6.0", optional = true, features = [
"stats",
"unprefixed_malloc_on_supported_platforms",
] }
bytes.workspace = true
hex.workspace = true
tracing.workspace = true
Expand Down Expand Up @@ -55,7 +58,11 @@ url.workspace = true
tui-logger = { workspace = true, optional = true }

[target.'cfg(linux)'.dependencies]
tikv-jemallocator = { version = "0.6.0", optional = true, features = ["stats", "unprefixed_malloc_on_supported_platforms", "background_threads"] }
tikv-jemallocator = { version = "0.6.0", optional = true, features = [
"stats",
"unprefixed_malloc_on_supported_platforms",
"background_threads",
] }

[[bin]]
name = "ethrex"
Expand Down Expand Up @@ -102,33 +109,11 @@ l2 = [
"dep:serde_json",
"dep:hex",
]
l2-sql = [
"ethrex-storage-rollup/sql",
]
l2-sql = ["ethrex-storage-rollup/sql"]
sp1 = ["ethrex-prover/sp1"]
gpu = ["ethrex-prover/gpu"]
risc0 = ["ethrex-prover/risc0"]

[dev-dependencies]
criterion = { version = "0.5.1", features = [
"html_reports",
"async_futures",
"async_tokio",
] }
secp256k1.workspace = true
tempfile.workspace = true
ethrex-l2-rpc.workspace = true

[[bench]]
path = "./bench/import_blocks_benchmark.rs"
name = "import_blocks_benchmark"
harness = false

[[bench]]
path = "./bench/build_block_benchmark.rs"
name = "build_block_benchmark"
harness = false

[build-dependencies]
vergen-git2 = { version = "1.0.7", features = ["rustc"] }
ethrex-sdk = { workspace = true, optional = true }
Expand Down
42 changes: 0 additions & 42 deletions cmd/ethrex/bench/import_blocks_benchmark.rs

This file was deleted.

Loading