2 suggestions
Optional improvements
[suggestion] · Historical requests still exhaust per-peer compact-download capacity
Excluding historical requests from the global count only helps tip announcements from peers with free download slots; historically saturated peers still cannot start a compact-block download.
Location: src/net_processing.cpp:3186 (head).
Details and suggested fix
When enough eligible, missing historical blocks remain in the download window, SendMessages assigns a non-limited peer's remaining capacity to them. HeadersDirectFetchBlocks then stops at the unchanged per-peer limit before reaching the new NonHistoricalBlocksInFlight() check. For a new tip block not already requested from that peer, the CMPCTBLOCK handler likewise permits only optimistic reconstruction, without a GETBLOCKTXN round trip if transactions are missing. The test sidesteps this case by connecting a fresh announcer because the first peer's slots are occupied. This limitation predates the PR: active-chain downloads get priority when slots free, and other peers or successful reconstruction can provide progress. Its production frequency is not established. Narrow the PR and commit-message claims to peers with available capacity, and cover an already historically saturated announcer in the test. If normal tip relay from those peers is the intended goal, reserve capacity in the historical scheduler while retaining the processing limits; that trades some historical download parallelism for tip-download capacity.
[suggestion] · High-bandwidth peer selection lacks snapshot-specific coverage
The new test checks only GETDATA, so reverting the snapshot-specific BlockChecked selection changes would leave its assertions intact.
Location: test/functional/feature_assumeutxo.py:432 (head).
Details and suggested fix
The announcer's block dictionary is populated before the new tip block is mined, and BlockServingPeer answers only MSG_BLOCK requests for dictionary entries. The test therefore never delivers that block before disconnecting; cleanup later checks synchronization, not peer selection. Neither assertion protects the separate BlockChecked changes that allow tip suppliers to be selected despite historical requests and prevent historical suppliers from being selected. Extend the fixture so a compact-capable peer that is not already high-bandwidth delivers the tip block while historical requests remain outstanding, then assert SENDCMPCT(high_bandwidth=true) or bip152_hb_to. Also deliver a historical block from an unselected peer and assert no promotion, with the other selection guards arranged so the old condition would permit it. Establish that the node has already left IBD before either measured callback: ConnectTip emits BlockChecked before updating the tip and IBD status, so changing mocktime immediately before delivery is insufficient.