-
Notifications
You must be signed in to change notification settings - Fork 38.7k
PSBT backports to 0.17 #14780
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
PSBT backports to 0.17 #14780
Conversation
|
Concept ACK |
|
ACK on my changes appearing correctly-included. |
|
nit: Are these cherry-picks? It might help to include the id they were cherry-picked from. See for example https://github.com/bitcoin-core/bitcoin-maintainer-tools#backport which might do just that (haven't tried it) |
|
@MarcoFalke I created it by taking the merged #14588, rebasing it on top of the 0.17 branch, and removing all the commits except the ones from the 3 PRs listed in the description. Some commits needed nontrivial changes to work on top of the 0.17 (which lacks some of the refactors that happened in master). They're not clean cherry-picks. Is there any marker or tag I need to put on the PR or commits so it gets picked up by the release notes scripts? |
yes: |
e811578 to
819c7a8
Compare
|
Rebased. |
Github-Pull: bitcoin#14377 Rebased-From: 4fb3388
Use .str() instead of .data() and .size() when converting CDataStream to a string. Uses std::string, avoiding conversion to a C string. Github-Pull: bitcoin#14588 Rebased-From: fe5d22b
Github-Pull: bitcoin#14588 Rebased-From: 4f3f5cb
New constructor that creates a PartiallySignedTransaction from a CTransaction, automatically sizing the inputs and outputs vectors for convenience. Github-Pull: bitcoin#14588 Rebased-From: 65166d4
Refactor out a "PSBTInputSigned" function to check if a PSBT is signed, for use in subsequent commits. Also improve a related comment. GitHub-Pull: bitcoin#14588 Rebased-From: 53e6fff
Remove redundant arguments to SignPSBTInput -- since it needs several bits of the PartiallySignedTransaction, pass in a reference instead of doing it piecemeal. This saves us having to pass in both a PSBTInput and its index, as well as having to pass in the CTransaction. Also avoid redundantly passing the sighash_type, which is contained in the PSBTInput already. Github-Pull: bitcoin#14588 Rebased-From: 0f5bda2
Refactor the process of PSBTInput signing to enforce the invariant that a PSBTInput always has _either_ a witness_utxo or a non_witness_utxo, never both. This simplifies the logic of SignPSBTInput slightly, since it no longer has to deal with the "both" case. When calling it, we now give it, in order of preference: (1) whichever of the utxo fields was already present in the PSBT we received, or (2) if neither, the non_witness_utxo field, which is just a copy of the input transaction, which we get from the wallet. SignPSBTInput no longer has to remove one of the two fields; instead, it will check if we have a witness signature, and if so, it will replace the non_witness_utxo with the witness_utxo (which is smaller, as it is just a copy of the output being spent.) Add PSBTInput::IsSane checks in two more places, which checks for both utxo fields being present; we will now give an RPC error early on if we are supplied such a malformed PSBT to fill in. Also add a check to FillPSBT, to avoid touching any input that is already signed. (This is now redundant, since we should no longer potentially harm an already-signed input, but it's harmless.) fixes bitcoin#14473 Github-Pull: bitcoin#14588
Github-Pull: bitcoin#14588 Rebased-From: e13fea9
Github-Pull: bitcoin#14197 Rebased-From: 862d159
819c7a8 to
7bee414
Compare
|
Added Github-Pull: and Rebased-From: annotations |
|
kinda tested ACK. |
|
tACK 7bee414 I reviewed it along side with the originals, which I hadn't seen before, so that's a fresh perspective :-) |
|
utACK 7bee414 |
7bee414 Add test for conversion from non-witness to witness UTXO (Pieter Wuille) ff56bb9 Add regression test for PSBT signing bug #14473 (Glenn Willen) db445d4 Refactor PSBTInput signing to enforce invariant (Glenn Willen) ad94165 Simplify arguments to SignPSBTInput (Glenn Willen) 39ece4f Add bool PSBTInputSigned (Glenn Willen) 70ee1f8 New PartiallySignedTransaction constructor from CTransction (Glenn Willen) a9eab08 Remove redundant txConst parameter to FillPSBT (Glenn Willen) cfdd6b2 More concise conversion of CDataStream to string (Glenn Willen) a3fe125 check that a separator is found for psbt inputs, outputs, and global map (Andrew Chow) Pull request description: This is a backport of #14588, #14377, and #14197's test to 0.17. Tree-SHA512: 07535ec69a878a63b549e5e463345e233f34662dff805202614cf2ffc896c6d1981363e6d06d02db2e02d815075ad8ebdc5f93f637052cff8c8cbe6c8dfa096a
|
ACK 7bee414, indeed not a clean rebase, at least for me |
This is a backport of #14588, #14377, and #14197's test to 0.17.