Skip to content

feat(engine): prefetch withdrawal addresses in pre-warming#21966

Merged
mattsse merged 11 commits intomainfrom
mattsse/prefetch-withdrawals
Feb 9, 2026
Merged

feat(engine): prefetch withdrawal addresses in pre-warming#21966
mattsse merged 11 commits intomainfrom
mattsse/prefetch-withdrawals

Conversation

@gakonst
Copy link
Member

@gakonst gakonst commented Feb 8, 2026

Summary

Prefetch trie proofs for withdrawal addresses during pre-warming, before block execution reaches the post-block balance increment phase.

Motivation

Withdrawals happen at the end of block execution as balance increments. The multiproof computation for these accounts currently has to wait for I/O during post-execution. Since withdrawal addresses are known from the payload upfront, we can prefetch their trie proofs early.

Changes

  • Add withdrawals field to ExecutionEnv (mod.rs)
  • Add multiproof_targets_from_withdrawals() helper in prewarm.rs (supports both legacy and V2 proof targets)
  • Send PrefetchProofs for withdrawals at spawn time in PayloadProcessor::spawn(), non-BAL path only
  • Add withdrawals() accessor to BlockOrPayload
  • Zero-amount withdrawals are filtered, duplicate addresses are deduplicated

Testing

  • Benchmark submitted: run_id a70a6a1a-3221-496e-b67d-7327ec34d57b

Slack thread: https://tempoxyz.slack.com/archives/C0A87C21805/p1770564694402899

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

⚠️ Changelog not found.

A changelog entry is required before merging. We've generated a suggested changelog based on your changes:

Preview
---
reth-engine-tree: patch
---

Added prefetching of withdrawal addresses during block execution prewarming to improve performance.

Add changelog to commit this to your branch.

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Feb 9, 2026
@DaniPopes DaniPopes requested a review from mattsse February 9, 2026 10:23
gakonst and others added 4 commits February 9, 2026 14:40
Withdrawals happen at the end of block execution as balance increments.
Previously, the pre-warming system did not prefetch any data for these
withdrawal addresses, meaning the multiproof computation for withdrawals
had to wait for I/O during post-execution.

This change generates account-level multiproof prefetch targets for
withdrawal addresses and sends them immediately when spawning the
payload processor, before transaction prewarming begins. This gives
the multiproof task a head start on fetching trie proofs for withdrawal
accounts.

- Add `withdrawals` field to `ExecutionEnv`
- Add `multiproof_targets_from_withdrawals()` helper (supports both
  legacy and V2 proof targets)
- Send `PrefetchProofs` for withdrawals at spawn time in non-BAL path
- Filter zero-amount withdrawals and deduplicate addresses
- BAL path excluded since BAL should already cover withdrawal touches

Co-authored-by: mattsse <matt@paradigm.xyz>
Amp-Thread-ID: https://ampcode.com/threads/T-019c3de1-3f1a-75ce-89f6-cc1ff085a42c
Co-authored-by: Amp <amp@ampcode.com>
@gakonst gakonst force-pushed the mattsse/prefetch-withdrawals branch from 750c61e to d809536 Compare February 9, 2026 14:40
gakonst and others added 5 commits February 9, 2026 19:52
- Remove amount > 0 filters (withdrawal amounts are never 0)
- Check withdrawals is non-empty instead of filtering by amount
- Return &[Withdrawal] from BlockOrPayload::withdrawals() to avoid cloning
- Keep dedup filter in V2 targets

Amp-Thread-ID: https://ampcode.com/threads/T-019c43f3-4165-7637-bea2-707b4d96b71d
Co-authored-by: Amp <amp@ampcode.com>
@mattsse mattsse added this pull request to the merge queue Feb 9, 2026
Merged via the queue into main with commit 67f89fa Feb 9, 2026
42 checks passed
@mattsse mattsse deleted the mattsse/prefetch-withdrawals branch February 9, 2026 22:25
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Feb 9, 2026
CarlBeek added a commit to CarlBeek/reth that referenced this pull request Feb 10, 2026
* paradigmxyz/main: (144 commits)
  feat(engine): add getPayloadBodiesV2 endpoints for EIP-7928 BAL support (paradigmxyz#21774)
  ci: skip scheduled workflows on forks (paradigmxyz#22022)
  chore: rm random log file (paradigmxyz#22023)
  chore: remove base.reth.rs public endpoint references (paradigmxyz#22019)
  feat(rpc): add `subscribeFinalizedChainNotifications` endpoint (paradigmxyz#22011)
  feat(trie): remove `SerialSparseTrie` (paradigmxyz#21808)
  fix(rocksdb): set max_open_files to prevent fd exhaustion (paradigmxyz#22005)
  refactor(txpool): rename and document validation methods (paradigmxyz#22008)
  feat(engine): prefetch withdrawal addresses in pre-warming (paradigmxyz#21966)
  refactor(pool): add IntoIter: Send bounds to avoid unnecessary Vec collect (paradigmxyz#22001)
  fix(rpc): enforce blockHash constraint in append_matching_block_logs (paradigmxyz#22007)
  chore: move Kurtosis failures to the hive slack channel  (paradigmxyz#21983)
  feat(rpc): propagate TransactionOrigin through send_transaction and batcher (paradigmxyz#21969)
  feat(engine): reorg depth commitment metric (paradigmxyz#21992)
  feat(storage): add use_hashed_state storage setting (paradigmxyz#21997)
  perf: better scheduling for storage roots computation (paradigmxyz#21987)
  chore(deps): bump alloy 1.6.2 -> 1.6.3 (paradigmxyz#21986)
  fix(stages): skip sender unwind when fully pruned (paradigmxyz#21988)
  chore(net): remove OP stack bootnodes (paradigmxyz#21984)
  ci: use depot for hive and kurtosis image builds, run daily (paradigmxyz#21976)
  ...

# Conflicts:
#	.github/workflows/compact.yml
#	.github/workflows/dependencies.yml
#	.github/workflows/docker-tag-latest.yml
#	.github/workflows/docker.yml
#	.github/workflows/e2e.yml
#	.github/workflows/hive.yml
#	.github/workflows/integration.yml
#	.github/workflows/kurtosis.yml
#	.github/workflows/lint.yml
#	.github/workflows/release.yml
#	.github/workflows/reproducible-build.yml
#	.github/workflows/stale.yml
#	.github/workflows/sync-era.yml
#	.github/workflows/sync.yml
#	.github/workflows/unit.yml
#	bin/reth/Cargo.toml
#	crates/cli/commands/src/node.rs
#	crates/node/core/src/node_config.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants