net: allow selecting BIP152 high-bandwidth peers with `-addnode` #35940

pull w0xlt wants to merge 4 commits into bitcoin:master from w0xlt:feature/addnode-bip152-hb changing 8 files +189 −16
  1. w0xlt commented at 5:57 AM on August 10, 2026: contributor

    Bitcoin Core automatically selects up to three BIP152 high-bandwidth peers after they deliver useful blocks. This works for ordinary connections, but it cannot use topology information known by the operator.

    For example, an operator may run nodes in multiple locations or maintain a stable, low-latency peering link and want that connection to announce compact blocks immediately and consistently, including after reconnects, instead of waiting for automatic selection.

    This PR adds an opt-in suffix:

    -addnode=<host>[:port]=bip152-hb
    

    A matching outbound peer receives the existing SENDCMPCT(1) request after the handshake. The policy is reapplied on reconnect and requires no new P2P protocol messages.

    Configured peers are additional to the three automatically selected peers and are not included in automatic rotation. This intentionally allows explicit configuration to exceed BIP152’s current three-peer limit and may increase redundant bandwidth. If accepted, BIP152 can be updated separately.

    The option is incompatible with -blocksonly. Untagged addnodes, inbound connections, and the addnode RPC retain their existing behavior; RPC support can be considered separately.

  2. net, init: pass -addnode values to CConnman as AddedNodeParams
    Build the AddedNodeParams records in init.cpp instead of passing raw
    strings to CConnman, and move the added-node v2 transport decision out of
    CConnman::Init() accordingly. This lets startup code attach per-added-node
    settings in a follow-up commit.
    
    No behavior change.
    b1a6f73333
  3. net: match outbound peers to BIP152 HB added-node policy
    Match durable outbound peers against persistent added-node records without
    carrying policy through connection creation. Snapshot tagged endpoints
    under the added-node mutex, then compare exact destinations and numeric
    services without name lookups.
    
    This covers normal added-node connections, name-proxy destinations,
    numeric aliases, and BIP324 reconnections while keeping DNS out of
    connection initialization.
    cd501f9b6b
  4. net, init: configure BIP152 high bandwidth for added nodes
    Recognize the exact =bip152-hb suffix on persistent -addnode entries and
    classify matching durable outbound peers during peer initialization.
    
    Use the existing SENDCMPCT sent at VERACK to request high-bandwidth
    announcements, and keep configured peers outside the automatic
    three-peer rotation list.
    f6b7fb689c
  5. doc: add release note for BIP152 high-bandwidth added nodes 8ebd31e84c
  6. DrahtBot added the label P2P on Aug 10, 2026
  7. DrahtBot commented at 5:57 AM on August 10, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35940.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35561 (net: move some CNodeState fields to Peer by Crypt-iQ)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-11 10:50 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me