Test Details Overview

Rate-limit topo bootstrap repair heads (#5161)

* Rate-limit topo bootstrap repair heads

Repair heads re-scan the discovered range indefinitely and re-fire as soon
as a page makes progress, so on a synced node they sweep the whole ledger
at line rate, bounded only by the pre-check throughput. Without the topo
index the pre-check probes every entry by hash, turning the sweep into a
perpetual random-read storm that pegs the disk.

Add `topo_scan.repair_rate_limit` (20 req/s) with a dedicated limiter in
`topo_strategy`, applied via the repair gate so a throttled repair head
never stalls the spearhead. Repair heads are also disabled entirely when
the ledger has no topo index.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Charge the repair limiter per page scan

The repair gate checked for one token but the round was charged its full fanout. With `repair_consideration` above one, a bucket holding at least one token but fewer than the fanout failed the charge, the failure was ignored, and repair rounds ran unthrottled until the bucket refilled past the fanout.

The limiter exists to bound the ledger pre-check, and that cost is per retired page, not per request; the shared topo limiter already bounds requests. Charge one token per repair round right where the gate admitted it, and assert the charge, since the scan thread is the limiter's only consumer.

* Keep the trailing repair band on without the topo index

Repair heads were gated off as a class when the ledger has no topo index, which also parked the trailing band: the head that re-scans the heights a spearhead fast-forward skips. Without it a node that never ran --populate_topo_index relies on the frontier scan to notice anything the jump left behind.

Only the broad sweep is the random-read storm. The trailing band is a few pages per fast-forward, so split the repair gate into one per head class, trailing and broad, and gate only the broad heads on the index. The trailing head stays under the rate limiter with the rest.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>

__________

Type: commit

Hash: 66f2cb9b097d60953f1b962add7f1df74c8a5c8a

Created: today

__________

gr0v1ty/nano-node:66f2cb9b097d60953f1b962add7f1df74c8a5c8a

Test Results

Test Case Status Duration Median Deviation Log Graph