{"id":24016932,"url":"https://github.com/axiom-crypto/openvm-reth-benchmark","last_synced_at":"2025-09-14T17:31:04.334Z","repository":{"id":268390983,"uuid":"897536804","full_name":"axiom-crypto/openvm-reth-benchmark","owner":"axiom-crypto","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-13T12:30:02.000Z","size":51843,"stargazers_count":9,"open_issues_count":2,"forks_count":6,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-09-13T14:39:20.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axiom-crypto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-02T19:55:37.000Z","updated_at":"2025-09-12T18:12:19.000Z","dependencies_parsed_at":"2024-12-16T13:53:38.755Z","dependency_job_id":"13fc6241-5bd5-4222-b386-236b6608026a","html_url":"https://github.com/axiom-crypto/openvm-reth-benchmark","commit_stats":null,"previous_names":["axiom-crypto/openvm-reth-benchmark"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/axiom-crypto/openvm-reth-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiom-crypto%2Fopenvm-reth-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiom-crypto%2Fopenvm-reth-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiom-crypto%2Fopenvm-reth-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiom-crypto%2Fopenvm-reth-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axiom-crypto","download_url":"https://codeload.github.com/axiom-crypto/openvm-reth-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axiom-crypto%2Fopenvm-reth-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275139269,"owners_count":25412218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-08T09:01:03.925Z","updated_at":"2025-09-14T17:31:04.319Z","avatar_url":"https://github.com/axiom-crypto.png","language":"Rust","funding_links":[],"categories":["Miscellaneous ##"],"sub_categories":["Devcon 2024 ###"],"readme":"# OpenVM Reth Benchmark\n\nBenchmarks of running [Reth](https://github.com/paradigmxyz/reth) on the [OpenVM](https://github.com/openvm-org/openvm)\nframework to generate zero-knowledge proofs of EVM block execution on Ethereum Mainnet.\n\n\u003e [!CAUTION]\n\u003e\n\u003e This repository is still an active work-in-progress and is not audited or meant for production usage.\n\n## Getting Started\n\nTo run these benchmarks locally, you must first have [Rust](https://www.rust-lang.org/tools/install) installed. Then follow the rest of the instructions below.\n\n### Installing the `cargo-openvm` CLI\n\nInstall the OpenVM command line interface by building from source via:\n\n```bash\ncargo install --git 'http://github.com/openvm-org/openvm.git' cargo-openvm\n```\n\n### RPC Node Requirement\n\nRSP fetches block and state data from a JSON-RPC node. You must use an archive node which preserves historical intermediate trie nodes needed for fetching storage proofs. Common RPC providers such as Alchemy and QuickNode offer endpoints that provide these storage proofs.\n\nYou can pass the RPC URL into the CLI by either using the `--rpc-url` argument\n\n```bash\ncargo run --bin openvm-reth-benchmark --release -- --block-number 18884864 --rpc-url \u003cRPC\u003e\n```\n\nor by providing the `RPC_1` variable in the `.env` file and specifying the chain id in the CLI command like this:\n\n```bash\ncargo run --bin openvm-reth-benchmark --release -- --block-number 18884864 --chain-id 1\n```\n\n#### Using cached client input\n\nThe client input (witness) generated by executing against RPC can be cached to speed up iteration of the client program by supplying the `--cache-dir` option:\n\n```bash\nmkdir -p rpc-cache\ncargo run --bin openvm-reth-benchmark --release -- --block-number 18884864 --chain-id 1 --cache-dir rpc-cache\n```\n\nNote that even when utilizing a cached input, the host still needs access to the chain ID to identify the network type, either through `--rpc-url` or `--chain-id`.\n\n## Running Benchmarks\n\n### Helper Script\n\nWe describe the different steps and commands needed to run the benchmark in subsequent sections, but to ease the process, we provide a helper script in [`run.sh`](./run.sh) that you can run directly. You only need to edit the `$MODE` variable in the script depending on your usage.\n\n### Compiling the Guest Program\n\nBefore running the benchmark, you must first compile the guest program using `cargo-openvm`. Starting from the root of the repository, run:\n\n```bash\ncd bin/client-eth\ncargo openvm build --no-transpile\nmkdir -p ../host/elf\ncp target/riscv32im-risc0-zkvm-elf/release/openvm-client-eth ../host/elf/\ncd ../..\n```\n\nThis process must currently be done manually, but will soon be automated with build scripts.\n\nIf this is your first time using `cargo-openvm`, cargo may prompt you to install the `rust-src` component for a nightly toolchain. This will look like:\n\n```bash\nrustup component add rust-src --toolchain nightly-2024-10-30-$arch-unknown-linux-gnu\n```\n\nwhere `$arch` is the architecture of your machine (e.g. `x86_64` or `aarch64`).\n\n### Executing the Runtime\n\nTo execute the guest program for only the OpenVM runtime (without proving), for example to collect metrics such as cycle counts, run:\n\n```bash\nRUSTFLAGS=\"-Ctarget-cpu=native\" RUST_LOG=info OUTPUT_PATH=\"metrics.json\" \\\ncargo run --bin openvm-reth-benchmark --release -- \\\n--execute --block-number 21345144 --rpc-url $RPC_1 --cache-dir rpc-cache\n```\n\nBy default a minimal set of metrics will be collected and output to a `metrics.json` file.\n\n### Generating App Proofs\n\nThe overall program for executing an Ethereum block may be long depending on how many transactions on in the block. The OpenVM framework uses continuations to prove unbounded program execution by splitting the program into multiple segments and proving segments separately.\n\nTo prove all segments of the block execution program (without aggregation, see next section for that), run:\n\n```bash\nRUSTFLAGS=\"-Ctarget-cpu=native\" RUST_LOG=info OUTPUT_PATH=\"metrics.json\" \\\ncargo run --bin openvm-reth-benchmark --release -- \\\n--prove --block-number 21345144 --rpc-url $RPC_1 --cache-dir rpc-cache\n```\n\nThis will generate proofs locally on your machine. Given how large these programs are, it might take a while for the proof to generate.\n\n### Generating Proof for On-Chain Verification\n\nIn order to have a single proof of small size for on-chain verification in the EVM, the OpenVM framework uses proof aggregation and STARK-to-SNARK recursion to generate a final proof for verification in a smart contract.\n\nBefore running the benchmark, you will need to download a KZG trusted setup necessary for generating the Halo2 SNARK proofs:\n\n```bash\n#!/bin/bash\n\nfor k in {5..24}\ndo\n    wget \"https://axiom-crypto.s3.amazonaws.com/challenge_0085/kzg_bn254_${k}.srs\"\n    # for faster download, install s5cmd and use:\n    # s5cmd --no-sign-request cp --concurrency 10 \"s3://axiom-crypto/challenge_0085/${pkey_file}\" .\ndone\n\nmv *.srs params/\nexport PARAMS_DIR=\"$HOME/.openvm/params/\"\n```\n\nTo run the full end-to-end benchmark for EVM verification, run:\n\n```bash\nRUSTFLAGS=\"-Ctarget-cpu=native\" RUST_LOG=info OUTPUT_PATH=\"metrics.json\" \\\ncargo run --bin openvm-reth-benchmark --release -- \\\n--mode prove-evm --block-number 21345144 --rpc-url $RPC_1 --cache-dir rpc-cache\n```\n\n### Summarizing Benchmark Results\n\nAfter running an [end-to-end benchmark](#generating-proof-for-on-chain-verification), there will be a `metrics.json` with collected metrics. We have a python script that will parse the JSON into a markdown summary. Run it by installing `python3` and running:\n\n```bash\npython3 ci/summarize.py metrics.json --print\n```\n\n### Advanced Configuration\n\nThe benchmark command accepts additional arguments that can be used to configure the benchmark. **These are low-level and require knowledge of the proof system.** They include:\n\n- `--app-log-blowup`: Set the blowup factor for the App VM proofs (default: 2)\n- `--agg-log-blowup`: Set the blowup factor for the leaf aggregation proofs (default: 2)\n- `--internal-log-blowup`: Set the blowup factor for the internal non-leaf aggregation proofs (default: 2)\n- `--root-log-blowup`: Set the blowup factor for the root STARK aggregation proof (default: 3)\n- `--max-segment-length`: Set the threshold number of cycles before the execution should segment (default: `2 ** 23 - 100`)\n\n### Github Workflow\n\nA github actions workflow for running the benchmark via workflow dispatch is available [here](.github/workflows/reth-benchmark.yml).\n\n### What are good testing blocks\n\nA good small block to test on for Ethereum mainnet is: `21345144`, which has only 8 transactions.\n\n## Acknowledgements\n\n- The zkVM framework uses [OpenVM](https://github.com/openvm-org/openvm).\n- The underlying Rust libraries make heavy use of [Reth](https://github.com/paradigmxyz/reth) and [Revm](https://github.com/bluealloy/revm/).\n- This repo was forked from [RSP](https://github.com/succinctlabs/rsp/tree/main)\n- The RSP repo builds on work from [Zeth](https://github.com/risc0/zeth)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiom-crypto%2Fopenvm-reth-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxiom-crypto%2Fopenvm-reth-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiom-crypto%2Fopenvm-reth-benchmark/lists"}