diff --git a/doc/release-notes.md b/doc/release-notes.md --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -11,3 +11,12 @@ New RPC methods ------------ - `getnodeaddresses` returns peer addresses known to this node. It may be used to connect to nodes over TCP without using the DNS seeds. + + +Network upgrade +--------------- + +At the MTP time of 1589544000 (May 15, 2020 12:00:00 UTC) the following behaviors will change: + +- The default for max number of in-pool ancestors (`-limitancestorcount`) is changed from 25 to 50. +- The default for max number of in-pool descendants (`-limitdescendantcount`) is changed from 25 to 50. diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -743,8 +743,10 @@ true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-limitancestorcount=", strprintf("Do not accept transactions if number of in-mempool " - "ancestors is or more (default: %u)", - DEFAULT_ANCESTOR_LIMIT), + "ancestors is or more (pre-phonon-upgrade " + "default: %u, post-phonon-upgrade default: %u)", + DEFAULT_ANCESTOR_LIMIT, + DEFAULT_ANCESTOR_LIMIT_LONGER), true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-limitancestorsize=", @@ -755,8 +757,9 @@ gArgs.AddArg( "-limitdescendantcount=", strprintf("Do not accept transactions if any ancestor would have " - "or more in-mempool descendants (default: %u)", - DEFAULT_DESCENDANT_LIMIT), + "or more in-mempool descendants (default pre-phonon-upgrade: " + "%u, default post-phonon-upgrade: %u)", + DEFAULT_DESCENDANT_LIMIT, DEFAULT_DESCENDANT_LIMIT_LONGER), true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-limitdescendantsize=", diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -742,13 +742,15 @@ // Calculate in-mempool ancestors, up to a limit. CTxMemPool::setEntries setAncestors; - size_t nLimitAncestors = - gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT); + size_t nLimitAncestors = gArgs.GetArg( + "-limitancestorcount", + GetDefaultAncestorLimit(consensusParams, chainActive.Tip())); size_t nLimitAncestorSize = gArgs.GetArg("-limitancestorsize", DEFAULT_ANCESTOR_SIZE_LIMIT) * 1000; - size_t nLimitDescendants = - gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT); + size_t nLimitDescendants = gArgs.GetArg( + "-limitdescendantcount", + GetDefaultDescendantLimit(consensusParams, chainActive.Tip())); size_t nLimitDescendantSize = gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * diff --git a/test/functional/mempool_packages.py b/test/functional/mempool_packages.py --- a/test/functional/mempool_packages.py +++ b/test/functional/mempool_packages.py @@ -16,15 +16,29 @@ sync_mempools, ) -MAX_ANCESTORS = 25 -MAX_DESCENDANTS = 25 +# TODO: The activation code can be reverted after the new policy becomes +# active. + +# Phonon dummy activation time +ACTIVATION_TIME = 2000000000 + +# Replay protection time needs to be moved beyond phonon activation +REPLAY_PROTECTION_TIME = ACTIVATION_TIME * 2 + +MAX_ANCESTORS = 50 +MAX_DESCENDANTS = 50 class MempoolPackagesTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 2 - self.extra_args = [["-maxorphantx=1000"], - ["-maxorphantx=1000", "-limitancestorcount=5"]] + + common_params = ["-maxorphantx=1000", + "-phononactivationtime={}".format(ACTIVATION_TIME), + "-replayprotectionactivationtime={}".format(REPLAY_PROTECTION_TIME)] + + self.extra_args = [common_params, + common_params + ["-limitancestorcount=5"]] def skip_test_if_missing_module(self): self.skip_if_no_wallet() @@ -47,6 +61,8 @@ return (txid, send_value) def run_test(self): + [n.setmocktime(ACTIVATION_TIME) for n in self.nodes] + # Mine some blocks and have them mature. self.nodes[0].generate(101) utxo = self.nodes[0].listunspent(10)