Skip to content

Conversation

@sanket1729
Copy link
Contributor

Fixes #20009.

This PR consists of three commits.
First commit: Separates CLEANSTACK into WITNESS_CLEANSTACK and CLEANSTACK. See
#20006 (comment) for motivation.

Second commit: The stack size for witness programs was being explicitly resized to 1 to get around
CLEANSTACK check. This commits removes that logic and does some code cleanup. This commit
may require careful review to see if this does not change anything unintended.

Third commit: Refactor MINIMALIF to WITNESS_MINIMALIF and changes the error message.

The Tapscript related error codes were handled in #19953.

@sanket1729 sanket1729 changed the title split policy/error consensus codes for CLEANSTACK, MINAMALIF Script: split policy/error consensus codes for CLEANSTACK, MINAMALIF Oct 8, 2020
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 8, 2020

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

Conflicts

No conflicts as of last run.

@ysangkok
Copy link

@sanket1729 There is a typo in the PR title, it says "MINAMAL". It should be "MINIMAL"

@sanket1729 sanket1729 changed the title Script: split policy/error consensus codes for CLEANSTACK, MINAMALIF Script: split policy/error consensus codes for CLEANSTACK, MINIMALIF Oct 12, 2020
CleanStack rule is consensus enforced in Segwitv0.
See discussion in bitcoin#20006 for motivation
Change error code for MINIMALIF to WITNESS_MINIMALIF
to make it explicit that minimal if is only applicable
for witness programs
-The consensus rules for Segwit ensure that CleanStack
is followed. There is no need to set stack to size 1 and check
it again
- Replaced `cond == false` with a more idiomatic !cond
@achow101
Copy link
Member

Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened.

@achow101 achow101 closed this Oct 12, 2022
@maflcko
Copy link
Member

maflcko commented Oct 13, 2022

If this is closed, then #20009 should be closed as well?

@bitcoin bitcoin locked and limited conversation to collaborators Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

split policy/error consensus codes for CLEANSTACK, MINAMALIF

5 participants