fuzz: Expand script verification flag testing to segwit v0 and tapscript #31460

pull dergoegge wants to merge 2 commits into bitcoin:master from dergoegge:2024-06-improve-script-tests changing 7 files +199 −20
  1. dergoegge commented at 2:45 pm on December 10, 2024: member

    The script_flags harness aims to test that our script verification flags are soft-forks (i.e. applying flags can only tighten the verification rules and not widen them). SigVersion::WITNESS_V0 and SigVersion::TAPSCRIPT scripts are currently not covered by this test, as fuzzers are blocked from e.g. creating a valid taproot script path spend commitment.

    This PR:

    • Moves the taproot commitment and witness script hash checks to BaseSignatureChecker (real impl in GenericTransactionSignatureChecker)
    • Introduces a second script flags harness script_flags_mocked which uses a BaseSignatureChecker mock, unblocking fuzzers from reaching segwit v{0,1} interpreter code (as well as paths relating to valid signatures)
  2. DrahtBot commented at 2:45 pm on December 10, 2024: 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/31460.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31519 (refactor: Use std::span over Span by maflcko)
    • #29269 (Add OP_INTERNALKEY for Tapscript by reardencode)

    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.

  3. DrahtBot added the label Tests on Dec 10, 2024
  4. [interpreter] Move taproot commitment and witness program check to BaseSignatureChecker 70ec9f2034
  5. dergoegge force-pushed on Dec 10, 2024
  6. [fuzz] Introduce script_flags_mocked to cover segwit v{0,1} script f9bc6ba48d
  7. dergoegge force-pushed on Dec 10, 2024

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: 2024-12-21 12:12 UTC

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