-
Notifications
You must be signed in to change notification settings - Fork 37.7k
rpc: separate bumpfee's psbt creation function into psbtbumpfee #18654
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
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. |
Concept ACK. I wish there was a way to prevent duplicating walls of help text. |
|
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.
What's your vision for (future) descriptor wallets with private keys as e.g. part of a multisig setup (or a coinjoin)? Should those use psbtbumpfee
? And in the context of single signature hardware wallet setups, like #16546, can those still use bumpfee
, because PSBT is only used internally?
The idea is for
|
Ok, that makes sense. Can you add some code comments around the |
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.
Concept ACK. Could update doc/psbt.md. Needs release note tag.
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.
Reviewed 70e8422
psbtbumpfee
doesn't show up in the help list. You can fix that by adding a short wrapper and referencing that from CRPCCommand
, or perhaps @MarcoFalke has a better idea:
static UniValue psbtbumpfee(const JSONRPCRequest& request)
{
return bumpfee(request);
}
When a wallet has private keys, the PSBT isn't signed. That's either a bug or something to document.
src/wallet/rpcwallet.cpp
Outdated
RPCHelpMan{"bumpfee", | ||
bool want_psbt = request.strMethod == "psbtbumpfee"; | ||
|
||
RPCHelpMan{request.strMethod, |
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: fix pre-existing indentation (in separate commit)
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.
Done
That's interesting. I've added the wrapper as you suggested.
I think this is existing behavior. |
utACK 39d39f7
Not really; if your wallet had private keys, it would never create a PSBT, signed or otherwise. But it can wait for another PR. |
With psbtbumpfee, we can deprecate bumpfee's psbt creation behavior. So put that behind a -deprecatedrpc
Review this with -w to see that nothing actually changes.
re-utACK 79d6332 |
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 79d6332
I wouldn't call the lack of signing the PSBT a bug, but something to document maybe, sure.
concept/approach ACK, these are advanced uses that can be adapted to easily. |
Allow activating anchor outputs and have fully operating channels during normal operation (open, add/fulfill/fail htlcs, close). Interop testing has been done with lnd, and there is only one pending issue during mutual close, where they incorrectly compute the closing amounts, which they should fix soon. However, anchor outputs should NOT be activated yet as unilateral close scenario are not fully handled yet. We don't do any kind of automatic fee bumping either; this will be done later, once we have PSBT support and once bitcoind offers the `psbtbumpfee` RPC (see bitcoin/bitcoin#18654).
Please at least add comments as to why it's there? |
Will do if I need to push again. |
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 79d6332
Feel free to ignore my nits, maybe consider them for a follow-up.
@@ -3382,7 +3393,7 @@ static UniValue bumpfee(const JSONRPCRequest& request) | |||
|
|||
// If wallet private keys are enabled, return the new transaction id, |
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: This comment doesn't seem to fit here 100% anymore after the check for the wallet flag was moved forward.
"returned by getnetworkinfo) to enter the node's mempool.\n", | ||
RPCHelpMan{request.strMethod, | ||
"\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n" | ||
+ std::string(want_psbt ? "Returns a PSBT instead of creating and signing a new transaction.\n" : "") + |
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: Could be slightly improved if you have to retouch since the 'creating a new transaction' part is still true. It is just not signed and committed if I see that correctly.
+ std::string(want_psbt ? "Returns a PSBT instead of creating and signing a new transaction.\n" : "") + | |
+ std::string(want_psbt ? "Returns a PSBT with the new, unsigned transaction.\n" : "") + |
…nto psbtbumpfee 79d6332 moveonly: Fix indentation in bumpfee RPC (Andrew Chow) 431071c Hide bumpfee's psbt creation behavior behind -deprecatedrpc (Andrew Chow) 4638224 Add psbtbumpfee RPC (Andrew Chow) Pull request description: Adds a new RPC `psbtbumpfee` which always creates a psbt. `bumpfee` will then only be able to create and broadcast fee bumping transactions instead of changing its behavior based on `IsWalletSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)`. Split from bitcoin#18627 ACKs for top commit: Sjors: re-utACK 79d6332 meshcollider: utACK 79d6332 fjahr: Code review ACK 79d6332 Tree-SHA512: 1c92c4b4461bb30e78be3ee73165f624398ef33996ce36043b61a8931be667030d0fca12fd0b30097b78c56e4e9092c69582b237cbdac51d56f6be23d8c0f1bb
…eid from bumpfee Needed for psbtbumpfee to show in help Github-Pull: bitcoin#18654 Rebased-From: 4638224
Adds a new RPC
psbtbumpfee
which always creates a psbt.bumpfee
will then only be able to create and broadcast fee bumping transactions instead of changing its behavior based onIsWalletSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)
.Split from #18627