BIP159 updates #1768

pull jonatack wants to merge 4 commits into bitcoin:master from jonatack:2025-02-bip159 changing 1 files +11 −7
  1. jonatack commented at 8:57 pm on February 14, 2025: member

    A few clarifications following an offline discussion with BIP author Jonas Schnelli yesterday.

    These are compatible with the reference implementation in the BIP and with the current implementation in Bitcoin Core.

    It is worthwhile to read the discussion in reference implementation https://github.com/bitcoin/bitcoin/pull/10387 (particularly https://github.com/bitcoin/bitcoin/pull/10387#discussion_r156861038).

  2. jonatack commented at 8:57 pm on February 14, 2025: member
  3. jonatack added the label Proposed BIP modification on Feb 17, 2025
  4. jonatack added the label Pending acceptance on Feb 17, 2025
  5. BIP159: emphasize minimum number of blocks 3e45cbae84
  6. jonatack force-pushed on Feb 17, 2025
  7. jonatack marked this as ready for review on Feb 17, 2025
  8. jonatack commented at 5:19 pm on February 17, 2025: member
    Did another pass and seems ready for review.
  9. in bip-0159.mediawiki:24 in 1b17eea05d outdated
    24+Bitcoin right now only offers the <code>NODE_NETWORK</code> service bit to indicate that a peer can serve
    25 all historical blocks.
    26-# Pruned peers can relay blocks, headers, transactions, addresses and can serve a limited number of historical blocks, thus they should have a way how to announce their service(s)
    27-# Peers no longer in initial block download should consider connecting some of its outbound connections to pruned peers to allow other peers to bootstrap from non-pruned peers
    28+# Pruned peers can relay blocks, headers, transactions, and addresses, but they guarantee serving only a minimum limited number of historical blocks; thus, they should have a way to announce their service(s)
    29+# Pruned peers are defined by this BIP in service bit terms as those having <code>NODE_NETWORK_LIMITED</code> set and any service bit that signals serving the complete block chain, like <code>NODE_NETWORK</code>, not set
    


    jonasschnelli commented at 8:53 pm on February 17, 2025:
    I think this is better but still hard to read. Maybe we should describe the expected behavior when both service bits (NODE_NETWORK and NODE_NETWORK_LIMITED) are set?

    jonatack commented at 9:28 pm on February 17, 2025:
    Good point. Rewrote it, and moved it out of the motivation section into the specification instead.
  10. jonatack force-pushed on Feb 17, 2025
  11. jonatack commented at 9:31 pm on February 17, 2025: member
    Updated the second commit per review feedback: 1b17eea..b680873
  12. jonatack commented at 9:34 pm on February 17, 2025: member
    (I might propose adding a changelog to this BIP if this moves forward.)
  13. in bip-0159.mediawiki:37 in b68087347a outdated
    33@@ -34,6 +34,8 @@ This BIP proposes a new service bit
    34 | NODE_NETWORK_LIMITED || bit 10 (0x400) || If signaled, the peer <I>MUST</I> be capable of serving at least the last 288 blocks (~2 days).
    35 |}
    36 
    37+Pruned/limited peers <I>MUST</I> have <code>NODE_NETWORK_LIMITED</code> set and any service bit that signals serving the complete block chain (e.g. <code>NODE_NETWORK</code>) <I>MUST NOT</I> be set. Signaling serving all historical blocks overrides <code>NODE_NETWORK_LIMITED</code>.
    


    murchandamus commented at 9:24 pm on February 18, 2025:

    Actually, seeing line 34, defining that NODE_NETWORK_LIMITED means that a node is capable of serving at least the last 288 blocks makes me think that it would be correct for nodes with the entire blockchain to indicate both NODE_NETWORK and NODE_NETWORK_LIMITED.

    I don’t understand the motivation for the first half-sentence. A pruned node should be permitted to not signal NODE_NETWORK_LIMITED. As far as I understand you want to clarify that a pruned node should not be advertising NODE_NETWORK?

    0Pruned/limited peers <I>MUST NOT</I> set a service bit that signals serving the complete block chain (e.g. <code>NODE_NETWORK</code>.
    

    jonatack commented at 11:38 pm on February 20, 2025:
    Done, nice simplification.
  14. in bip-0159.mediawiki:49 in b68087347a outdated
    43@@ -42,13 +44,15 @@ Full nodes following this BIP <I>SHOULD</I> relay address/services (<code>addr</
    44 
    45 === Counter-measures for peer fingerprinting ===
    46 
    47-Peers may have different prune depths (depending on the peers configuration, disk space, etc.) which can result in a fingerprinting weakness (finding the prune depth through getdata requests). NODE_NETWORK_LIMITED supporting peers <I>SHOULD</I> avoid leaking the prune depth and therefore not serve blocks deeper than the signaled <code>NODE_NETWORK_LIMITED</code> threshold (288 blocks).
    48+Peers may have different prune depths (depending on the peers configuration, disk space, etc.), which can result in a fingerprinting weakness (finding the prune depth through getdata requests).
    49+
    50+Pruned peers (<code>NODE_NETWORK_LIMITED</code> nodes that do not also signal serving the full block chain) should avoid leaking the prune depth and therefore <I>SHOULD NOT</I> serve blocks deeper than the signaled <code>NODE_NETWORK_LIMITED</code> threshold of 288 blocks.
    


    murchandamus commented at 9:31 pm on February 18, 2025:

    This seems unnecessarily specific. A node that signals NODE_NETWORK_LIMITED but not NODE_NETWORK should serve only the last 288 blocks, regardless of whether they are pruned or not.

    0Peers that signal <code>NODE_NETWORK_LIMITED</code> that do not also signal <code>NODE_NETWORK</code> should avoid leaking the prune depth and therefore <I>SHOULD NOT</I> serve blocks deeper than the signaled <code>NODE_NETWORK_LIMITED</code> threshold of 288 blocks.
    

    jonatack commented at 11:38 pm on February 20, 2025:
    Thanks, done.
  15. murchandamus commented at 9:32 pm on February 18, 2025: contributor
    Good clean-up on the text, but I think I understand the service signals differently than you. Given that NODE_NETWORK_LIMITED indicates being able to at least serve 288 blocks, it seems perfectly compatible with also signaling NODE_NETWORK.
  16. BIP159: clarify pruned means not signaling serving complete block chain
    e.g. that NODE_NETWORK is not set
    
    See reference implementation
    
    https://github.com/bitcoin/bitcoin/pull/10387
    
    and this comment in that pull
    
    https://github.com/bitcoin/bitcoin/pull/10387#discussion_r156861038
    f5cf65d4f3
  17. BIP159: editorial fixups 8075c560a3
  18. BIP159: unwillingly -> unwittingly
    Not the same meaning, so not a purely editorial fixup, but I think "unwittingly"
    expresses the intended meaning.
    b3e6e24de5
  19. jonatack force-pushed on Feb 20, 2025
  20. jonatack commented at 11:46 pm on February 20, 2025: member
    Updated to take the feedback from @jonasschnelli and @murchandamus (thanks!) and it looks much better. Please let me know what you think.
  21. in bip-0159.mediawiki:23 in 3e45cbae84 outdated
    19@@ -20,7 +20,7 @@ Define a service bit that allow pruned peers to signal their limited services
    20 Pruned peers can offer the same services as traditional peer except of serving all historical blocks.
    21 Bitcoin right now only offers the NODE_NETWORK service bit which indicates that a peer can serve
    22 all historical blocks.
    23-# Pruned peers can relay blocks, headers, transactions, addresses and can serve a limited number of historical blocks, thus they should have a way how to announce their service(s)
    24+# Pruned peers can relay blocks, headers, transactions, and addresses, but they guarantee serving only a minimum limited number of historical blocks; thus, they should have a way to announce their service(s)
    


    murchandamus commented at 7:04 pm on February 21, 2025:

    Feel free to ignore, but it would make more sense to me to put the “only” before guarantee, otherwise it sounds like they guarantee not serving more than the minimum, which doesn’t match the specification. Also, isn’t “minimum limited” done twice?

    0# Pruned peers can relay blocks, headers, transactions, and addresses, but they only guarantee serving a minimum limited number of historical blocks; thus, they should have a way to announce their service(s)
    
  22. murchandamus commented at 7:05 pm on February 21, 2025: contributor

    ACK b3e6e24de5cebaa630534e5683c36c4e24831818

    Good improvement, one optional nit, if you feel like taking it.

  23. in bip-0159.mediawiki:37 in b3e6e24de5
    33@@ -34,6 +34,8 @@ This BIP proposes a new service bit
    34 | NODE_NETWORK_LIMITED || bit 10 (0x400) || If signaled, the peer <I>MUST</I> be capable of serving at least the last 288 blocks (~2 days).
    35 |}
    36 
    37+Pruned/limited peers <I>MUST NOT</I> set a service bit that signals serving the complete block chain (e.g., <code>NODE_NETWORK</code>.
    


    jonasschnelli commented at 9:18 pm on February 21, 2025:
    Should we add an info that “normal” full nodes (NODE_NETWORK) can also signal NODE_NETWORK_LIMITED as it is inclusive (which would reflect the current behavior on the network)?

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-02-22 08:10 UTC

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