diff --git a/doc/book/src/user/deprecation.md b/doc/book/src/user/deprecation.md index f0c55da38..b6427da87 100644 --- a/doc/book/src/user/deprecation.md +++ b/doc/book/src/user/deprecation.md @@ -69,3 +69,10 @@ The following features are disabled by default, and will be removed in release 5 - `zcrawreceive` - The `zcrawreceive` RPC method is disabled. - `zcrawjoinsplit` - The `zcrawjoinsplit` RPC method is disabled. - `zcrawkeygen` - The `zcrawkeygen` RPC method is disabled. + +### Disabled in 5.0.1 + +The following features are disabled by default, and will be removed in release 5.3.0. + + - `dumpwallet` - The `dumpwallet` RPC method is disabled. + diff --git a/doc/release-notes.md b/doc/release-notes.md index 33ed969d0..313ab5e8c 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -14,3 +14,14 @@ Option handling whenever the transaction does not contain Orchard components. This can be helpful if recipients of transactions are likely to be using legacy wallets that have not yet been upgraded to support parsing V5 transactions. + +Deprecated +---------- + +As of this release, the following previously deprecated features are disabled +by default, but may be be reenabled using `-allowdeprecated=`. + + - The `dumpwallet` RPC method is disabled. It may be reenabled with + `allowdeprecated=dumpwallet`. `dumpwallet` should not be used; it is + unsafe for backup purposes as it does not return any key information + for keys used to derive shielded addresses. Use `z_exportwallet` instead. diff --git a/qa/rpc-tests/walletbackup.py b/qa/rpc-tests/walletbackup.py index 15c30922d..ac8994a3c 100755 --- a/qa/rpc-tests/walletbackup.py +++ b/qa/rpc-tests/walletbackup.py @@ -64,7 +64,12 @@ class WalletBackupTest(BitcoinTestFramework): ed2 = "-exportdir=" + self.options.tmpdir + "/node2" # nodes 1, 2,3 are spenders, let's give them a keypool=100 - extra_args = [["-keypool=100", ed0], ["-keypool=100", ed1], ["-keypool=100", ed2], []] + extra_args = [ + ["-keypool=100", ed0, "-allowdeprecated=dumpwallet"], + ["-keypool=100", ed1, "-allowdeprecated=dumpwallet"], + ["-keypool=100", ed2, "-allowdeprecated=dumpwallet"], + [] + ] self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args) connect_nodes(self.nodes[0], 3) connect_nodes(self.nodes[1], 3) diff --git a/src/deprecation.cpp b/src/deprecation.cpp index e1e9d3d43..ad91f19dc 100644 --- a/src/deprecation.cpp +++ b/src/deprecation.cpp @@ -24,6 +24,7 @@ bool fEnableZCRawReceive = true; bool fEnableZCRawJoinSplit = true; bool fEnableZCRawKeygen = true; bool fEnableAddrTypeField = true; +bool fEnableDumpWallet = true; #endif static const std::string CLIENT_VERSION_STR = FormatVersion(CLIENT_VERSION); @@ -105,6 +106,7 @@ std::optional SetAllowedDeprecatedFeaturesFromCLIArgs() { fEnableZCRawJoinSplit = allowdeprecated.count("zcrawjoinsplit") > 0; fEnableZCRawKeygen = allowdeprecated.count("zcrawkeygen") > 0; fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0; + fEnableDumpWallet = allowdeprecated.count("dumpwallet") > 0; #endif return std::nullopt; diff --git a/src/deprecation.h b/src/deprecation.h index f904793c4..cd84c850a 100644 --- a/src/deprecation.h +++ b/src/deprecation.h @@ -38,9 +38,10 @@ static const std::set DEFAULT_ALLOW_DEPRECATED{{ }}; static const std::set DEFAULT_DENY_DEPRECATED{{ #ifdef ENABLE_WALLET + "dumpwallet", "zcrawreceive", "zcrawjoinsplit", - "zcrawkeygen", + "zcrawkeygen" #endif }}; @@ -57,6 +58,7 @@ extern bool fEnableZCRawReceive; extern bool fEnableZCRawJoinSplit; extern bool fEnableZCRawKeygen; extern bool fEnableAddrTypeField; +extern bool fEnableDumpWallet; #endif /** diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 7349b8a87..69e1f804d 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -549,6 +549,13 @@ UniValue dumpwallet(const UniValue& params, bool fHelp) if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; + if (!fEnableDumpWallet) + throw runtime_error( + "dumpwallet is DEPRECATED and will be removed in a future release\n" + "\nUse z_exportwallet instead, or restart with `-allowdeprecated=dumpwallet`\n" + "if you require backward compatibility.\n" + "See https://zcash.github.io/zcash/user/deprecation.html for more information."); + if (fHelp || params.size() != 1) throw runtime_error( "dumpwallet \"filename\"\n"