Skip to content

execution/state: drop the committed tier from BlockStateCache (#23140) - #23171

Draft
sudeepdino008 wants to merge 1 commit into
sudeepdino008/bsc-finalize-versionmapfrom
sudeepdino008/bsc-drop-committed-tier
Draft

execution/state: drop the committed tier from BlockStateCache (#23140)#23171
sudeepdino008 wants to merge 1 commit into
sudeepdino008/bsc-finalize-versionmapfrom
sudeepdino008/bsc-drop-committed-tier

Conversation

@sudeepdino008

@sudeepdino008 sudeepdino008 commented Aug 11, 2026

Copy link
Copy Markdown
Member

Part 3 of removing/reducing dependence on BlockStateCache (#23140). Stacked on #23149.

Summary

BlockStateCache has two tiers:

  • current: in-block writes (the write buffer) — unchanged.
  • committed: a lazily-populated read cache of the pre-block base, seeded as a side-effect of CachedReaderV3 reads.

This removes the committed tier (committedAccounts / committedStorage, and the PutCommitted*/GetCommitted* methods).

  • within a block the base (sd.mem → StateCache → files) is frozen — only the block-end Flush changes it — so the committed tier just duplicated StateCache and interfered with its LRU retention.
  • current-tier misses now fall through to that frozen base, which StateCache already caches.

The current fields are unchanged.

@sudeepdino008
sudeepdino008 force-pushed the sudeepdino008/bsc-drop-committed-tier branch from e1297f6 to f855b36 Compare August 11, 2026 12:39
BlockStateCache's committed tier (committedAccounts / committedStorage) was a
lazily-populated read cache of the pre-block base, seeded as a side-effect of
CachedReaderV3 reads. Within a block that base (sd.mem -> StateCache -> files)
is frozen -- only the block-end Flush changes it -- so the committed tier just
duplicated StateCache and interfered with its LRU retention. Remove it:
current-tier misses now fall through to the frozen base, which StateCache
already caches.

The current tier (in-block writes) and the writeLog / Flush path are unchanged.
Verified against a from-genesis batched stage_exec re-execution on mainnet
through the 2016 EIP-161 empty-account sweep window (block 2676607 and past
@sudeepdino008
sudeepdino008 force-pushed the sudeepdino008/bsc-finalize-versionmap branch from 5dac65a to 53e4734 Compare August 12, 2026 06:13
@sudeepdino008
sudeepdino008 force-pushed the sudeepdino008/bsc-drop-committed-tier branch from f855b36 to 908f5db Compare August 12, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant