fuzz: wallet: add target for MigrateToDescriptor #32624

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2025-05-fuzz-spkm-migration changing 1 files +139 −1
  1. brunoerg commented at 11:34 am on May 27, 2025: contributor

    This PR adds fuzz coverage for the scriptpubkeyman migration (MigrateToDescriptor). Note that it’s a test for the migration of the scriptpubkey manager, not for the whole migration process as tried in #29694, because:

    1. The wallet migration deals with DBs which is expensive for fuzzing (was getting around 3 exec/s);
    2. Mocking would require lots of refactors.

    This target loads keys, HDChain (even inactive ones), watch only and might add tons of different scripts, then calls MigrateToDescriptor. It does not play with encrypted stuff because it would make the target super slow. Also, after the migration there are some assertions that would work as a regression test for #31452, for example.

  2. DrahtBot commented at 11:34 am on May 27, 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/32624.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Approach ACK w0xlt

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

  3. DrahtBot added the label Tests on May 27, 2025
  4. DrahtBot added the label CI failed on May 27, 2025
  5. fuzz: wallet: add target for `MigrateToDescriptor` 5f2fb4dd33
  6. in src/wallet/test/fuzz/scriptpubkeyman.cpp:59 in 08b574dde2 outdated
    51@@ -50,6 +52,13 @@ void initialize_spkm()
    52     MOCKED_DESC_CONVERTER.Init();
    53 }
    54 
    55+void initialize_spkm_migration()
    56+{
    57+    static const auto testing_setup{MakeNoLogFileContext<const TestingSetup>()};
    58+    g_setup = testing_setup.get();
    59+    SelectParams(ChainType::MAIN);
    


    maflcko commented at 12:41 pm on May 27, 2025:
    why is this needed? Isn’t the chain already MAIN?

    brunoerg commented at 12:56 pm on May 27, 2025:
    Just removed it. Redudant.
  7. brunoerg force-pushed on May 27, 2025
  8. brunoerg commented at 12:56 pm on May 27, 2025: contributor
    08b574dde2c5f13a4c9dadcb9d8bded158c59623..5f2fb4dd333f8d1db27c78414afc84454e6ee4a5: Address #32624 (review)
  9. DrahtBot removed the label CI failed on May 27, 2025
  10. w0xlt commented at 10:26 pm on May 27, 2025: contributor
    Approach ACK
  11. brunoerg requested review from maflcko on Jun 5, 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-06-09 06:13 UTC

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