Cluster mempool

From Bitcoin Wiki
Jump to navigation Jump to search

The cluster mempool is a redesign of Bitcoin Core's unconfirmed transaction pool that groups transactions into connected components (clusters) and orders them by linearized chunk feerate. It replaced ancestor-and-descendant limits with cluster limits. Bitcoin Core 31.0 shipped the design as the mempool implementation. The change is policy and mining-algorithm internal structure, not a consensus change. It is related to but distinct from the broader topic of the mempool.

The pre-cluster mempool tracked, for each transaction, its unconfirmed ancestors and descendants. Mining used ancestor feerate as a proxy for whether a transaction would be selected soon. Replacement policy used that proxy plus absolute-fee and count caps. The proxy is inaccurate for graphs with several fee-payers, which led to pinning and to block templates that left fees on the table. Child-pays-for-parent carve-out was a special case that allowed Lightning a second child; it is incompatible with a strict cluster size limit. Suhas Daftuar and others proposed bounding each connected component so that an exact linearization (an ordering of the cluster into monotonically nonincreasing feerate chunks) is computable. Incentive compatibility of a replacement then reduces to comparing feerate diagrams.

Two transactions are in the same cluster if they are linked by any chain of unconfirmed parent/child edges. Bitcoin Core 31.0 defaults to at most 64 transactions and 101 kB virtual size per cluster. Those limits can be changed with debug arguments. There are no separate ancestor or descendant count limits. Within a cluster, a linearization algorithm produces a sequence of chunks: subsets that a miner would include together. Transactions are scored by the feerate of their chunk. That score is used for selecting transactions into block templates, evicting transactions when the mempool reaches its size limit, announcing transactions to peers, and deciding whether a replacement or a package improves the mempool. RPCs getmempoolcluster and getmempoolfeeratediagram expose cluster membership, chunk grouping, and the mempool-wide feerate diagram.

Child-pays-for-parent carve-out is removed. Protocols that needed it are expected to use TRUC (1-parent-1-child, sibling eviction) or to stay within cluster limits. One-parent-one-child package relay can accept a parent below minrelaytxfee, including zero fee, for both TRUC and non-TRUC packages, with the restriction that extra unconfirmed parents of the child must already be in the mempool. Cluster mempool does not by itself prevent all pinning. Absolute-fee pinning and replacement-count pinning still require topology restrictions or other rules for the worst adversarial cases. TRUC remains useful after cluster mempool for that reason. Related replacement policies include Replace by fee and Full RBF.

Bitcoin Core 31.0 is the first release in which the mempool is the cluster mempool. Mining software that consumes Core's template RPCs inherits the new ordering. Other node implementations may retain ancestor/descendant mempools. Wallets do not need a new transaction format, but Lightning and vault protocols that depended on carve-out need a TRUC migration before operators upgrade those nodes. Fee market forecasting remains covered under Fee estimation.

See also

External links