Skip to content

csnode: the backfill turn budget follows the node's role - #146

Merged
EnzinoBB merged 1 commit into
masterfrom
fix/backfill-adaptive-budget
Oct 31, 2026
Merged

EnzinoBB merged 1 commit into
masterfrom
fix/backfill-adaptive-budget

Conversation

@EnzinoBB

Copy link
Copy Markdown
Collaborator

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 use turnBudgetMs (50, backfill_turn_budget_ms) while trusted and idleTurnBudgetMs (90, new backfill_idle_turn_budget_ms, 0..1000) otherwise.
  • Test 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

  • CI build and unit tests (Linux, Windows, macOS)
  • robustness (backfill-trusted-load rows measure the longest turn of a trusted node)
  • the mainnet test node on this build

🤖 Generated with Claude Code

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>
@EnzinoBB
EnzinoBB merged commit 8d4bc38 into master Oct 31, 2026
4 checks passed
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