Disconnect on mempool requests from peers when over the upload limit. #7166

pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:mempool_p2p_when_overlimit changing 1 files +6 −0
  1. gmaxwell commented at 8:17 PM on December 3, 2015: contributor

    Mempool requests use a fair amount of bandwidth when the mempool is large, disconnecting peers using them follows the same logic as disconnecting peers fetching historical blocks.

  2. Disconnect on mempool requests from peers when over the upload limit.
    Mempool requests use a fair amount of bandwidth when the mempool is large,
     disconnecting peers using them follows the same logic as disconnecting
     peers fetching historical blocks.
    6aadc75578
  3. gmaxwell added the label P2P on Dec 3, 2015
  4. jonasschnelli commented at 8:21 PM on December 3, 2015: contributor

    utACK.

  5. MarcoFalke commented at 8:31 PM on December 3, 2015: member

    Nice, Concept ACK.

  6. dcousens commented at 8:38 PM on December 3, 2015: contributor

    ACK

    Would be nice if #6589 was merged so we could quantify how much is actually used by this on average :+1:

  7. GIJensen commented at 12:14 AM on December 4, 2015: none

    utACK.

  8. petertodd commented at 12:41 AM on December 4, 2015: contributor

    utACK

  9. laanwj merged this on Dec 4, 2015
  10. laanwj closed this on Dec 4, 2015

  11. laanwj referenced this in commit 792259278e on Dec 4, 2015
  12. gmaxwell referenced this in commit 6ba25d2886 on Dec 4, 2015
  13. laanwj commented at 8:45 AM on December 4, 2015: member

    Cherry-picked to 0.12 as 6ba25d2

  14. in src/main.cpp:None in 6aadc75578
    4980 | @@ -4981,6 +4981,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
    4981 |  
    4982 |      else if (strCommand == "mempool")
    4983 |      {
    4984 | +        if (CNode::OutboundTargetReached(false) && !pfrom->fWhitelisted)
    4985 | +        {
    4986 | +            LogPrint("net", "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId());
    4987 | +            pfrom->fDisconnect = true;
    


    rebroad commented at 2:46 PM on February 1, 2016:

    I'm not sure how much this achieves, just disconnecting. Is this considered misbehavior? Should it be considered misbehavior if the node reconnects and continues this behavior?


    laanwj commented at 3:35 PM on February 1, 2016:

    It's not misbehavior - the peer cannot know that you're close to exceeding your bandwidth limit.

    If the node reconnects and keeps bombarding with mempool commands it is absolutely misbehavior (with or without this pull), but this change is not meant as mitigation for attacks. For better or worse, at the moment we don't have any framework to ban peers based on P2P-level behavior.

  15. codablock referenced this in commit 33dc16278f on Feb 7, 2018
  16. codablock referenced this in commit 78e6ddfb18 on Feb 7, 2018
  17. codablock referenced this in commit 1086851938 on Feb 7, 2018
  18. andvgal referenced this in commit 3d03adcea1 on Jan 6, 2019
  19. CryptoCentric referenced this in commit cd0ff280d6 on Feb 28, 2019
  20. CryptoCentric referenced this in commit e5ddb78ae5 on Mar 2, 2019
  21. zkbot referenced this in commit e10008da66 on Feb 18, 2021
  22. zkbot referenced this in commit 777deea264 on Feb 19, 2021
  23. zkbot referenced this in commit b62e35dee8 on Feb 19, 2021
  24. MarcoFalke locked this on Sep 8, 2021

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-18 21:15 UTC

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