fuzz: reset connman state in p2p targets #35808

pull HowHsu wants to merge 1 commits into bitcoin:master from HowHsu:fuzz-connman changing 2 files +3 −1
  1. HowHsu commented at 11:23 AM on July 26, 2026: contributor

    Resets ConnmanTestMsg at the start of each input in cmpctblock and p2p_handshake, matching the other reused-connman fuzz targets and preventing sticky CConnman state from leaking between corpus inputs.

    Before this, deterministic-fuzz-coverage showed single inputs were stable, but all-input directory runs were not:

    cmpctblock, src/net.cpp:4172
    - Branch (4172:9): [True: 1.21k, False: 33.0k]
    + Branch (4172:9): [True: 613, False: 33.6k]
    - Branch (4172:72): [True: 901, False: 311]
    + Branch (4172:72): [True: 497, False: 116]
    
    p2p_handshake, src/net.cpp:4172
    - Branch (4172:9): [True: 98, False: 1.67k]
    + Branch (4172:9): [True: 743, False: 1.03k]
    - Branch (4172:72): [True: 90, False: 8]
    + Branch (4172:72): [True: 612, False: 131]
    

    With the resets, deterministic-fuzz-coverage passed for both cmpctblock and p2p_handshake.

  2. DrahtBot added the label Fuzzing on Jul 26, 2026
  3. DrahtBot commented at 11:23 AM on July 26, 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/35808.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK nervana21

    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-->

  4. in src/test/fuzz/p2p_handshake.cpp:109 in fd403f9474
     105 | @@ -106,4 +106,5 @@ FUZZ_TARGET(p2p_handshake, .init = ::initialize)
     106 |      }
     107 |  
     108 |      node.connman->StopNodes();
     109 | +    connman.Reset();
    


    nervana21 commented at 6:26 PM on August 8, 2026:

    fd403f947432067678a9d5e866d06df3e59ad0e1: fuzz: reset connman state in p2p targets

    All other fuzz callers of connman.Reset() are at the start of the input (process_message.cpp, process_messages.cpp, p2p_private_broadcast.cpp).

    Is there a good reason to abandon that pattern here? If not, I'd prefer moving both of these Reset calls to the start of their respective harnesses to stay consistent with the rest of the codebase.


    HowHsu commented at 7:21 AM on August 13, 2026:

    Updated

  5. nervana21 commented at 6:26 PM on August 8, 2026: contributor

    Concept ACK

  6. HowHsu force-pushed on Aug 13, 2026
  7. HowHsu requested review from nervana21 on Aug 13, 2026
  8. nervana21 commented at 1:19 PM on August 13, 2026: contributor

    tACK d015b73c90646a1510b4c24447b3d011cd1188b6

  9. nervana21 commented at 1:22 PM on August 13, 2026: contributor

    Nit. Commit body still says Reset happens after stopping test nodes. PR description still says after StopNodes().

  10. HowHsu commented at 1:46 PM on August 13, 2026: contributor

    Nit. Commit body still says Reset happens after stopping test nodes. PR description still says after StopNodes().

    My bad, I'll update that.

  11. fuzz: reset connman state in p2p targets
    Clear ConnmanTestMsg state at the start of each input in cmpctblock and p2p_handshake so sticky CConnman state does not leak between fuzz inputs.
    d29b22d078
  12. HowHsu force-pushed on Aug 13, 2026
  13. nervana21 commented at 3:26 PM on August 13, 2026: contributor

    re-tACK d29b22d07897058eb69c862ecea8b00325229de2

    No code change. Commit message and PR description now match start-of-input Reset.

    Thanks for addressing nits :)


nervana21

Labels

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-08-21 20:51 UTC

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