feat(starfish): GC-based eviction in BlockManager#11402
Draft
polinikita wants to merge 1 commit intostarfish/feat/starfish-hardeningfrom
Draft
feat(starfish): GC-based eviction in BlockManager#11402polinikita wants to merge 1 commit intostarfish/feat/starfish-hardeningfrom
polinikita wants to merge 1 commit intostarfish/feat/starfish-hardeningfrom
Conversation
d976b6d to
33f6a7f
Compare
58b3b6a to
e1bf221
Compare
33f6a7f to
f7bb141
Compare
6dc25fa to
788adb9
Compare
e1bf221 to
957641c
Compare
Base automatically changed from
starfish/feat/restrictions-evict-commit-votes
to
starfish/feat/starfish-hardening
May 7, 2026 13:07
…nded-tx state Bounds BlockManager's in-memory bookkeeping by dropping refs the network's GC floor has already passed. An ancestor at or below `DagState::gc_round_for_last_commit()` cannot influence any not-yet-sequenced block, so retaining it as 'missing' or chasing it via HeaderSynchronizer serves no purpose. - Add `BlockSuspender::evict_below_round(round_floor)`: drops `headers_to_fetch` entries below the floor, then treats every `missing_ancestors` key below the floor as resolved and reuses `recursively_unsuspend_dependents` to cascade. Returns headers that became fully resolved. - Add `BlockManager::maybe_evict_below_gc_floor` called at the top of both `try_accept_blocks` and `try_accept_block_headers`, gated on `consensus_block_restrictions` and on the floor having advanced since the last call (`last_gc_floor_applied` field). - In `find_missing_ancestors`, skip ancestors at or below the floor. - In `filter_out_already_processed_and_sort`, drop incoming headers whose own round is at or below the floor. - Also retain `suspended_transactions` entries above the floor, addressing the existing unbounded-growth TODO. Same floor as headers — a block at or below `gc_round_for_last_commit` cannot be sequenced, so its txs cannot reach DagState. - Five new metrics under the `block_manager_gc_*` prefix to make sweep activity visible on Grafana. Without the hardening flag, behavior is unchanged: `Option<Round>`-typed gates make the round filters true no-ops in legacy mode. Closes #11401
788adb9 to
adc0f21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
Bounds
BlockManager's in-memory state by dropping refs the network's GC floor has already passed. An ancestor at or belowDagState::gc_round_for_last_commit()cannot influence any not-yet-sequenced block, so retaining it as "missing" or chasing it viaHeaderSynchronizerserves no purpose.BlockSuspender::evict_below_round(round_floor). Dropsheaders_to_fetchentries below the floor; treats everymissing_ancestorskey below the floor as resolved and reuses the existingrecursively_unsuspend_dependentscascade. Returns headers that became fully resolved.BlockManager::maybe_evict_below_gc_floor, called at the top of bothtry_accept_blocksandtry_accept_block_headers. Gated onconsensus_block_restrictionsand on the floor having advanced since the last call (last_gc_floor_appliedfield).find_missing_ancestorsso newly arrived headers are not suspended on refs that will never matter.filter_out_already_processed_and_sort.suspended_transactionsentries above the floor, addressing the existing unbounded-growth TODO atblock_manager/mod.rs:45.block_manager_gc_*metrics to make sweep activity visible on Grafana.The legacy path is preserved verbatim when the flag is off:
Option<Round>gates make the round filters true no-ops, andmaybe_evict_below_gc_floorshort-circuits to avec![]return before touching DagState.Links to any relevant issues
Fixes #11401
How the change has been tested
block_suspender.rs: single-dep eviction, mixed (one above/below floor), cascade chain, fetch-list pruningblock_manager/mod.rs: header with only old missing ancestors accepted directly, suspended-tx eviction below floor, sweep idempotent when floor unchanged, no-op when flag off