Skip to content

Conversation

achow101
Copy link
Member

@achow101 achow101 commented Apr 15, 2020

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 #18627

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 15, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, 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.

@Sjors
Copy link
Member

Sjors commented Apr 22, 2020

Concept ACK. I wish there was a way to prevent duplicating walls of help text.

@maflcko
Copy link
Member

maflcko commented Apr 22, 2020

I wish there was a way to prevent duplicating walls of help text.

RPCHelpMan can not be duplicated because it takes the RPC method's name, but anything you pass to RPCHelpMan are basic C++11 structs that can be made const globals (or returned by helper functions like GetBumpFee{HelpText,Args,...}.) and then passed into the rpc help man.

Copy link
Member

@Sjors Sjors left a 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?

@achow101
Copy link
Member Author

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 bumpfee to be used and available only when the wallet is actually able to create a complete transaction and broadcast it. So for multisigs and coinjoin, it would not be available. For single signature hardware wallets, it should be, but can give a generic error about the device not being available.

psbtbumpfee is always available but also intended for use with wallets where bumpfee is not available.

@Sjors
Copy link
Member

Sjors commented Apr 24, 2020

Ok, that makes sense. Can you add some code comments around the bumpfee lines of code that need to be removed during deprecation (or wrap it in an if statement, even though that's currently redundant)? Maybe also clarify your intention in a source comment.

Copy link
Contributor

@promag promag left a 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.

Copy link
Member

@Sjors Sjors left a 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.

RPCHelpMan{"bumpfee",
bool want_psbt = request.strMethod == "psbtbumpfee";

RPCHelpMan{request.strMethod,
Copy link
Member

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@achow101
Copy link
Member Author

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:

That's interesting. I've added the wrapper as you suggested.

When a wallet has private keys, the PSBT isn't signed. That's either a bug or something to document.

I think this is existing behavior.

@Sjors
Copy link
Member

Sjors commented Jun 17, 2020

utACK 39d39f7

I think this is existing behavior.

Not really; if your wallet had private keys, it would never create a PSBT, signed or otherwise. But it can wait for another PR.

achow101 added 3 commits June 25, 2020 15:32
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.
@Sjors
Copy link
Member

Sjors commented Jul 6, 2020

re-utACK 79d6332

Copy link
Contributor

@meshcollider meshcollider left a 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.

@instagibbs
Copy link
Member

concept/approach ACK, these are advanced uses that can be adapted to easily.

t-bast added a commit to ACINQ/eclair that referenced this pull request Jul 27, 2020
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).
@luke-jr
Copy link
Member

luke-jr commented Aug 10, 2020

That's interesting. I've added the wrapper as you suggested.

Please at least add comments as to why it's there?

@achow101
Copy link
Member Author

That's interesting. I've added the wrapper as you suggested.

Please at least add comments as to why it's there?

Will do if I need to push again.

Copy link
Contributor

@fjahr fjahr left a 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,
Copy link
Contributor

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" : "") +
Copy link
Contributor

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.

Suggested change
+ 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" : "") +

@meshcollider meshcollider merged commit 8a85377 into bitcoin:master Aug 13, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 14, 2020
…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
luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Aug 15, 2020
…eid from bumpfee

Needed for psbtbumpfee to show in help

Github-Pull: bitcoin#18654
Rebased-From: 4638224
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants