rpc, descriptor: warn when multipath expansion clones single-path key expressions #36005

pull pythcoiner wants to merge 4 commits into bitcoin:master from pythcoiner:multipath-clone-warning changing 8 files +145 −10
  1. pythcoiner commented at 4:19 AM on August 18, 2026: contributor

    This PR:

    • deduplicate warnings pushed with PushWarnings in RPC calls
    • warn when single-path key expressions or tr() subscripts are cloned into every multipath expansion; surfaced by importdescriptors and by a new warnings field on getdescriptorinfo (which also exposes the existing miniscript older() warnings)

    Cloning internal to musig() is not warned: both musig(A,B)/<0;1>/* and musig(A/<1;2>,B) derive a distinct aggregate key per branch, so nothing observable is reused.

    closes #35985

  2. rpc: deduplicate warnings in PushWarnings 9363ed59f2
  3. descriptor: warn when single-path key expressions are cloned into multipath branches 29c8cfdfb4
  4. DrahtBot commented at 4:20 AM on August 18, 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/36005.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK jeanpablojp

    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.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31668 (Added rescan option for import descriptors by saikiran57)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. pythcoiner force-pushed on Aug 18, 2026
  6. DrahtBot added the label CI failed on Aug 18, 2026
  7. pythcoiner marked this as ready for review on Aug 18, 2026
  8. pythcoiner referenced this in commit cf98aaa510 on Aug 18, 2026
  9. pythcoiner force-pushed on Aug 18, 2026
  10. rpc: return descriptor warnings from getdescriptorinfo 0e6891b424
  11. doc: add release notes for #36005 13ef865f84
  12. pythcoiner force-pushed on Aug 18, 2026
  13. DrahtBot removed the label CI failed on Aug 18, 2026
  14. DrahtBot added the label CI failed on Aug 18, 2026
  15. DrahtBot commented at 6:18 AM on August 18, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task previous releases: https://github.com/bitcoin/bitcoin/actions/runs/32101345101/job/95602400388</sub> <sub>LLM reason (✨ experimental): CI failed due to a GCC 12 internal compiler error (segmentation fault) while compiling src/rpc/blockchain.cpp.</sub>

    Edit: Looks like the ICE was due to a corrupt VM/hardware

  16. DrahtBot removed the label CI failed on Aug 18, 2026
  17. jeanpablojp commented at 3:14 PM on August 20, 2026: contributor

    tACK 13ef865f84fc5d0f7073e11a6b4167b2dcd45e92

    Built and ran the unit tests plus rpc_getdescriptorinfo.py and wallet_importdescriptors.py. I dropped each of the four multipath_cloned = true lines one at a time and each one fails on a different descriptor in the new unit test, and reverting only the PushWarnings dedup fails both functional tests.

  18. in src/test/descriptor_tests.cpp:1358 in 13ef865f84
    1353 | +    auto descs = Parse(desc, keys, error);
    1354 | +    BOOST_REQUIRE_MESSAGE(!descs.empty(), desc + ": " + error);
    1355 | +    for (const auto& d : descs) {
    1356 | +        const auto warnings = d->Warnings();
    1357 | +        if (expect_warning) {
    1358 | +            BOOST_REQUIRE_MESSAGE(warnings.size() == 1U, desc);
    


    jeanpablojp commented at 3:14 PM on August 20, 2026:

    nit: this only allows one warning. I hit both with wsh(and_v(v:pk(A/<0;1>/*),and_v(v:pk(B/0/*),older(65536)))), which nothing covers at the moment. Worth adding one?


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 04:51 UTC

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