diff --git a/doc/release-notes.md b/doc/release-notes.md index 5ce2a9d66..c4faf2646 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -13,14 +13,14 @@ transactions. This is achieved by keeping track of and limiting the total `cost` and `evictionWeight` of all transactions in the mempool. The `cost` of a transaction is determined by its size in bytes, and its `evictionWeight` is a function of the transaction's `cost` and its fee. The maximum total cost is -configurable via the parameter `mempool.tx_cost_limit` which defaults to +configurable via the parameter `mempooltxcostlimit` which defaults to 80,000,000 (up to 20,000 txs). If a node's total mempool `cost` exceeds this limit the node will evict a random transaction, preferentially picking larger transactions and ones with below the standard fee. To prevent a node from re-accepting evicted transactions, it keeps track of ones that it has evicted recently. By default, a transaction will be considered recently evicted for 60 minutes, but this can be configured with the parameter -`mempool.eviction_memory_minutes`. +`mempoolevictionmemoryminutes`. For full details see ZIP 401. diff --git a/qa/rpc-tests/mempool_limit.py b/qa/rpc-tests/mempool_limit.py index 1c424a47a..918c61414 100755 --- a/qa/rpc-tests/mempool_limit.py +++ b/qa/rpc-tests/mempool_limit.py @@ -26,11 +26,11 @@ class MempoolLimit(BitcoinTestFramework): def setup_nodes(self): extra_args = [ - ["-debug=mempool", '-mempool.tx_cost_limit=8000'], # 2 transactions at min cost - ["-debug=mempool", '-mempool.tx_cost_limit=8000'], # 2 transactions at min cost - ["-debug=mempool", '-mempool.tx_cost_limit=8000'], # 2 transactions at min cost + ["-debug=mempool", '-mempooltxcostlimit=8000'], # 2 transactions at min cost + ["-debug=mempool", '-mempooltxcostlimit=8000'], # 2 transactions at min cost + ["-debug=mempool", '-mempooltxcostlimit=8000'], # 2 transactions at min cost # Let node 3 hold one more transaction - ["-debug=mempool", '-mempool.tx_cost_limit=12000'], # 3 transactions at min cost + ["-debug=mempool", '-mempooltxcostlimit=12000'], # 3 transactions at min cost ] return start_nodes(4, self.options.tmpdir, extra_args) diff --git a/src/init.cpp b/src/init.cpp index 11d956551..240396563 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -384,8 +384,8 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-maxconnections=", strprintf(_("Maintain at most connections to peers (default: %u)"), DEFAULT_MAX_PEER_CONNECTIONS)); strUsage += HelpMessageOpt("-maxreceivebuffer=", strprintf(_("Maximum per-connection receive buffer, *1000 bytes (default: %u)"), 5000)); strUsage += HelpMessageOpt("-maxsendbuffer=", strprintf(_("Maximum per-connection send buffer, *1000 bytes (default: %u)"), 1000)); - strUsage += HelpMessageOpt("-mempool.eviction_memory_minutes=", strprintf(_("The number of minutes before allowing rejected transactions to re-enter the mempool. (default: %u)"), DEFAULT_MEMPOOL_EVICTION_MEMORY_MINUTES)); - strUsage += HelpMessageOpt("-mempool.tx_cost_limit=",strprintf(_("An upper bound on the maximum size in bytes of all transactions in the mempool. (default: %s)"), DEFAULT_MEMPOOL_TOTAL_COST_LIMIT)); + strUsage += HelpMessageOpt("-mempoolevictionmemoryminutes=", strprintf(_("The number of minutes before allowing rejected transactions to re-enter the mempool. (default: %u)"), DEFAULT_MEMPOOL_EVICTION_MEMORY_MINUTES)); + strUsage += HelpMessageOpt("-mempooltxcostlimit=",strprintf(_("An upper bound on the maximum size in bytes of all transactions in the mempool. (default: %s)"), DEFAULT_MEMPOOL_TOTAL_COST_LIMIT)); strUsage += HelpMessageOpt("-onion=", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy")); strUsage += HelpMessageOpt("-onlynet=", _("Only connect to nodes in network (ipv4, ipv6 or onion)")); strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1)); @@ -978,8 +978,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) mempool.setSanityCheck(1.0 / ratio); } - int64_t mempoolTotalCostLimit = GetArg("-mempool.tx_cost_limit", DEFAULT_MEMPOOL_TOTAL_COST_LIMIT); - int64_t mempoolEvictionMemorySeconds = GetArg("-mempool.eviction_memory_minutes", DEFAULT_MEMPOOL_EVICTION_MEMORY_MINUTES) * 60; + int64_t mempoolTotalCostLimit = GetArg("-mempooltxcostlimit", DEFAULT_MEMPOOL_TOTAL_COST_LIMIT); + int64_t mempoolEvictionMemorySeconds = GetArg("-mempoolevictionmemoryminutes", DEFAULT_MEMPOOL_EVICTION_MEMORY_MINUTES) * 60; mempool.SetMempoolCostLimit(mempoolTotalCostLimit, mempoolEvictionMemorySeconds); fCheckBlockIndex = GetBoolArg("-checkblockindex", chainparams.DefaultConsistencyChecks());