test: a switch to tx relay via filterclear can trigger eviction #36438

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2026-10-test-filterclear changing 1 files +13 −3
  1. brunoerg commented at 2:31 PM on October 5, 2026: contributor

    This PR adds a test case that checks that a switch to tx relay via filterclear can trigger eviction.

    It kills the following mutant (https://mutanthub.space/mutants/3746):

    diff --git a/src/net_processing.cpp b/src/net_processing.cpp
    index 96caf9050f..d9019db877 100644
    --- a/src/net_processing.cpp
    +++ b/src/net_processing.cpp
    @@ -5312,7 +5312,6 @@ void PeerManagerImpl::ProcessMessage(Peer& peer, CNode& pfrom, const std::string
             }
             pfrom.m_bloom_filter_loaded = false;
             pfrom.m_relays_txs = true;
    -        MaybeDisconnectForTxRelayCapacity(pfrom, msg_type);
             return;
         }
    
    
  2. DrahtBot added the label Tests on Oct 5, 2026
  3. DrahtBot commented at 2:31 PM on October 5, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35874 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35874.svg"></sub> (p2p: prevent BIP35 requesters from bypassing inbound tx-relay capacity by l0rinc)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. test: a switch to tx relay via filterclear can trigger eviction 7dc0e8174c
  5. in test/functional/p2p_connection_limits.py:91 in 2cf2ba1292
      86 | +        peer2.send_without_ping(self.create_blocks_only_version())
      87 | +        peer2.wait_for_verack()
      88 | +        self.wait_until(lambda: len(node.getpeerinfo()) == 2)
      89 | +        with node.assert_debug_log(['connection dropped after filterclear message'], timeout=2):
      90 | +            peer2.send_without_ping(msg_filterclear())
      91 | +        self.wait_until(lambda: len(node.getpeerinfo()) == 1)
    


    maflcko commented at 2:47 PM on October 5, 2026:
            with node.assert_debug_log(['connection dropped after filterclear message']):
                peer2.send_without_ping(msg_filterclear())
                self.wait_until(lambda: len(node.getpeerinfo()) == 1)
    

    nit: The debug log timeout isn't needed, when the disconnect is waited on. (Same in the remainder of this test, but feel free to ignore any or all)


    brunoerg commented at 4:30 PM on October 5, 2026:

    Good point, addressed it.

  6. brunoerg force-pushed on Oct 5, 2026
  7. mercie-ux commented at 3:57 AM on October 7, 2026: contributor

    ACK 7dc0e8174c7d9180c606c45b91ed21155943fa6b

  8. Naomi-Gift commented at 2:04 PM on October 7, 2026: none

    tACK 7dc0e8174c7d9180c606c45b91ed21155943fa6b Test passes, I removed the MaybeDisconnectForTxRelayCapacity call in the FILTERCLEAR handler and the new check failed.

  9. ViniciusCestarii commented at 3:02 PM on October 7, 2026: contributor

    tACK 7dc0e8174c7d9180c606c45b91ed21155943fa6b

    Applied the mutant and confirmed the new test case kills it.

  10. Ayoazeez26 commented at 2:29 PM on October 8, 2026: none

    tACK 7dc0e8174c7d9180c606c45b91ed21155943fa6b

    Ran p2p_connection_limits.py 20x locally (macOS), all passed. Commented out MaybeDisconnectForTxRelayCapacity in the FILTERCLEAR handler. The new check then fails as expected at the filterclear step, and the existing filterload check still passes.


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-10-08 23:51 UTC

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