totalFee argument is of questionable use, and should be removed in favor of feerate-based features.
I first moved IsDeprecatedRPCEnabled because bitcoin-wallet
doesn’t link libbitcoin_server
.
bumpfee
#15996
totalFee argument is of questionable use, and should be removed in favor of feerate-based features.
I first moved IsDeprecatedRPCEnabled because bitcoin-wallet
doesn’t link libbitcoin_server
.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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.
3252@@ -3253,20 +3253,20 @@ static UniValue bumpfee(const JSONRPCRequest& request)
3253 "\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n"
3254 "An opt-in RBF transaction with the given txid must be in the wallet.\n"
3255 "The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist.\n"
3256- "If `totalFee` is given, adding inputs is not supported, so there must be a single change output that is big enough or it will fail.\n"
3257+ "If `totalFee`(DEPRECATED) is given, adding inputs is not supported, so there must be a single change output that is big enough or it will fail.\n"
totalFee
and (DEPRECATED)
with a space?
3258 "All inputs in the original transaction will be included in the replacement transaction.\n"
3259 "The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
3260 "By default, the new fee will be calculated automatically using estimatesmartfee.\n"
3261 "The user can specify a confirmation target for estimatesmartfee.\n"
3262- "Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.\n"
3263+ "Alternatively, the user can specify totalFee(DEPRECATED), or use RPC settxfee to set a higher fee rate.\n"
3267 {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The txid to be bumped"},
3268 {"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "",
3269 {
3270 {"confTarget", RPCArg::Type::NUM, /* default */ "fallback to wallet's default", "Confirmation target (in blocks)"},
3271- {"totalFee", RPCArg::Type::NUM, /* default */ "fallback to 'confTarget'", "Total fee (NOT feerate) to pay, in satoshis.\n"
3272+ {"totalFee", RPCArg::Type::NUM, /* default */ "(DEPRECATED) fallback to 'confTarget'", "Total fee (NOT feerate) to pay, in satoshis.\n"
Perhaps display the deprecation similarly to EntryDescriptionString in src/rpc/blockchain.cpp:L387, e.g.:
0 {"totalFee", RPCArg::Type::NUM, /* default */ "fallback to 'confTarget'", "Total fee (NOT feerate) to pay, in satoshis (DEPRECATED).\n"
ACK 7ccf9dc2bd05caa0952c6e7ed438e9b265d808c1. Feel free to ignore the mentioned nits.
Tested beyond code review by compiling and verifying (1) bumpfee help output and (2) that all the wallet_bumpfee functional tests using totalFee
raise a JSONRPCException with the expected deprecation message when -deprecatedrpc=totalFee
is not passed:
test_small_output_fails
test_dust_to_fee
test_rebumping
test_rebumping_not_replaceable
test_change_script_match
The other subtests in wallet_bumpfee.py all still pass without -deprecatedrpc=totalFee
.
Instead of adding a new test why not update test/functional/wallet_bumpfee.py?
I began by doing that and found that this is cleaner, because for now the bumpfee tests need to use totalFee. Testing the deprecation separately makes sense. I also considered doing it in rpc_deprecated.py but this change only concerns an argument, not the rpc itself. When this is removed entirely it also seems easier to just have a separate test file to remove.
The spend_one_input
function in both bumpfee testfiles could be extracted, but since one of the two testfiles is destined be removed by 0.2.0 I’m not sure it’s worthwhile to do unless other test files could use that function.
Instead of adding a new test why not update test/functional/wallet_bumpfee.py?
When this is removed entirely it also seems easier to just have a separate test file to remove.
I agree. Adding a separate test for this deprecated option makes it very easy to remove when the deprecated option is removed.
ACK 59bc35c10386a4a58d7835d0a983fdde10eb2400 (reviewed code and run functional tests locally. No manual testing)
ACK reviewed code and ran functional tests locally. No manual tests.
One thing I do worry about with deprecating this is closing off the possibility of clients using alternative fee-rate estimation algorithms or techniques. Are there more details on why we think the value of this argument is questionable?
confTarget
is allowed right now.
totalFee
to me.
that’s an incredibly advances use-case
Yeah, you’re right. For a consumer-facing wallet (which is what Bitcoin Core wallet primarily is), fee-bumping child transactions is quite advanced.
327@@ -328,13 +328,6 @@ bool RPCIsInWarmup(std::string *outStatus)
328 return fRPCInWarmup;
329 }
330
331-bool IsDeprecatedRPCEnabled(const std::string& method)
3324@@ -3325,6 +3325,9 @@ static UniValue bumpfee(const JSONRPCRequest& request)
3325 } else if (options.exists("confTarget")) { // TODO: alias this to conf_target
3326 coin_control.m_confirm_target = ParseConfirmTarget(options["confTarget"], pwallet->chain().estimateMaxBlocks());
3327 } else if (options.exists("totalFee")) {
3328+ if (!IsDeprecatedRPCEnabled("totalFee")) {
rpcEnableDeprecated
instead of IsDeprecatedRPCEnabled
to support wallets running in different processes from the RPC server. The aren’t current examples of rpcEnableDeprecated
in use, but you can see the last one that was removed in b4338c151d4788c33f4b7c54daaf7f94b193a624
Next steps: remove `totalFee` from the wallet_bumpfee functional tests.
totalFee argument is of questionable use, and should be removed in favor of feerate-based features.
What are those feerate-based features? I couldn’t find any in bumpfee. It seems weird to remove a feature that is likely used, without replacement and without mention in the release notes.
totalFee argument is of questionable use, and should be removed in favor of feerate-based features.
What are those feerate-based features? I couldn’t find any in bumpfee. It seems weird to remove a feature that is likely used, without replacement and without mention in the release notes.
Currently working on this, see : #16492