Skip to content

commitment: consolidate BAL-driven cache warming into single entry point #19955

Description

@mh0lt

Summary

Currently cache warming for block execution is split across multiple locations:

  1. BlocksReadAhead (exec/blocks_read_ahead.go) — warms state domain (accounts, code, storage) for EVM execution
  2. BAL prefetch loop in executeBlocks (exec3.go) — warms commitment domain (branch trie nodes) from BAL write set
  3. TouchPlainKey callbackBranchPrefetcher — warms commitment domain during execution as keys are touched

When BALs become the primary source of truth for what a block will touch, all of this should be unified into a single WarmBlockFromBAL(bal) call that:

  • Prefetches state domain data (accounts, storage, code) — replacing BlocksReadAhead
  • Prefetches commitment domain data (branch trie nodes) — replacing the inline BAL loop and TouchKey callback
  • Runs in a background goroutine as soon as the BAL is decoded, before execution starts

Benefits

  • Single place to understand all cache warming logic
  • BAL gives complete write set ahead of time — no need for heuristic read-ahead
  • Cleaner code path: one BAL → one warmup call → all domains
  • Foundation for further BAL-driven optimizations (e.g., pre-computing state diffs)

Context

Blocked on

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions