Skip to content

Conversation

sipa
Copy link
Member

@sipa sipa commented Oct 18, 2023

It's better practice to use Assume for non-critical assumptions made in the code. This is especially relevant for P2P-exposed functionality, which I don't believe is the case for miniscript, but still, use Assumes except in places where a crash or UB will be inevitable on a failed assert anyway.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 18, 2023

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/28678.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK laanwj, brunoerg

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:

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.

Copy link
Member

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those checks can be reached through the RPC interface or the wallet. In the unlikely scenario they are reached in a release build it would be better if they raise an exception instead of continuing silently. For instance if the type of the miniscript descriptor you imported was miscomputed for some reason you probably don't want to move forward and receive funds on it. Therefore i think it's better to use CHECK_NONFATAL?

@laanwj
Copy link
Member

laanwj commented Oct 31, 2023

Concept ACK. Not having these potentially crash the application is an improvement.
Also agree with @darosior though, we don't want error conditions that can be caused by user input to go by silently, either.

@maflcko
Copy link
Member

maflcko commented Feb 22, 2024

Are you still working on this?

@DrahtBot DrahtBot marked this pull request as draft April 18, 2024 07:09
@DrahtBot
Copy link
Contributor

Converted to draft due to inactivity

@DrahtBot
Copy link
Contributor

🤔 There hasn't been much activity lately and the CI seems to be failing.

If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn't been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in.

1 similar comment
@DrahtBot
Copy link
Contributor

🤔 There hasn't been much activity lately and the CI seems to be failing.

If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn't been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in.

@maflcko
Copy link
Member

maflcko commented Oct 15, 2024

@sipa @darosior It would be good to mark this as up-for-grabs, if you dropped working on it.

@DrahtBot
Copy link
Contributor

🤔 There hasn't been much activity lately and the CI seems to be failing.

If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn't been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in.

@brunoerg
Copy link
Contributor

Concept ACK

@sipa @darosior It would be good to mark this as up-for-grabs, if you dropped working on it.

Any update on it?

@sipa
Copy link
Member Author

sipa commented Jan 23, 2025

Closing and marking as up for grabs.

@sipa sipa closed this Jan 23, 2025
@darosior
Copy link
Member

I'll open a PR on top of master which implements my suggestion.

glozow added a commit that referenced this pull request Apr 10, 2025
ff0194a miniscript: convert non-critical asserts to CHECK_NONFATAL (Antoine Poinsot)

Pull request description:

  The Miniscript code contains assertions to prevent ending up in an insane state or prevent UB, but also to enforce logical invariants. For the latter it is not necessary to crash the program if they are broken. Raising an exception suffices, especially as this code is often called through the RPC interface which can in turn handle the exception and the user can report it to developers.

  This revives #28678 from Pieter Wuille.

ACKs for top commit:
  hodlinator:
    ACK ff0194a
  TheCharlatan:
    ACK ff0194a
  brunoerg:
    code review ACK ff0194a

Tree-SHA512: 8ed8f7b494e46ecf7cdebe75120cd0ffe543b6bc289bf882dac631fe2ec2cae590d5f7bc2316e52db085791694b136dffbc71c40c1e16886fa53ab00bd8cabd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants