This workspace contains code for benchmarking guest programs within different zkVMs. Although different guest programs are supported, the main use case is benchmarking the Ethereum STF by running benchmarks from the spec tests.
crates/metrics: Defines common data structures (BenchmarkRun<Metadata>) for storing and serializing benchmark results with generic metadata support.crates/witness-generator: A library that provides functionality for generating benchmark fixture files (BlockAndWitness: individual block + witness pairs) required for stateless block validation by processing standard Ethereum test fixtures or RPC endpoints.crates/witness-generator-cli: A standalone binary that uses thewitness-generatorlibrary to generate fixture files. These are saved in thezkevm-fixtures-inputfolder.crates/ere-hosts: A standalone binary that runs benchmarks across different zkVM platforms using pre-generated fixture files fromzkevm-fixtures-input.crates/benchmark-runner: Provides a unified framework for running benchmarks across different zkVM implementations, including guest program input generation and execution orchestration.scripts/: Contains helper scripts (e.g., fetching fixtures).
Guest programs are maintained in the eth-act/ere-guests repository and downloaded automatically during benchmark runs.
The benchmarking process is decoupled into two distinct phases:
- Fixture Generation (
witness-generator-cli): Processes Ethereum benchmark fixtures (EEST) or RPC data to generate individualBlockAndWitnessfixtures as JSON files saved inzkevm-fixtures-input/. - Benchmark Execution (
ere-hosts): Reads fromzkevm-fixtures-input/and runs performance benchmarks across different zkVM platforms.
This decoupling provides several benefits:
- Independent fixture generation and benchmark execution
- Reuse of generated fixtures across multiple benchmark runs
- Rust Toolchain: A standard Rust installation managed by
rustup. - Docker: All zkVMs use EreDockerized, which means you don't need to install zkVM-specific toolchains locally. Docker handles all the compilation and execution environments.
- Git: Required for cloning the repository.
- Common Shell Utilities: The scripts require a
bash-compatible shell and standard utilities likecurl,jq, andtar.
-
Clone the Repository:
git clone https://github.com/eth-applied-research-group/zkevm-benchmark-workload.git cd zkevm-benchmark-workload -
Fetch/Update Benchmark Fixtures:
./scripts/download-and-extract-fixtures.sh
-
Generate Benchmark Input Files (required for
stateless-validatorguest program):cargo run --release -- tests --include 10M- --include Prague # Or generate from local EEST fixtures cargo run --release -- tests --eest-fixtures-path /path/to/local/eest/fixtures # Or generate from RPC cargo run --release -- rpc --last-n-blocks 2 --rpc-url <your-rpc-url> # Or listen for new blocks continuously cargo run --release -- rpc --follow --rpc-url <your-rpc-url>
This creates individual
.jsonfiles in thezkevm-fixtures-input/directory that will be consumed by the benchmark runner. -
Run Benchmarks:
Run benchmarks using the generated fixture files. All zkVMs are dockerized, so no additional setup is required:
cd crates/ere-hosts # Run Ethereum stateless validator benchmarks with Reth execution client cargo run --release -- --zkvms risc0 stateless-validator --execution-client reth # Run Ethereum stateless validator benchmarks with Ethrex execution client cargo run --release -- --zkvms sp1 stateless-validator --execution-client ethrex # Run empty program benchmarks (for measuring zkVM overhead) cargo run --release -- empty-program # Run block encoding length benchmarks cargo run --release -- block-encoding-length --loop-count 100 --format rlp # Run block encoding length benchmarks (with SSZ encoding format) cargo run --release -- block-encoding-length --loop-count 100 --format ssz # Use custom input folder for stateless validator benchmarks cargo run --release -- stateless-validator --execution-client reth --input-folder my-fixtures # Dump raw input files used in benchmarks (opt-in) cargo run --release -- --zkvms sp1 --dump-inputs my-inputs stateless-validator --execution-client reth
See the respective README files in each crate for detailed usage instructions.
The --dump-inputs flag allows you to save the raw serialized input bytes used for each benchmark run. This is useful for:
- Debugging guest programs independently
- Analyzing input data characteristics
- Replaying specific test cases outside the benchmark framework
When specified, input files are saved to the designated folder with the following structure:
{dump-folder}/
└── {sub-folder}/ # e.g., "reth" for stateless-validator, empty for others
└── {name}.bin # Input files (one per benchmark)
Example usage:
cd crates/ere-hosts
# Dump inputs for stateless validator with Reth
cargo run --release -- --zkvms sp1 --dump-inputs debug-inputs stateless-validator --execution-client reth
# This creates files like:
# debug-inputs/reth/block-12345.bin
# debug-inputs/reth/block-12346.binNote: Input files are zkVM-independent (the same input is used across all zkVMs), so they're only written once even when benchmarking multiple zkVMs.
Licensed under either of
- MIT license (LICENSE‑MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE‑APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
