From 0b4048c73385166144d0b3e76beb9a2ac4cc1eca Mon Sep 17 00:00:00 2001 From: Greg Sanders Date: Fri, 2 May 2025 10:49:14 -0400 Subject: [PATCH] datacarrier: deprecate startup arguments for future removal --- src/init.cpp | 8 ++++++-- test/functional/mempool_datacarrier.py | 11 +++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 629d612abd2..39ce7d53736 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -630,9 +630,9 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) argsman.AddArg("-dustrelayfee=", strprintf("Fee rate (in %s/kvB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY); argsman.AddArg("-acceptstalefeeestimates", strprintf("Read fee estimates even if they are stale (%sdefault: %u) fee estimates are considered stale if they are %s hours old", "regtest only; ", DEFAULT_ACCEPT_STALE_FEE_ESTIMATES, Ticks(MAX_FILE_AGE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY); - argsman.AddArg("-datacarrier", strprintf("Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY); + argsman.AddArg("-datacarrier", strprintf("(DEPRECATED) Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY); argsman.AddArg("-datacarriersize", - strprintf("Relay and mine transactions whose data-carrying raw scriptPubKeys in aggregate " + strprintf("(DEPRECATED) Relay and mine transactions whose data-carrying raw scriptPubKeys in aggregate " "are of this size or less, allowing multiple outputs (default: %u)", MAX_OP_RETURN_RELAY), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY); @@ -875,6 +875,10 @@ bool AppInitParameterInteraction(const ArgsManager& args) InitWarning(_("Option '-checkpoints' is set but checkpoints were removed. This option has no effect.")); } + if (args.IsArgSet("-datacarriersize") || args.IsArgSet("-datacarrier")) { + InitWarning(_("Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version.")); + } + // Error if network-specific options (-addnode, -connect, etc) are // specified in default section of config file, but not overridden // on the command line or in this chain's section of the config file. diff --git a/test/functional/mempool_datacarrier.py b/test/functional/mempool_datacarrier.py index 0613b52b491..8eab4ce6b28 100755 --- a/test/functional/mempool_datacarrier.py +++ b/test/functional/mempool_datacarrier.py @@ -89,6 +89,17 @@ class DataCarrierTest(BitcoinTestFramework): self.test_null_data_transaction(node=self.nodes[2], data=one_byte, success=True) self.test_null_data_transaction(node=self.nodes[3], data=one_byte, success=False) + # Clean shutdown boilerplate due to deprecation + self.expected_stderr = [ + "", # node 0 has no deprecated options + "Warning: Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version.", + "Warning: Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version.", + "Warning: Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in a future version.", + ] + + for i in range(self.num_nodes): + self.stop_node(i, expected_stderr=self.expected_stderr[i]) + if __name__ == '__main__': DataCarrierTest(__file__).main()