test: cover the feature-negotiation version boundary in p2p_leak #36152

pull brunoerg wants to merge 2 commits into bitcoin:master from brunoerg:2026-09-test-wtxidrelay-version-boundary changing 2 files +26 −1
  1. brunoerg commented at 6:10 PM on September 2, 2026: contributor

    p2p_leak already checks that a pre-wtxidrelay peer (nVersion 70015) is sent neither WTXIDRELAY nor SENDADDRV2, but nothing pins down the exact boundary: the feature negotiation messages are offered when the common version is >= WTXID_RELAY_VERSION (70016).

    Add a peer advertising exactly 70016 and assert it receives both messages, so an off-by-one change of either greatest_common_version >= WTXID_RELAY_VERSION / >= 70016 comparison to > is detected.

    It kills https://bitcoincore.space/src/net_processing.cpp#3462 and https://bitcoincore.space/src/net_processing.cpp#3464


    edit: added a commit that adds a test case that checks SENDTXRCNCL is sent at version 70016. The existing 70015 case only shows SENDTXRCNCL is withheld below the wtxidrelay version. Add a peer at exactly 70016 so the lower bound of the >= WTXID_RELAY_VERSION check is covered too. It kills: https://bitcoincore.space/src/net_processing.cpp#3466.

  2. test: cover the feature-negotiation version boundary in p2p_leak
    p2p_leak already checks that a pre-wtxidrelay peer (nVersion 70015) is
    sent neither WTXIDRELAY nor SENDADDRV2, but nothing pins down the exact
    boundary: the feature negotiation messages are offered when the common
    version is >= WTXID_RELAY_VERSION (70016). Add a peer advertising exactly
    70016 and assert it receives both messages, so an off-by-one change of
    either `greatest_common_version >= WTXID_RELAY_VERSION` / `>= 70016`
    comparison to `>` is detected.
    8108dfe4e5
  3. DrahtBot added the label Tests on Sep 2, 2026
  4. DrahtBot commented at 6:11 PM on September 2, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36152.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    Concept ACK naiyoma

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. naiyoma commented at 2:43 PM on September 7, 2026: contributor

    Concept ACK, ( not sure if this is out of scope). I think it would be great to kill https://bitcoincore.space/src/net_processing.cpp#3466 in this PR as well.

    I did this in https://github.com/naiyoma/bitcoin/pull/22/changes/b7bdb41050cb20c80a72a9584fd52b4a6d45cdda

  6. test: check SENDTXRCNCL is sent at version 70016
    The existing 70015 case only shows SENDTXRCNCL is withheld below the
    wtxidrelay version. Add a peer at exactly 70016 so the lower bound of
    the `>= WTXID_RELAY_VERSION` check is covered too.
    
    Co-authored-by: naiyoma <lankas.aurelia@gmail.com>
    f54329e6ce
  7. brunoerg commented at 8:36 PM on September 8, 2026: contributor

    Concept ACK, ( not sure if this is out of scope). I think it would be great to kill https://bitcoincore.space/src/net_processing.cpp#3466 in this PR as well.

    I did this in naiyoma@b7bdb41

    Not out of scope, it's a simple test case and related so I just pushed adding it here as well. Thank you.

  8. DrahtBot added the label CI failed on Sep 8, 2026

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-09-09 07:56 UTC