Mempool "Expected Byte Stay" policy



Summary:

The author of the context is facing a problem with spammers disrespecting their fullnode resources. To tackle this issue, they have made some changes. They have set a maximum size for the memory pool and are allocating space based on a simple rule. The cost to the author of continuing to hold a transaction in the mempool is measured by "expected byte stay." This value is calculated using the product of sizeBytes and expectedBlocksToConfirm(feeRate). When there's not enough space for a new transaction, the author tries to make space by evicting transactions with an expectedByteStay higher than the new transaction. However, the author is not concerned about fees except for their effect on confirmation time, coin age, CPFP, and replacement. A transaction and its dependents are evicted on its two-hour anniversary, whether space is required or not. The latest expectedBlocksToConfirm(feeRate) table is applied to the entire mempool periodically. The author is putting a lot of faith in the new fee estimation, particularly its size independence. However, there is also a possibility of clog-ups by transactions that look like they'll confirm next block but don't due to factors other than fees. The author will update on how the new system works out.


Updated on: 2023-06-10T02:42:21.237730+00:00