-
Notifications
You must be signed in to change notification settings - Fork 37.7k
rpc, gui: bumpfee signer support #21576
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
Conversation
I'm not tremendously excited by this approach of overloading |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
e4818a6
to
0c0d293
Compare
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.
utACK 0c0d293
src/wallet/rpcwallet.cpp
Outdated
@@ -3521,16 +3521,39 @@ static RPCHelpMan bumpfee_helper(std::string method_name) | |||
// If wallet private keys are enabled, return the new transaction id, | |||
// otherwise return the base64-encoded unsigned PSBT of the new transaction. |
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.
Do the merged changes in #22021 need to be updated with this pull?
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.
I'll do a rebase and also address the nits above.
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.
For now these comments are correct. In a multisig setup bumpfee
will throw "Transaction incomplete. Try psbtbumpfee instead."
(which in turn won't call the external signer). We can improve that later.
Rebased, addressed comments and added a test. |
0c0d293
to
dda02ce
Compare
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.
re-utACK dda02ce
dda02ce
to
c7e4cc0
Compare
Oops, fixed. |
ACK d5f720f |
Rebased after bitcoin-core/gui#441, though not tested yet. |
d5f720f
to
ea8f5db
Compare
src/wallet/rpc/spend.cpp
Outdated
pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, false, true); | ||
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, true, false); | ||
pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /* sign */ false, /* bip32derivs */ true); | ||
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /* sign */ true, /* bip32derivs */ false); |
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.
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /* sign */ true, /* bip32derivs */ false); | |
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /*sign=*/true, /*bip32derivs=*/false); |
& other such changes
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.
Fixed (after the rebase moved everything around)
ea8f5db
to
3e25b8e
Compare
Rebased, but for the GUI to work I first need to apply the same change as bitcoin-core/gui#555 |
3e25b8e
to
ed5538e
Compare
Ok, it works again now. |
Specifically this enables the Send button in the fee bump dialog for wallets with external signer support. Similar to 2efdfb8.
ed5538e
to
2c07cfa
Compare
Github-Pull: bitcoin#21576 Rebased-From: 7e02a33
Specifically this enables the Send button in the fee bump dialog for wallets with external signer support. Similar to 2efdfb8. Github-Pull: bitcoin#21576 Rebased-From: 2c07cfa
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.
code review ACK 2c07cfa
// Make a blank psbt | ||
PartiallySignedTransaction psbtx(mtx); | ||
|
||
// First fill transaction with our data without signing, | ||
// so external signers are not asked to sign more than once. | ||
bool complete; | ||
wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, false /* sign */, true /* bip32derivs */); | ||
const TransactionError err = wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, true /* sign */, false /* bip32derivs */); | ||
if (err != TransactionError::OK) return false; | ||
complete = FinalizeAndExtractPSBT(psbtx, mtx); | ||
return complete; |
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: as this is the same code that we have in "rpc/send" --> FinishTransaction
, could decouple it into a new function and use it from both sides.
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.
I looked into deduplicating the part where we fill without signing and then call fill, but it's not that easy. The following doesn't work: Sjors@5d55117 (because it won't add the bip32 info for some reason)
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.
Approach ACK
I was able to successfully sign for a fee increase on my external signer. Want to continue to do more testing.
ACK 2c07cfa |
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.
tACK 2c07cfa
I have tested and reviewed the code and agree it can be merged.
2c07cfa gui: bumpfee signer support (Sjors Provoost) 7e02a33 rpc: bumpfee signer support (Sjors Provoost) 304ece9 rpc: document bools in FillPSBT() calls (Sjors Provoost) Pull request description: The `bumpfee` RPC call and GUI fee bump interface now work with an external signer. ACKs for top commit: achow101: ACK 2c07cfa furszy: code review ACK 2c07cfa jarolrod: tACK 2c07cfa Tree-SHA512: 0c7b931f76fac67c9e33b9b935f29af6f69ac67a5ffcc586ed2f1676feac427735b1d971723b29ef332bb6fb5762949598ebbf728587e8f0ded95a9bfbb3e7a4
The
bumpfee
RPC call and GUI fee bump interface now work with an external signer.