p2p: extend inbound eviction protection by network to CJDNS peers #24165

pull jonatack wants to merge 4 commits into bitcoin:master from jonatack:protect-inbound-cjdns-peers-from-eviction changing 3 files +156 −21
  1. jonatack commented at 10:02 AM on January 26, 2022: member

    Extend inbound eviction protection for peers connected over CJDNS, as is the case for peers connected via onion, localhost, and I2P since #21261 and #20197. CJDNS peers seem to have better min ping latency than onion and I2P peers but still higher than that of unencrypted IPv4/6 peers and can be disadvantaged under our eviction criteria. They are also very few in number, which is a further reason to protect them, as the goal of this logic is to favorise the diversity of our peer connections. CJDNS support was added in #23077 for the upcoming v23 release.

  2. p2p: extend inbound eviction protection by network to CJDNS peers
    This commit extends our inbound eviction protection to CJDNS peers to
    favorise the diversity of peer connections, as peers connected
    through the CJDNS network are otherwise disadvantaged by our eviction
    criteria for their higher latency (higher min ping times) relative
    to IPv4 and IPv6 peers.
    
    The `networks` array is order-dependent in the case of a tie in
    candidate counts between networks; earlier array members receive
    priority in the case of a tie.
    
    Therefore, we place CJDNS candidates before I2P, localhost, and onion
    ones in terms of opportunity to recover unused remaining protected
    slots from the previous iteration, estimating that most nodes allowing
    several inbound privacy networks will have more onion, localhost or
    I2P peers than CJDNS ones, as CJDNS support is only being added in the
    upcoming v23.0 release.
    f7b8094d61
  3. test: fix off-by-one logic in an eviction protection test 0c00c0c981
  4. test: add tests for inbound eviction protection of CJDNS peers 0a1bb84770
  5. test: add combined CJDNS/I2P/localhost/onion eviction protection tests b7be28cac5
  6. DrahtBot added the label P2P on Jan 26, 2022
  7. kristapsk commented at 11:42 AM on January 26, 2022: contributor

    Concept ACK

  8. w0xlt approved
  9. w0xlt commented at 2:02 PM on January 26, 2022: contributor

    tACK b7be28c

  10. laanwj commented at 7:01 PM on January 26, 2022: member

    Concept and code review ACK b7be28cac50046b9f2ddfe63ecafccc80649a36c Code changes look straightforward, thanks for adding tests.

  11. DrahtBot commented at 11:30 PM on January 26, 2022: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  12. jonatack commented at 1:16 PM on January 28, 2022: member

    Thanks for the ACKs @kristapsk, @w0xlt and @laanwj.

    Here is an example at this moment of the min ping latency of inbound IP peers vs CJDNS, Tor and I2P ones.

    Screenshot from 2022-01-28 14-11-26

  13. laanwj added this to the milestone 23.0 on Feb 3, 2022
  14. fanquake deleted a comment on Feb 4, 2022
  15. fanquake deleted a comment on Feb 4, 2022
  16. ghost commented at 3:04 PM on February 14, 2022: none

    Concept ACK

  17. laanwj merged this on Mar 2, 2022
  18. laanwj closed this on Mar 2, 2022

  19. jonatack deleted the branch on Mar 2, 2022
  20. sidhujag referenced this in commit 55f6e404b5 on Mar 2, 2022
  21. DrahtBot locked this on Mar 2, 2023

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 21:13 UTC

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