Skip to content

perf(l1): use add_block_pipeline in --no-zkvm mode#63

Merged
ilitteri merged 9 commits into
mainfrom
use-add-block-pipeline-for-no-zkvm
Feb 18, 2026
Merged

perf(l1): use add_block_pipeline in --no-zkvm mode#63
ilitteri merged 9 commits into
mainfrom
use-add-block-pipeline-for-no-zkvm

Conversation

@ilitteri

Copy link
Copy Markdown
Collaborator

Motivation

The --no-zkvm flag is used for profiling ethrex block execution without zkVM overhead. It was using Blockchain::add_block(), but ethrex itself processes blocks via add_block_pipeline which pipelines execution and merkleization concurrently. To get profiling results that match real ethrex behavior, we should use the same code path.

Description

  • Switch replay_no_zkvm from blockchain.add_block(block) to blockchain.add_block_pipeline(block)
  • Enable perf_logs_enabled on the Blockchain instance 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:

[METRIC] BLOCK EXECUTION THROUGHPUT (24443168): 0.373 Ggas/s TIME SPENT: 100 ms.
Gas Used: 0.037 (62%), #Txs: 442.
block validation: 0% | exec(w/merkle): 97% | merkle-only: 0% (max_queue_length: 1) | store: 2%

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.
Copilot AI review requested due to automatic review settings February 12, 2026 21:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() to Blockchain::new() with custom BlockchainOptions
  • Enable perf_logs_enabled option to display pipeline metrics (validate/exec/merkle/store breakdown)
  • Replace add_block() call with add_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).
@ilitteri ilitteri changed the title Use add_block_pipeline in --no-zkvm mode perf: use add_block_pipeline in --no-zkvm mode Feb 18, 2026
@ilitteri ilitteri changed the title perf: use add_block_pipeline in --no-zkvm mode perf(l1): use add_block_pipeline in --no-zkvm mode Feb 18, 2026
@github-actions github-actions Bot added the L1 label Feb 18, 2026
ilitteri and others added 5 commits February 18, 2026 01:19
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.
@ilitteri ilitteri merged commit 5a7bcf7 into main Feb 18, 2026
19 checks passed
@ilitteri ilitteri deleted the use-add-block-pipeline-for-no-zkvm branch February 18, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants