Repository navigation
csnode: the backfill turn budget follows the node's role - #146
Merged
Merged
Conversation
With 50 ms per turn the mainnet test node backfilled at about 250 blocks/s instead of about 550 (each block costs ~1.7 ms of the processor thread). A node outside the round's trusted set has little consensus work: it now takes 90 ms per turn (backfill_idle_turn_budget_ms), and keeps 50 ms (backfill_turn_budget_ms) while it is a confidant or the writer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 31, 2026
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.
Why
With the 50 ms turn budget of #140 (and #145's window fix) the mainnet test node backfills at 212-282 blocks/s instead of ~544: each block costs ~1.7 ms of the processor thread and the backfill gets at most ~50 % of it. The budget matters while the node is a confidant; outside the trusted set the thread has little consensus work.
Change
Context::trusted(myLevel_ != Level::Normal, set every tick); the turns until the next tick useturnBudgetMs(50,backfill_turn_budget_ms) while trusted andidleTurnBudgetMs(90, newbackfill_idle_turn_budget_ms, 0..1000) otherwise.AConfidantTakesTheShorterBudget; config tests; docs/storage.md, differences.md, CHANGES.Expected on mainnet: ~450 blocks/s while not trusted (about 5 days for the whole history instead of 8-9).
Test plan
🤖 Generated with Claude Code