perf(early-kickout): base seed blacklist on anchor last-final block#16072
Draft
stedfn wants to merge 2 commits into
Draft
perf(early-kickout): base seed blacklist on anchor last-final block#16072stedfn wants to merge 2 commits into
stedfn wants to merge 2 commits into
Conversation
The record-block seeder computed the chunk-producer blacklist from the aggregator walked up to the unfinalized anchor. During a finality stall that rescans the growing not-yet-finalized suffix every block, an O(stall-depth) per-block walk under the epoch-manager write lock. Base the blacklist on the anchor's last-final block instead (BlockInfo::last_final_block_hash / last_finalized_height). This is copied verbatim from the block header, so it is identical across nodes for a given canonical anchor - required because the seeded row is read on the strict consensus path (get_chunk_producer_info_anchored) with no recompute. It also bounds the walk: the aggregator's sync point already sits at the last-final block, so the walk covers only blocks finalized since the previous record (~1 in steady state, 0 during a stall) and never the unfinalized suffix. Gate the start-of-epoch grace window on the last-final block height too, matching the blacklist basis so the seeder is internally consistent. Update the get_chunk_producer_blacklist accessor to the same basis, and the epoch-manager tests: model 2-block finality in the block helper, shift the grace-boundary anchors, and retighten the finality-stall walk guard from O(depth^2) to constant-per-block across two stall depths. Stale/old-fork anchors whose last-final is an ancestor of the cached sync point still walk (rare, non-canonical, bounded by epoch length); a protocol-fixed budget cap for that case is left as a follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## stedfn/early-kickout-thresholds #16072 +/- ##
================================================================
Coverage 73.20% 73.21%
================================================================
Files 856 856
Lines 188485 188499 +14
Branches 188485 188499 +14
================================================================
+ Hits 137979 138006 +27
+ Misses 46086 46068 -18
- Partials 4420 4425 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Stacked on #16049 (thresholds). Follow-up to the early-kickout writer.
The record-block seeder computed the chunk-producer blacklist from the aggregator walked up to the unfinalized anchor. During a finality stall that rescans the growing not-yet-finalized suffix on every block, an O(stall-depth) per-block walk under the epoch-manager write lock.
This bases the blacklist on the anchor's last-final block instead (
BlockInfo::last_final_block_hash/last_finalized_height).get_chunk_producer_info_anchored) with no recompute.get_chunk_producer_blacklistaccessor updated to the same basis.Tests: model 2-block finality in the block helper, shift the grace-boundary anchors, and retighten the finality-stall walk guard from O(depth^2) to constant-per-block across two stall depths.
Stale/old-fork anchors whose last-final is an ancestor of the cached sync point still walk (rare, non-canonical, bounded by epoch length). A protocol-fixed budget cap for that case is left as a follow-up.