Nit: Inconsistency in the docs regarding block-relay-only connections #29046

issue ArmchairCryptologist opened this issue on December 10, 2023
  1. ArmchairCryptologist commented at 8:44 AM on December 10, 2023: none

    I was looking into why my node was frequently opening new block-relay-only connections even though it already had two such nodes connected, and while this appears to be intended behavior to counter eclipse attacks, while searching the codebase for this I encountered a minor contradiction in the docs.

    Specifically, doc/reduce-memory.md says:

    - `-maxconnections=<n>` - the maximum number of connections, which defaults to 125. Each active connection takes up some
      memory. This option applies only if inbound connections are enabled; otherwise, the number of connections will not
      be more than 11. Of the 11 outbound peers, there can be 8 full-relay connections, 2 block-relay-only ones,
      and occasionally 1 short-lived feeler or extra outbound block-relay-only connection.
    

    While doc/reduce-traffic.md says:

    By default, Bitcoin Core allows up to 125 connections to different peers, 10 of
    which are outbound. You can therefore, have at most 115 inbound connections.
    Of the 10 outbound peers, there can be 8 full-relay connections and 2
    block-relay-only ones.
    

    I'm not sure if the extra feeler/block-relay-only connection takes up one of the maxconnections slots or not, but the latter should probably be updated to reflect this behavior.

  2. ArmchairCryptologist renamed this:
    Nit: Inconsistency in the docs regarding blocks-relay-only connections
    Nit: Inconsistency in the docs regarding block-relay-only connections
    on Dec 10, 2023
  3. willcl-ark commented at 10:23 AM on December 11, 2023: member

    The short-lived feeler connections are not counted against the full outbound count:

    https://github.com/bitcoin/bitcoin/blob/09ab9d4fa731866802a6a9f9aa00d92536a8b420/src/net.cpp#L2349-L2355

    ...so reduce-traffic.md could be updated to mention that there are occasionally up to 11 outbound nodes, which it appears @MarnixCroes has just done :)

  4. fanquake closed this on Dec 12, 2023

  5. fanquake referenced this in commit 7a283836eb on Dec 12, 2023
  6. jonatack commented at 10:31 PM on January 5, 2024: member

    ...so reduce-traffic.md could be updated to mention that there are occasionally up to 11 outbound nodes, which it appears @MarnixCroes has just done :)

    If we wanted to be pedantic, 8 full-relay + 2 block-relay-only + 1 feeler + 1 extra block-relay-only peer would be an occasional max of 12 outbound peers. The change I made in reduce-memory.md was off by one in stating 11 🤠.

  7. bitcoin locked this on Jan 6, 2025

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-04-15 15:13 UTC

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