-
Notifications
You must be signed in to change notification settings - Fork 725
Upstream scripts back ports [Step 1] #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream scripts back ports [Step 1] #1693
Conversation
coming from btc@627b9deff4e8e18fc6d001b6eb9818c13c648820
- [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard coming from btc@9238ecb41752e097443d0bc117df35ebd4ac932e
Previously unlike other transaction types the TX_SCRIPTHASH would not clear vSolutionsRet, which means that unlike other transaction types if it was called twice in a row you would get the result of the previous invocation as well.
Previously this was an inline test where the specificity was probably judged overly specific. As a class method it makes sense to maintain consistency. And replace some magic values with their constant equivalents. Excludes changes to the following functions we don't have: - ExtractPubKey (bitcoin#6415) - IsCompressedPubKey (bitcoin#8499)
The current code contains a rather complex script template matching engine, which is only used for 3 particular script types (P2PK, P2PKH, multisig). The first two of these are trivial to match for otherwise, and a specialized matcher for multisig is both more compact and more efficient than a generic one. The goal is being more flexible, so that for example larger standard multisigs inside SegWit outputs are more easy to implement. As a side-effect, it also gets rid of the pseudo opcodes hack. coming from btc@c814e2e7e81fd01fcb07f4a28435741bdc463801
01d894b to
c3abcf3
Compare
71074f4 to
5d96c91
Compare
random-zebra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. ACK 5d96c91
Fuzzbawls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5d96c91
small nit that can be addressed later
| #include "util.h" | ||
| #include "utilstrencodings.h" | ||
|
|
||
| #include <boost/foreach.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: un-necessary header include
…alleability vector ccff44f Test LowS in standardness, removes nuisance malleability vector. (furszy) Pull request description: On top of #1693 (only last commit matter for this PR). Lot of fruitful information can be found in bitcoin#6769 . > This adds SCRIPT_VERIFY_LOW_S to STANDARD_SCRIPT_VERIFY_FLAGS which > will make the node require the canonical 'low-s' encoding for > ECDSA signatures when relaying or mining. > Absent this kind of test ECDSA is not a strong signature as given > a valid signature {r, s} both that value and {r, -s mod n} are valid. > These two encodings have different hashes allowing third parties a > vector to change users txids. These attacks are avoided by picking > a particular form as canonical and rejecting the other form(s); in > the of the LOW_S rule, the smaller of the two possible S values is > used. ACKs for top commit: random-zebra: utACK ccff44f Fuzzbawls: ACK ccff44f Tree-SHA512: abcd28e9eab04719480f7f3d8fafcaa9aa46cb52278c42211becde6537066a67fc0be340b6f3b1457efc5543053097d77682cd3c3c09f5dd931d0762cd5e9229
Coming from the following PRs (with small customizations for our features):