Repository navigation
Open
Labels
bugSomething isn't working
Description
Summary
Low-work headers sync through an AuxPoW-dense range never completes, and re-downloads the chain at every block announcement from every peer.
Severity: medium. Found in the 2026-11-04 review of the v1.0.1 change set (all 1.x.x merges since v1.0.0 plus the open PRs that target it), against 1.x.x 21fee6ee8e; area: #266.
Observed
Confidence: confirmed (reproduced on the 1.x.x build).
- Location:
src/headerssync.cpp:32-34(MAX_REDOWNLOAD_AUXPOW_SERIALIZED_SIZE= 9 × 4 MB) and:359-361(abort), plussrc/net_processing.cpp:2746-2822and:2705-2722(restart path), at 21fee6e. - Scenario:
- A node uses low-work sync. Today that means
-minimumchainworkabove the range, or a fork more than 144 blocks deep; in future, any release that setsnMinimumChainWork > 0. - It syncs through a range where the 15,009 buffered headers plus the current message carry more than 36 MB of AuxPoW payload. That takes about 19 AuxPoW blocks at about 1.9 MB, or 26 at 1.4 MB, within about 15,000 blocks (about 10.4 days, roughly 1% of AuxPoW-lane blocks).
- net: bound the size of headers messages we send #266 lets PRESYNC and REDOWNLOAD continue through size-cut messages, so the node now always reaches REDOWNLOAD. There it aborts at the same height every time, before releasing any header.
- Nothing is released, so
m_best_headerdoes not move. The next block announcement triggersgetheadersfrom the same place, which starts a new full PRESYNC and REDOWNLOAD cycle. This repeats with every non-noban peer, indefinitely.
- Reproduced (local functional test, not in the repository; v1.0.1 node with
-minimumchainworkat the tip; 26 × 1.4 MB AuxPoW blocks):- The abort
retained auxpow serialized size exceeded limit at height=36 (redownload phase)repeated on all 4 cycles, each restarting at height 0. - The node stayed at
headers=0 blocks=0, still connected. - It received 302,470,362 bytes in 108
headersmessages, about 75 MB per announcement, from one peer. - A default-settings v1.0.1 node synced the same chain in 0.2 s.
- The abort is logged only under
-debug=net. The info log keeps showing "Pre-synchronizing blockheaders" climbing to 100% and then restarting.
- The abort
- A node uses low-work sync. Today that means
- Evidence: code trace (
ValidateAndStoreRedownloadedHeaderreturns false, thenFinalize, thenHandleUnconnectingHeaders, whoseMaybeSendGetHeadersis rate-limited for 30 s, then the nextinvtriggersgetheaders(m_best_header), thenTryLowWorkHeadersSyncstarts a newHeadersSyncState), plus the functional run above (pass, 4/4 cycles aborted).
Impact
- Release integrity: release: prepare v1.0.1 #181's known-limitations bullet says low-work sync "gives up on a peer". In fact sync is permanently blocked on all peers, with a recurring bandwidth and CPU cycle. On mainnet, with about 48 MB of headers below a current minimum-work point and 8–10 peers, that is several hundred MB per minute until the operator intervenes.
- Today's chains are far from the bound (worst window 3.81 MB on mainnet, 4.66 MB on testnet4), and the default
nMinimumChainWorkis 0. So v1.0.1 defaults are not affected now. - It becomes a full-IBD blocker the first time a qbit release sets
nMinimumChainWork. Bitcoin Core does that every release; qbit'srelease-process.mdhas no such step yet. - Not a regression: v1.0.0 cannot sync such a range at all, because its presync hits an oversized message and disconnects.
Suggested fix
- (a) Reword the release: prepare v1.0.1 #181 bullet: "low-work headers sync cannot complete, from any peer, through a range holding more than about 36 MB of AuxPoW payload within 15,009 headers; it retries at each block announcement".
- (b) Before any release sets
nMinimumChainWork > 0, or docs recommend-minimumchainwork, either activate an AuxPoW payload size cap (soft fork) or re-derive the redownload memory bound in bytes. Two options for the bound: keep only a hash of each buffered header's AuxPoW and re-request it, or allow a larger byte budget for fewer concurrent low-work syncs. - (c) Cheap mitigation now: after a retained-size abort, remember (chain start, abort height) per peer and back off instead of restarting presync at every announcement. Log the abort at info level.
- (d) Add this scenario as a functional test.
Related: extends #181's known limitation "Low-work headers sync still gives up on a peer if the AuxPoW payloads … exceed its existing 36 MB per-peer bound", and #174's open note on MAX_REDOWNLOAD_AUXPOW_SERIALIZED_SIZE. New: - it fails on every peer and never makes progress;
- each announcement re-downloads the whole range;
- the abort is not visible at info level;
- concrete trigger cost and today's margins;
- the interaction with a future
nMinimumChainWork.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
doc: correct v1.0.1 notes and docs from the release review
doc: correct v1.0.1 notes and docs from the release review
doc: correct v1.0.1 notes and docs from the release review
kiwidream commentedon Nov 11, 2026
Release-planning note (2026-11-11).
This blocks a non-zero mainnet
nMinimumChainWork.nMinimumChainWork > 0, every new node runs low-work headers sync from genesis up to that much work. An AuxPoW-dense range below the chosen block would then hit the abort-and-restart loop described above, and new nodes could not sync.nMinimumChainWork(anddefaultAssumeValid) at zero, asChainParams_MAIN_launch_bootstrapinsrc/test/pow_tests.cppasserts.doc/release/release-process.md, it is an x.y.0 decision.Current mainnet margin. On 2026-11-10 we did a read-only scan of mainnet block files:
The worst windows, against the 36,000,000-byte redownload cap:
Today's history is well under the cap, so a node that sets
-minimumchainworkitself still syncs. The abort is still possible in three cases:-minimumchainworkcovers such a range.Before any release raises
nMinimumChainWork:ChainParams_MAIN_launch_bootstrap, and say so in the release notes.doc: correct v1.0.1 notes and docs from the release review
release: prepare v1.0.1 (#181)
release: prepare v1.0.1 (#181)