perf(l1): use add_block_pipeline in --no-zkvm mode#63
Merged
Conversation
The --no-zkvm flag is used for profiling block execution without zkVM overhead. Switching from add_block to add_block_pipeline matches how ethrex itself processes blocks (pipelined execution + merkleization). Also enables perf_logs_enabled on the Blockchain instance so the pipeline's built-in metrics (validate/exec/merkle/store breakdown) are printed during execution.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the --no-zkvm profiling mode to use the same execution path as production ethrex. The motivation is to get more accurate profiling results that reflect real ethrex behavior, which uses pipelined execution and merkleization.
Changes:
- Switch from
Blockchain::default_with_store()toBlockchain::new()with customBlockchainOptions - Enable
perf_logs_enabledoption to display pipeline metrics (validate/exec/merkle/store breakdown) - Replace
add_block()call withadd_block_pipeline()to use the production code path
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… targets - Add src/profiling.rs with RunStats for computing min/max/mean/median/stddev/percentiles - Add --repeat N flag to --no-zkvm that runs the block N times and prints statistics - Refactor replay_no_zkvm: extract prepare_no_zkvm_state for clean repeat loop - Add Makefile targets: profile, profile-debug, profile-stacks, profile-hwcounters, profile-samply
Documents the full profiling workflow for ethrex block execution: setup (perf, FlameGraph), three profiling steps (repeat timing, hardware counters, folded stacks), analysis commands for extracting hotspots from folded stacks, and baseline results from block 24443168 on ethrex-office-4 (0.63 Ggas/s, 60ms, 442 txs).
…y warnings Add the repeat field to the EthrexReplayOptions initializer in the L2 custom batch code path, and fix clippy lints in RunStats (use is_multiple_of, add is_empty method).
sp1up downloads the SP1 toolchain from GitHub releases, which is rate-limited for unauthenticated requests. This caused intermittent CI failures with "Failed to fetch releases list". Pass the GITHUB_TOKEN via --token flag as recommended by the Succinct docs.
The cached SP1 toolchain (v2) has a corrupted rustc binary that fails with ELF format errors. Bump cache key to v3 to force a fresh install.
This reverts commit e9603ef.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
--no-zkvmflag is used for profiling ethrex block execution without zkVM overhead. It was usingBlockchain::add_block(), but ethrex itself processes blocks viaadd_block_pipelinewhich pipelines execution and merkleization concurrently. To get profiling results that match real ethrex behavior, we should use the same code path.Description
replay_no_zkvmfromblockchain.add_block(block)toblockchain.add_block_pipeline(block)perf_logs_enabledon theBlockchaininstance so the pipeline's built-in metrics are printed (validate/exec/merkle/store breakdown with throughput in Ggas/s)Test
Tested against mainnet block 24443168 (442 txs, 37.5M gas) fetched from a live node: