Skip to content

apollo_batcher: evict the reverted height from the caches after writing the pending results - #15076

Open
yoavGrs wants to merge 1 commit into
commitment-infos-2-batcher-cachefrom
commitment-infos-2b-evict-reverted-height
Open

apollo_batcher: evict the reverted height from the caches after writing the pending results#15076
yoavGrs wants to merge 1 commit into
commitment-infos-2-batcher-cachefrom
commitment-infos-2b-evict-reverted-height

Conversation

@yoavGrs

@yoavGrs yoavGrs commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor

cursor Bot commented Aug 30, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches block-revert and commitment caching in the batcher; wrong timing could serve stale block hashes or state commitment infos after a revert.

Overview
Fixes commitment manager cache cleanup on block revert so the reverted height is not left in recent_block_hashes_cache or recent_state_commitment_infos_cache after a revert finishes.

Eviction is deferred until after write_commitment_results_to_storage in revert_commitment, via new evict_reverted_height. That ordering matters when a commit for the reverted height is still in flight: its result may be written and cached during the revert, and only then should that height be dropped from both caches.

Removed earlier eviction on revert task enqueue (add_revert_task) and when the revert committer output arrives (wait_for_revert_result). Tests now cover the pending-commit-during-revert case and assert both caches are clear afterward.

Reviewed by Cursor Bugbot for commit a483869. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

2 participants