rpc: Only allow specific types to be P2(W)SH wrapped in decodescript#23486
rpc: Only allow specific types to be P2(W)SH wrapped in decodescript#23486laanwj merged 1 commit intobitcoin:masterfrom
Conversation
8888154 to
fa95a43
Compare
|
Concept ACK. For slightly easier review, maybe split into a pure refactor/reformat commit and the actual behavior change. |
|
If you pass in |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
|
I agree with @Sjors here. I think it makes sense to split the functionality change into a separate commit. Even if it can still be reviewed by providing extra arguments to diff, it just seems cleaner, say, when browsing git history later. Does this need a functional test? |
fa95a43 to
fa1c1f4
Compare
|
Code review re-ACK fa972d8d771c93c1d37eeb31da04e95e8e5ca0ad |
There are steps to test in the first comment, but I am happy to add a commit with tests if someone writes them. I am also happy to review a pull if someone adds them after merge. |
|
tACK fa1c1f417ef97d15331f4a13b40be9e00ecdb464 |
fa1c1f4 to
faa8ea8
Compare
faa8ea8 to
b9cc200
Compare
fa827d2 to
fa972d8
Compare
|
Reworked and updated pull request description |
|
We may also need to check that no OP_CHECKSIGADD opcodes occur in a script before reporting a P2WSH for it. |
And OP_SUCCESSx too |
fa972d8 to
fa20010
Compare
And unparseable, and unspendable scripts. |
achow101
left a comment
There was a problem hiding this comment.
Even without the two issues mentioned below, it seems that decodescript is unable to decode scripts containing OP_CHECKSIGADD and OP_SUCCESSx. But I think fixing those would be out of scope for this PR.
2e26400 to
faa1b5e
Compare
|
Force pushed to fix a "typo" 😖 and updated OP to include more tests. |
faa1b5e to
fa0aec3
Compare
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
Isn't it TBD if future witnesses can be wrapped? Though maybe too unlikely to matter...
There was a problem hiding this comment.
It is possible but unlikely. In that case you need to upgrade to a version of Bitcoin Core that "understands" the witness program to wrap it.
fa0aec3 to
fabf3d0
Compare
fadc110 to
fad77aa
Compare
fad77aa to
9999342
Compare
|
Rebased to add tests ✨ |
|
Code review re-ACK 9999342 |
| [ | ||
| "6aee", | ||
| { | ||
| "asm": "OP_RETURN OP_UNKNOWN", |
There was a problem hiding this comment.
(not in this PR) it would be nice to have some test entries that do give segwit output
…W)SH wrapped in decodescript 086d811 rpc: Only allow specific types to be P2(W)SH wrapped in decodescript (MarcoFalke) Pull request description: It seems confusing to return a P2SH wrapping address that is eventually either policy- or consensus-unspendable. ACKs for top commit: laanwj: Code review re-ACK 086d811 Tree-SHA512: 3cd530442acee7c295d244995f0f17b2cae7212f1e0970bb5807621f8ff8e4308a3236b385d77087cd493d32ee524813d8edd15e91d937ef9a800094b7bc4946
It seems confusing to return a P2SH wrapping address that is eventually either policy- or consensus-unspendable.