Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#28448: rpc: Deprecate rpcserialversion=0
Browse files Browse the repository at this point in the history
971bae9 rpc: Deprecate rpcserialversion=0 (Anthony Towns)

Pull request description:

  This option was introduced in #9194 to ease the transition to segwit; now that most libraries and apps have been updated it should no longer be necessary.

ACKs for top commit:
  MarcoFalke:
    review ACK 971bae9
  Randy808:
    Code Review ACK 971bae9
  glozow:
    ACK 971bae9, seems appropriate to remove. Thanks for looking at usage in bitcoin/bitcoin#28448 (comment)

Tree-SHA512: 6880314504281e9d7c288bd159f8cadefb3e653ac2dd148396810f7f5a27ba352ecfe720eb2dbc6172b57820cb9a2a254dcb2585881abae43811013505f0e09a
  • Loading branch information
fanquake committed Sep 12, 2023
2 parents fd69ffb + 971bae9 commit 578f50f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/release-notes-28448.md
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 5 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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{};
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_segwit.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def set_test_params(self):
[
"-acceptnonstdtxn=1",
"-rpcserialversion=0",
"-deprecatedrpc=serialversion",
"-testactivationheight=segwit@165",
"-addresstype=legacy",
],
Expand Down

0 comments on commit 578f50f

Please sign in to comment.