Skip to content

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

Open

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 callback → BranchPrefetcher — 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

Activity

  1. added this to the 3.5.0 milestone on Mar 24, 2026
  2. VBulikov commented on Mar 26, 2026

    @VBulikov
    Member

    yperbasis added Imp2 as Importance

  3. modified the milestones: 3.5.0, 3.6.0 on May 6, 2026
  4. modified the milestones: 3.6.0, 3.7.0 on Jun 10, 2026
  5. modified the milestones: 3.7.0, 3.8.0 on Aug 27, 2026
  6. modified the milestones: 3.8.0, 3.9.0 on Oct 15, 2026
  7. awskii commented on Oct 17, 2026

    @awskii
    Member

    At b1e19d2: state and commitment warming from a BAL share one path since #23627 (warmBAL → warmBALCommitment). The committer still starts its own StartBranchPrefetch (committer.go#L911); no single WarmBlockFromBAL yet. #19954 was closed unmerged, so the "blocked on" list is out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions