Peter, a Bitcoin developer, discusses the "mempool is a cluster" project, a collaborative effort to rethink how Bitcoin Core handles dependent transactions. The goal is to enable nodes to better reason about transactions relayed across the network, ensuring mempools are representative of future blocks and preserving the permissionless nature of Bitcoin.
Currently, Bitcoin Core uses an algorithm that precomputes ancestor sets and their average fee rates for each transaction. This is sufficient for simple Child Pays For Parent (CPFP) scenarios but struggles with more complex dependencies, leading to issues like the ancestor set size limit and suboptimal transaction eviction.
The core problem is the lack of a total ordering on transactions that accounts for dependencies. Ideally, the eviction algorithm would mirror the block building algorithm, but this is computationally infeasible. This inconsistency leads to issues with fee estimation, Replace-By-Fee (RBF) rules, and rate limiting during transaction floods.
The proposed solution introduces a total ordering on transactions and generalizes CPFP by considering the highest fee rate prefix, creating "chunks." This simplifies block building (picking from the front) and eviction (removing from the back). Replacement is handled using "fee size diagrams" to compare the cumulative fee and size of different orderings, ensuring replacements are unambiguously better.
To make this practical, the mempool is partitioned into clusters of related transactions, limited to 64 transactions each. The existing mining algorithm is then run on each cluster to determine the ordering within that cluster. This approach aims to improve block building, eviction, replacement, flood protection, and fee estimation. The existing ancestor/descendant limits are replaced with the 64-transaction cluster size limit, and RBF rules are updated to use diagram comparisons. Simulation results show only small changes in transaction acceptance rates, primarily affecting non-singleton clusters.
Future improvements include exploring better algorithms for finding optimal orderings within clusters. One promising avenue involves framing the problem as a linear programming problem and applying simplex-based algorithms. This offers potential speed and fairness advantages.