Make miniscript GetWitnessSize accurate for tapscript #28651

pull sipa wants to merge 3 commits into bitcoin:master from sipa:202310_miniscript_fuzz changing 3 files +124 −101
  1. sipa commented at 7:22 PM on October 13, 2023: member

    So far, the same algorithm is used to compute an (upper bound on) the maximum witness size for both P2WSH and P2TR miniscript. That's unfortunate, because it means fee estimations for P2TR miniscript will miss out on the generic savings brought by P2TR witnesses (smaller signatures and public keys, specifically).

    Fix this by making the algorithm use script context specification calculations, and add tests for it. Also included is a cleanup for the tests to avoid mutable globals, as I found it hard to reason about what exactly was being tested.

  2. test: remove mutable global contexts in miniscript fuzzer/test 7ed2b2d430
  3. test: add tests for miniscript GetWitnessSize 8be9851408
  4. DrahtBot commented at 7:22 PM on October 13, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK darosior, achow101

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

  5. miniscript: make GetWitnessSize accurate for tapscript b22810887b
  6. sipa force-pushed on Oct 13, 2023
  7. DrahtBot added the label CI failed on Oct 13, 2023
  8. DrahtBot removed the label CI failed on Oct 13, 2023
  9. DrahtBot added the label CI failed on Oct 14, 2023
  10. DrahtBot removed the label CI failed on Oct 14, 2023
  11. darosior commented at 11:24 AM on October 15, 2023: member

    Concept ACK. Good catch. GetWitnessSize ended up being merged with #26567 but i forgot to update it in #27255.

  12. fanquake added this to the milestone 26.0 on Oct 15, 2023
  13. darosior approved
  14. darosior commented at 12:01 PM on October 15, 2023: member

    ACK b22810887b3840ad0fcb424ea7e16d2d195767d9

    Nice cleanup too.

  15. fanquake requested review from achow101 on Oct 17, 2023
  16. achow101 commented at 10:22 PM on October 17, 2023: member

    ACK b22810887b3840ad0fcb424ea7e16d2d195767d9

  17. DrahtBot removed review request from achow101 on Oct 17, 2023
  18. achow101 merged this on Oct 17, 2023
  19. achow101 closed this on Oct 17, 2023

  20. Frank-GER referenced this in commit 1d8dd76735 on Oct 21, 2023
  21. bitcoin locked this on Oct 16, 2024

Milestone
26.0


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-04-19 09:13 UTC

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