fuzz: don't set random state for private broadcast test #36404

pull andrewtoth wants to merge 1 commits into bitcoin:master from andrewtoth:private_broadcast_remove_fuzz_seed changing 1 files +0 −1
  1. andrewtoth commented at 8:10 PM on October 1, 2026: contributor

    The private broadcast fuzz test does not use any randomness. This was added in #35129 based on a draft created in #29415. That draft was created when the state of #29415 was still using SaltedTxidHashers, but this usage was removed before it was merged.

    Setting the random state while not using it is causing issues with nightly https://github.com/maflcko/bitcoin-core-nightly/issues/25.

  2. fuzz: don't set random state for private broadcast test 1d19cca076
  3. DrahtBot added the label Fuzzing on Oct 1, 2026
  4. DrahtBot commented at 8:10 PM on October 1, 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.

    Type Reviewers
    ACK kevkevinpal, vasild, maflcko, achow101

    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. kevkevinpal commented at 3:11 AM on October 2, 2026: contributor

    ACK 1d19cca

    Normally this wouldn't fail but in maflcko's nightly build there is this check that causes the test to fail

    g_ever_used_g_prng |= g_used_g_prng; // after each input
    
    if (tested && !g_ever_used_g_prng && g_seeded_g_prng_zero) {
        Assert(false); // remove unused SeedRandomStateForTest(SeedRand::ZEROS)?
    }
    

    Link to this code

    Nontheless this change makes sense because we do not need SeedRandomStateForTest(SeedRand::ZEROS);

  6. vasild approved
  7. vasild commented at 8:11 AM on October 2, 2026: contributor

    ACK 1d19cca0761ab35eb46867df2aacdc9715fa5ae0

    Is it possible to have this check run on PR CIs so that it is caught before the code is merged into master?

    Is this harmful in any way more than being a useless code clutter?

    Is there the reverse check either in master or elsewhere - to detect if a test does not set the random state and then uses random?

  8. fanquake added the label Private Broadcast on Oct 2, 2026
  9. andrewtoth commented at 12:36 PM on October 2, 2026: contributor

    Is it possible to have this check run on PR CIs so that it is caught before the code is merged into master?

    cc @maflcko

    Is this harmful in any way more than being a useless code clutter?

    I don't think it's harmful, but not sure.

    Is there the reverse check either in master or elsewhere - to detect if a test does not set the random state and then uses random?

    Yes, if this line is missing and the harness or code under test accesses the global RNG the CI fails loudly for all fuzz jobs.

  10. maflcko commented at 1:45 PM on October 2, 2026: member

    Is it possible to have this check run on PR CIs so that it is caught before the code is merged into master?

    cc @maflcko

    No. Fuzz tests are similar to unit tests, because both describe a test case. However, unit tests have their input values hard-coded or hard-derived. Fuzz tests have their input values derived by a fuzz engine and mutable sets of inputs are stored in a folder: qa-assets.

    Thus, to know that the fuzz test has "full" coverage and does not need randomness, the fuzz inputs have to be submitted before CI runs. However, usually the fuzz engine is only started after CI runs on a pull, usually even after a pull is merged.

    Is this harmful in any way more than being a useless code clutter?

    I don't think it's harmful, but not sure.

    Right, it is just a stupid "linter". I think it makes sense to limit global setup, but no strong opinion.

    lgtm ACK 1d19cca0761ab35eb46867df2aacdc9715fa5ae0

  11. achow101 commented at 11:34 PM on October 2, 2026: member

    ACK 1d19cca0761ab35eb46867df2aacdc9715fa5ae0

  12. achow101 merged this on Oct 2, 2026
  13. achow101 closed this on Oct 2, 2026

  14. andrewtoth deleted the branch on Oct 2, 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-10-06 17:51 UTC

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