fuzz: Add missing calls to SetMockTime for determinism #32927

pull maflcko wants to merge 3 commits into bitcoin:master from maflcko:2507-fuzz-missing-mocktime changing 10 files +12 −3
  1. maflcko commented at 12:49 pm on July 9, 2025: member

    (Tracking issue #29018)

    During fuzzing, AppInitParameterInteraction may actually disable a previously set mocktime. This is confusing and can also cause non-determinism.

    Fix this issue, by

    • fixing the erroneous -mocktime parsing in AppInitParameterInteraction.
    • adding the missing SetMockTime calls to the affected fuzz init functions.
    • adding a CheckGlobals to the fuzz init, to prevent this issue in the future.

    This can be tested by

    • Cherry-picking the CheckGlobals-commit onto current master and observing a fuzz failure in the touched fuzz targets.
    • Reverting the touched fuzz fixups and observing a fuzz failure for each target.
  2. Add SetMockTime for time_point types fa6b45fa8e
  3. test: Avoid resetting mocktime in testing setup
    This allows to set the mocktime before the testing setup.
    
    Also, in some fuzz tests the mocktime was reset to 0 before this change,
    so set it.
    fa26bfde98
  4. fuzz: CheckGlobals in init fa8862723c
  5. DrahtBot added the label Tests on Jul 9, 2025
  6. DrahtBot commented at 12:49 pm on July 9, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK w0xlt

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32822 (fuzz: Make process_message(s) more deterministic by maflcko)
    • #32430 (test: Add and use ElapseTime helper by maflcko)

    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.

  7. fanquake requested review from dergoegge on Jul 10, 2025
  8. fanquake requested review from marcofleon on Jul 10, 2025

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: 2025-07-11 00:13 UTC

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