Merge bitcoin/bitcoin#36488: rpc: wallet: Schedule mixed-case confTarget option deprecation
What changed, and why it matters
This commit is a routine cleanup, not a security fix. It removes support for an old, confusingly-named option ('confTarget') in two Bitcoin wallet commands (bumpfee and psbtbumpfee), leaving only the clearer 'conf_target' name unless the user explicitly turns the old name back on with a special startup flag. The change is documented in release notes and tested.
No security action needed. Users and integrators should migrate from 'confTarget' to 'conf_target' in bumpfee/psbtbumpfee calls before the alias is removed in the next release.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deprecates the mixed-case ‘confTarget’ option in bumpfee_helper in src/wallet/rpc/spend.cpp. The option now requires -deprecatedrpc=confTarget; otherwise an RPC_METHOD_DEPRECATED error is thrown. It also adds functional tests verifying the deprecation error and updates wallet_bumpfee.py to keep the old alias enabled for existing tests. No vulnerability is fixed or introduced.
Changed components
src/wallet/rpc/spend.cpp (bumpfee_helper)doc/release-notes-36488.mdtest/functional/rpc_deprecated.pytest/functional/wallet_bumpfee.pyInspect captured patch +24 / −3
### doc/release-notes-36488.md
@@ -0,0 +1,8 @@
+Updated RPCs
+------------
+
+The deprecated `confTarget` option of the `bumpfee` and `psbtbumpfee` RPCs is
+now available only when the RPC server is started with
+`-deprecatedrpc=confTarget`.
+Use `conf_target` instead. The `confTarget` option will be removed in the next
+release. (#36488)
### src/wallet/rpc/spend.cpp
@@ -1065,7 +1065,7 @@ static RPCMethod bumpfee_helper(std::string method_name)
UniValue options = request.params[1];
RPCTypeCheckObj(options,
{
- {"confTarget", UniValueType(UniValue::VNUM)},
+ {"confTarget", UniValueType(UniValue::VNUM)}, // Deprecated, undocumented alias.
{"conf_target", UniValueType(UniValue::VNUM)},
{"fee_rate", UniValueType()}, // will be checked by AmountFromValue() in SetFeeEstimateMode()
{"replaceable", UniValueType(UniValue::VBOOL)},
@@ -1076,6 +1076,10 @@ static RPCMethod bumpfee_helper(std::string method_name)
},
true, true);
+ if (options.exists("confTarget") && !pwallet->chain().rpcEnableDeprecated("confTarget")) {
+ throw JSONRPCError(RPC_METHOD_DEPRECATED, "DEPRECATION WARNING: Use conf_target (confTarget is deprecated and will be removed in the next release). To use it, start the RPC server with the `-deprecatedrpc=confTarget`.");
+ }
+
if (options.exists("confTarget") && options.exists("conf_target")) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "confTarget and conf_target options should not both be set. Use conf_target (confTarget is deprecated).");
}
### test/functional/rpc_deprecated.py
@@ -4,6 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
+from test_framework.util import assert_raises_rpc_error
class DeprecatedRpcTest(BitcoinTestFramework):
@@ -25,9 +26,16 @@ def run_test(self):
# at least one other functional test that still tests the RPCs
# functionality using the respective -deprecatedrpc flag.
- # Please don't delete nor modify this comment
+ # Please don't delete nor modify the comments and the boilerplate setup
self.log.info("Tests for deprecated RPC methods (if any)")
- self.log.info("Currently no tests for deprecated RPC methods")
+ if self.is_wallet_compiled():
+ self.log.info("Tests for deprecated wallet-related RPC methods (if any)")
+ self.nodes[0].createwallet("wtest")
+ wallet = self.nodes[0].get_wallet_rpc("wtest") # Keep this setup, even if unused
+
+ self.log.info("Test confTarget option deprecation")
+ for rpc in (wallet.bumpfee, wallet.psbtbumpfee):
+ assert_raises_rpc_error(-32, "start the RPC server with the `-deprecatedrpc=confTarget`", rpc, "0" * 64, {"confTarget": 1})
if __name__ == '__main__':
### test/functional/wallet_bumpfee.py
@@ -61,6 +61,7 @@ def set_test_params(self):
self.extra_args = [[
"-mintxfee=0.00002",
"-addresstype=bech32",
+ "-deprecatedrpc=confTarget",
] for i in range(self.num_nodes)]
def skip_test_if_missing_module(self):Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.