diff --git a/doc/release-notes.md b/doc/release-notes.md --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -8,3 +8,4 @@ - Remove support for `-sendfreetransactions`. - Remove unstable `estimatesmartfee` RPC. - Update berkley DB to 5.3 minimum. Developers should update their build environment accordingly. + - Remove `-incrementalrelayfee` option diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -804,12 +804,6 @@ strprintf(_("Do not accept blocks larger than this " "limit, in bytes (default: %d)"), DEFAULT_MAX_BLOCK_SIZE)); - strUsage += HelpMessageOpt( - "-incrementalrelayfee=", - strprintf( - "Fee rate (in %s/kB) used to define cost of relay, used for " - "mempool limiting and BIP 125 replacement. (default: %s)", - CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE))); strUsage += HelpMessageOpt( "-dustrelayfee=", strprintf("Fee rate (in %s/kB) used to defined dust, the value of " @@ -1486,17 +1480,6 @@ if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin) return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000000.0))); - // Incremental relay fee sets the minimimum feerate increase necessary for - // BIP 125 replacement in the mempool and the amount the mempool min fee - // increases above the feerate of txs evicted due to mempool limiting. - if (gArgs.IsArgSet("-incrementalrelayfee")) { - Amount n(0); - if (!ParseMoney(gArgs.GetArg("-incrementalrelayfee", ""), n)) - return InitError( - AmountErrMsg("incrementalrelayfee", - gArgs.GetArg("-incrementalrelayfee", ""))); - incrementalRelayFee = CFeeRate(n); - } // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency nScriptCheckThreads = gArgs.GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS); @@ -1583,12 +1566,6 @@ gArgs.GetArg("-minrelaytxfee", ""))); // High fee check is done afterward in CWallet::ParameterInteraction() ::minRelayTxFee = CFeeRate(n); - } else if (incrementalRelayFee > ::minRelayTxFee) { - // Allow only setting incrementalRelayFee to control both - ::minRelayTxFee = incrementalRelayFee; - LogPrintf( - "Increasing minrelaytxfee to %s to match incrementalrelayfee\n", - ::minRelayTxFee.ToString()); } // Sanity check argument for min fee for including tx in block diff --git a/src/policy/policy.h b/src/policy/policy.h --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -34,7 +34,7 @@ static const unsigned int DEFAULT_MAX_MEMPOOL_SIZE = 300; /** Default for -incrementalrelayfee, which sets the minimum feerate increase * for mempool limiting or BIP 125 replacement **/ -static const Amount DEFAULT_INCREMENTAL_RELAY_FEE(1000); +static const CFeeRate MEMPOOL_FULL_FEE_INCREMENT(Amount(1000)); /** Default for -bytespersigop */ static const unsigned int DEFAULT_BYTES_PER_SIGOP = 20; /** diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -155,6 +155,5 @@ return true; } -CFeeRate incrementalRelayFee = CFeeRate(DEFAULT_INCREMENTAL_RELAY_FEE); CFeeRate dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE); unsigned int nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP; diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -527,10 +527,6 @@ " \"excessutxocharge\": x.xxxxxxxx, (numeric) minimum " "charge for excess utxos in " + CURRENCY_UNIT + "\n" - " \"incrementalfee\": x.xxxxxxxx, " - "(numeric) minimum fee increment for mempool " - "limiting or BIP 125 replacement in " + - CURRENCY_UNIT + "/kB\n" " \"localaddresses\": [ " "(array) list of local addresses\n" " {\n" @@ -571,8 +567,6 @@ Pair("relayfee", ValueFromAmount(::minRelayTxFee.GetFeePerK()))); obj.push_back(Pair("excessutxocharge", ValueFromAmount(config.GetExcessUTXOCharge()))); - obj.push_back(Pair("incrementalfee", - ValueFromAmount(::incrementalRelayFee.GetFeePerK()))); UniValue localAddresses(UniValue::VARR); { LOCK(cs_mapLocalHost); diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -481,6 +481,7 @@ CTxMemPool pool; TestMemPoolEntryHelper entry; entry.dPriority = 10.0; + Amount feeIncrement = MEMPOOL_FULL_FEE_INCREMENT.GetFeePerK(); CMutableTransaction tx1 = CMutableTransaction(); tx1.vin.resize(1); @@ -537,7 +538,7 @@ CTransaction(tx3).GetTotalSize() + CTransaction(tx2).GetTotalSize()); BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), - maxFeeRateRemoved.GetFeePerK() + Amount(1000)); + maxFeeRateRemoved.GetFeePerK() + feeIncrement); CMutableTransaction tx4 = CMutableTransaction(); tx4.vin.resize(2); @@ -625,19 +626,19 @@ SetMockTime(42); SetMockTime(42 + CTxMemPool::ROLLING_FEE_HALFLIFE); BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), - maxFeeRateRemoved.GetFeePerK() + Amount(1000)); + maxFeeRateRemoved.GetFeePerK() + feeIncrement); // ... we should keep the same min fee until we get a block pool.removeForBlock(vtx, 1); SetMockTime(42 + 2 * CTxMemPool::ROLLING_FEE_HALFLIFE); BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), - (maxFeeRateRemoved.GetFeePerK() + Amount(1000)) / 2); + (maxFeeRateRemoved.GetFeePerK() + feeIncrement) / 2); // ... then feerate should drop 1/2 each halflife SetMockTime(42 + 2 * CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE / 2); BOOST_CHECK_EQUAL( pool.GetMinFee(pool.DynamicMemoryUsage() * 5 / 2).GetFeePerK(), - (maxFeeRateRemoved.GetFeePerK() + Amount(1000)) / 4); + (maxFeeRateRemoved.GetFeePerK() + feeIncrement) / 4); // ... with a 1/2 halflife when mempool is < 1/2 its target size SetMockTime(42 + 2 * CTxMemPool::ROLLING_FEE_HALFLIFE + @@ -645,21 +646,9 @@ CTxMemPool::ROLLING_FEE_HALFLIFE / 4); BOOST_CHECK_EQUAL( pool.GetMinFee(pool.DynamicMemoryUsage() * 9 / 2).GetFeePerK(), - (maxFeeRateRemoved.GetFeePerK() + Amount(1000)) / 8); + (maxFeeRateRemoved.GetFeePerK() + feeIncrement) / 8); // ... with a 1/4 halflife when mempool is < 1/4 its target size - SetMockTime(42 + 7 * CTxMemPool::ROLLING_FEE_HALFLIFE + - CTxMemPool::ROLLING_FEE_HALFLIFE / 2 + - CTxMemPool::ROLLING_FEE_HALFLIFE / 4); - BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), Amount(1000)); - // ... but feerate should never drop below 1000 - - SetMockTime(42 + 8 * CTxMemPool::ROLLING_FEE_HALFLIFE + - CTxMemPool::ROLLING_FEE_HALFLIFE / 2 + - CTxMemPool::ROLLING_FEE_HALFLIFE / 4); - BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), Amount(0)); - // ... unless it has gone all the way to 0 (after getting past 1000/2) - SetMockTime(0); } diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1174,15 +1174,8 @@ rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife); lastRollingFeeUpdate = time; - - if (rollingMinimumFeeRate < - (double)incrementalRelayFee.GetFeePerK().GetSatoshis() / 2) { - rollingMinimumFeeRate = 0; - return CFeeRate(Amount(0)); - } } - return std::max(CFeeRate(Amount(int64_t(rollingMinimumFeeRate))), - incrementalRelayFee); + return CFeeRate(Amount(int64_t(rollingMinimumFeeRate))); } void CTxMemPool::trackPackageRemoved(const CFeeRate &rate) { @@ -1210,7 +1203,8 @@ // between. CFeeRate removed(it->GetModFeesWithDescendants(), it->GetSizeWithDescendants()); - removed += incrementalRelayFee; + removed += MEMPOOL_FULL_FEE_INCREMENT; + trackPackageRemoved(removed); maxFeeRateRemoved = std::max(maxFeeRateRemoved, removed);