miniscript refactor: Remove unique_ptr-indirection (#30866 follow-up) #31713

pull hodlinator wants to merge 3 commits into bitcoin:master from hodlinator:2024/11/miniscript_ownership changing 4 files +277 −279
  1. hodlinator commented at 9:16 pm on January 22, 2025: contributor

    Removes one level of unnecessary indirection, which aided in finding one issue in #30866. Simplifies the code one step further than https://github.com/bitcoin/bitcoin/pull/30866/commits/09a1875ad8cddeb17c19af34b8282d37fed0937e belonging to aforementioned PR.

    No observed difference when running benchmarks: ExpandDescriptor/WalletIsMineDescriptors/WalletIsMineMigratedDescriptors/WalletLoadingDescriptors.

  2. DrahtBot commented at 9:16 pm on January 22, 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/31713.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK sipa

    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:

    • #31734 (miniscript: account for all StringType variants in Miniscriptdescriptor::ToString() by pythcoiner)
    • #31727 (miniscript: convert non-critical asserts to CHECK_NONFATAL by darosior)
    • #31519 (refactor: Use std::span over Span 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.

  3. hodlinator commented at 9:20 pm on January 22, 2025: contributor

    CC @achow101 @darosior @brunoerg from parent PR to gauge their interest.

    It’s unfortunate that this PR touches many lines, so if there’s little support for the refactoring I’m fine with closing, or letting it linger for a while (I understand this is super-low priority). At least it helped find the issue mentioned at the top of the summary.

  4. darosior commented at 1:04 am on January 23, 2025: member

    CI failure looks unrelated. Could you s/script/miniscript/ in the PR title to make it clear to reviewer this does not touch consensus critical stuff?

    It’s unfortunate that this PR touches many lines

    It’s also not a part of the codebase where i expect much churn, so it probably lowers the bar for doing something like this.

  5. miniscript doc: Remove mention of shared pointers
    Correct destructor implementation comment to no longer refer to shared pointers and also move it into the function body, in symmetry with Clone() right below.
    531aab627c
  6. miniscript refactor: Make fields non-const
    Makes a lot of fields in miniscript.h non-const in order to allow move-operations in next commit.
    c7f1829b4b
  7. miniscript refactor: Remove superfluous unique_ptr-indirection
    Functional parity is achieved through making Node move-able.
    
    (Also makes Node::subs no longer mutable).
    58e9c7ca89
  8. hodlinator renamed this:
    script refactor: Remove superfluous unique_ptr-indirection (#30866 follow-up)
    miniscript refactor: Remove unique_ptr-indirection (#30866 follow-up)
    on Jan 23, 2025
  9. hodlinator force-pushed on Jan 23, 2025
  10. maflcko commented at 8:33 am on January 23, 2025: member

    CI failure looks unrelated.

    I can’t seem to find it. It would be good to always report or at least leave a comment with the log to any CI failure. Otherwise, it will remain unfixed and will just happen on another pull later on.

  11. l0rinc commented at 8:59 am on January 23, 2025: contributor

    leave a comment with the log to any CI failure

    I think they meant the p2p_1p1c_network failure at https://github.com/bitcoin/bitcoin/actions/runs/12917231673/job/36023158007?pr=31713

  12. hodlinator commented at 9:05 am on January 23, 2025: contributor

    I think they meant the p2p_1p1c_network failure at https://github.com/bitcoin/bitcoin/actions/runs/12917231673/job/36023158007?pr=31713

    Yes, that’s the one, thanks for finding it @l0rinc!

    Could you s/script/miniscript/ in the PR title to make it clear to reviewer this does not touch consensus critical stuff?

    Updated PR title and commit message titles.

  13. darosior commented at 3:36 pm on January 23, 2025: member

    From a quick skim, this looks fine to me. I wonder if @sipa has any objection to not using pointers here.

    Let me see if we can get the conflicts in first and then do this when nothing else is conflicting anymore.

  14. sipa commented at 5:07 pm on January 23, 2025: member

    Very rough-skim Concept ACK.

    This will make the code diverge further from the c++ miniscript policy compiler code, but that’s a bullet we already took with the shared_ptr to unique_ptr change, and it doesn’t seem there is development happening on that anyway.


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

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