HomePhabricator

Implement on-the-fly mempool size limitation.
794a8cec5db8Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Implement on-the-fly mempool size limitation.

After each transaction which is added to mempool, we first call
Expire() to remove old transactions, then throwing away the
lowest-feerate transactions.

After throwing away transactions by feerate, we set the minimum
relay fee to the maximum fee transaction-and-dependant-set we
removed, plus the default minimum relay fee.

After the next block is received, the minimum relay fee is allowed
to decrease exponentially. Its halflife defaults to 12 hours, but
is decreased to 6 hours if the mempool is smaller than half its
maximum size, and 3 hours if the mempool is smaller than a quarter
its maximum size.

The minimum -maxmempool size is 40*-limitdescendantsize, as it is
easy for an attacker to play games with the cheapest
-limitdescendantsize transactions. -maxmempool defaults to 300MB.

This disables high-priority transaction relay when the min relay
fee adjustment is >0 (ie when the mempool is full). When the relay
fee adjustment drops below the default minimum relay fee / 2 it is
set to 0 (re-enabling priority-based free relay).

Details

Provenance
Matt Corallo <git@bluematt.me>Authored on Oct 2 2015, 21:19
deadalnixPushed on May 14 2017, 22:04
Parents
rABCe6c7b362ab89: Print mempool size in KB when adding txn
Branches
Unknown
Tags
Unknown

Event Timeline

Matt Corallo <git@bluematt.me> committed rABC794a8cec5db8: Implement on-the-fly mempool size limitation. (authored by Matt Corallo <git@bluematt.me>).Oct 13 2015, 08:39