Skip to content

Commit 971bae9

Browse files
committed
rpc: Deprecate rpcserialversion=0
1 parent c5a63ea commit 971bae9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

doc/release-notes-28448.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RPC
2+
---
3+
4+
- Setting `-rpcserialversion=0` is deprecated and will be removed in
5+
a future release. It can currently still be used by also adding
6+
the `-deprecatedrpc=serialversion` option. (#28448)

src/init.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ void SetupServerArgs(ArgsManager& argsman)
618618
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);
619619
argsman.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC);
620620
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);
621-
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);
621+
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);
622622
argsman.AddArg("-rpcservertimeout=<n>", strprintf("Timeout during HTTP requests (default: %d)", DEFAULT_HTTP_SERVER_TIMEOUT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC);
623623
argsman.AddArg("-rpcthreads=<n>", strprintf("Set the number of threads to service RPC calls (default: %d)", DEFAULT_HTTP_THREADS), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
624624
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)
988988
if (args.GetIntArg("-rpcserialversion", DEFAULT_RPC_SERIALIZE_VERSION) > 1)
989989
return InitError(Untranslated("Unknown rpcserialversion requested."));
990990

991+
if (args.GetIntArg("-rpcserialversion", DEFAULT_RPC_SERIALIZE_VERSION) == 0 && !IsDeprecatedRPCEnabled("serialversion")) {
992+
return InitError(Untranslated("-rpcserialversion=0 is deprecated and will be removed in the future. Specify -deprecatedrpc=serialversion to allow anyway."));
993+
}
994+
991995
// Also report errors from parsing before daemonization
992996
{
993997
kernel::Notifications notifications{};

test/functional/feature_segwit.py

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def set_test_params(self):
8989
[
9090
"-acceptnonstdtxn=1",
9191
"-rpcserialversion=0",
92+
"-deprecatedrpc=serialversion",
9293
"-testactivationheight=segwit@165",
9394
"-addresstype=legacy",
9495
],

0 commit comments

Comments
 (0)