net: allow selecting BIP152 high-bandwidth peers with -addnode

bitcoin/bitcoin: PR #35940

2 suggestions

Earlier concerns neither republished nor resolved: 1 major finding · 1 suggestion. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · The documented HB scope omits other connections to tagged destinations

Tagged policy also applies to matching onetry, -connect, anchor and some addrman connections, so operators cannot infer which peers bypass automatic HB rotation from the release note's narrower description.

Location: src/net.cpp:3872 (head).

Details and suggested fix

IsBip152HighBandwidthAddedNode matches manual, full-relay and block-relay-only peers by exact destination name or numeric service, regardless of which caller opened the connection. Thus a successful onetry or -connect connection to a tagged destination inherits the policy. Eligible anchors can also match because their selection bypasses AddedNodesContain. Ordinary addrman selection normally excludes added nodes, but that exclusion compares strings and is disabled at 24 records, allowing matches under those narrower conditions. With the existing protocol-version and non-blocksonly guards, classified peers receive SENDCMPCT(1) at VERACK and remain outside automatic HB rotation for that connection's lifetime.

Document this destination-based scope in the release note and -addnode help rather than describing only connections opened for an added node. Clarify that the addnode RPC cannot configure the suffix, but an RPC-created connection can inherit an existing tag. This preserves the implementation while explaining which connections receive the additional bandwidth policy; inbound connections remain excluded.


Link

[suggestion] · Misspelled HB suffixes receive no configuration warning

A typo such as =bip152hb leaves HB disabled and becomes part of the connection target without warning; literal-target passthrough predates this PR, and no operator typo has been observed.

Location: src/init.cpp:2165 (head).

Details and suggested fix

Only the exact, case-sensitive =bip152-hb suffix is stripped. For example, -addnode=1.2.3.4=bip152hb stores the entire value as the destination instead of requesting HB from 1.2.3.4. If that target cannot connect, the added-node thread keeps retrying on its 60-second cycle without a suffix-specific diagnostic. Name proxies receive the opaque hostname, so rejecting every unknown suffix would change existing behavior. Emit a LogWarning when a value contains = but lacks the recognized suffix, while retaining the literal target. This would help diagnose configuration mistakes and preserve the passthrough asserted by the new opaque.example=x test.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.