aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2023-09-11 15:43:40 +1000
committerAnthony Towns <aj@erisian.com.au>2023-09-11 17:21:53 +1000
commit971bae9174293b79f1f29822d662b31a2ba62234 (patch)
treec307ec14de8d8f8f4b4d6518b61ff750ffe3115e
parentc5a63ea56f8347139bd84e1669b378ecfb234c3c (diff)
downloadbitcoin-971bae9174293b79f1f29822d662b31a2ba62234.tar.xz
rpc: Deprecate rpcserialversion=0
-rw-r--r--doc/release-notes-28448.md6
-rw-r--r--src/init.cpp6
-rwxr-xr-xtest/functional/feature_segwit.py1
3 files changed, 12 insertions, 1 deletions
diff --git a/doc/release-notes-28448.md b/doc/release-notes-28448.md
new file mode 100644
index 0000000000..d3ef8cf65b
--- /dev/null
+++ b/doc/release-notes-28448.md
@@ -0,0 +1,6 @@
+RPC
+---
+
+- Setting `-rpcserialversion=0` is deprecated and will be removed in
+ a future release. It can currently still be used by also adding
+ the `-deprecatedrpc=serialversion` option. (#28448)
diff --git a/src/init.cpp b/src/init.cpp
index f0847bd4f7..c025fb8ed8 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -618,7 +618,7 @@ void SetupServerArgs(ArgsManager& argsman)
argsman.AddArg("-rpccookiefile=<loc>", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
argsman.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC);
argsman.AddArg("-rpcport=<port>", strprintf("Listen for JSON-RPC connections on <port> (default: %u, testnet: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC);
- argsman.AddArg("-rpcserialversion", strprintf("Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)", DEFAULT_RPC_SERIALIZE_VERSION), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
+ argsman.AddArg("-rpcserialversion", strprintf("Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) (DEPRECATED) or segwit(1) (default: %d)", DEFAULT_RPC_SERIALIZE_VERSION), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
argsman.AddArg("-rpcservertimeout=<n>", strprintf("Timeout during HTTP requests (default: %d)", DEFAULT_HTTP_SERVER_TIMEOUT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC);
argsman.AddArg("-rpcthreads=<n>", strprintf("Set the number of threads to service RPC calls (default: %d)", DEFAULT_HTTP_THREADS), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
argsman.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC);
@@ -988,6 +988,10 @@ bool AppInitParameterInteraction(const ArgsManager& args)
if (args.GetIntArg("-rpcserialversion", DEFAULT_RPC_SERIALIZE_VERSION) > 1)
return InitError(Untranslated("Unknown rpcserialversion requested."));
+ if (args.GetIntArg("-rpcserialversion", DEFAULT_RPC_SERIALIZE_VERSION) == 0 && !IsDeprecatedRPCEnabled("serialversion")) {
+ return InitError(Untranslated("-rpcserialversion=0 is deprecated and will be removed in the future. Specify -deprecatedrpc=serialversion to allow anyway."));
+ }
+
// Also report errors from parsing before daemonization
{
kernel::Notifications notifications{};
diff --git a/test/functional/feature_segwit.py b/test/functional/feature_segwit.py
index 3ddf21ee5d..6c467fa613 100755
--- a/test/functional/feature_segwit.py
+++ b/test/functional/feature_segwit.py
@@ -89,6 +89,7 @@ class SegWitTest(BitcoinTestFramework):
[
"-acceptnonstdtxn=1",
"-rpcserialversion=0",
+ "-deprecatedrpc=serialversion",
"-testactivationheight=segwit@165",
"-addresstype=legacy",
],