noban permission probably shouldn't give additional permissions implcitly #19886

issue luke-jr opened this issue on September 5, 2020
  1. luke-jr commented at 5:57 PM on September 5, 2020: member

    "Ignore block request below NODE_NETWORK_LIMITED threshold" is skipped for noban permission in a manner which actually sends to requested block.

    We should probably change it to use download permission, or simply ignore the request.

    Ignoring requests could cause existing peer software to stall/timeout in theory, but I don't think any existing software will make such requests from a NODE_NETWORK_LIMITED peer in the first place?

  2. luke-jr added the label Bug on Sep 5, 2020
  3. maflcko added the label Brainstorming on Sep 6, 2020
  4. adamjonas commented at 2:31 PM on August 4, 2022: member

    @MarcoFalke @luke-jr was this closed by #21235?

  5. maflcko commented at 2:34 PM on August 4, 2022: member

    i doubt it. 21235 was refactoring

  6. willcl-ark commented at 4:29 PM on November 2, 2022: member

    This seems like an easy-enough logic fix, but I feel like I must be missing why we would would permit NoBan peers to request blocks from our pruned node below the NODE_NETWORK_LIMITED threshold?

  7. willcl-ark commented at 11:52 AM on May 31, 2024: member

    After re-thinking on this issue, in my opinion it's correct to send the requested block (if it exists) to a NoBan peer here.

    The NoBan permission is designed to augment the Peer with:

    // Can't be banned/disconnected/discouraged for misbehavior
    

    ... which I would expect to include the "misbehaviour" of requesting blocks past the NODE_NETWORK_LIMITED threshold.

    • Changing this to the Download permission would have minimal practical impact, as NoBan implies Download.
    • Disconnecting a NoBan peer should be avoided if possible, and I don't think this specific misbehaviour feels strong-enough to override that guarantee.

    The only remaining alternative is to ignore the request but not disconnect the NoBan peer. In this case the remote node will eventually consider us stalling (after a timeout) and disconnect from us, which again achieves the opposite of the intention of the NoBan permission. If we are going to to this we may as well save everyone the time and disconnect the NoBan peer right away.

    My preference would be to leave this code as-is and close this issue out; what do you think @luke-jr ?


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-14 15:14 UTC

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