This is a simple mempool PR that fixes #33510.
Evicting mempool transactions by age (-mempoolexpiry, default two weeks) is
incentive-incompatible: it may drop transactions that could still be mined
As discussed IRL and in #33510, this PR hence removes age-based eviction entirely.
Transactions now leave the mempool only via size limiting (-maxmempool),
replacement, conflicts, or inclusion in a block. The EXPIRY removal reason is
dropped. -mempoolexpiry is retained as a hidden no-op that warns when set, so
existing configurations keep starting.
Nice side effects:
- With expiry gone, the
entry_timeindex has no readers. Removing it saves an ordered-tree node per mempool entry and drops a now unused Boost include. - The
DynamicMemoryUsage()per-entry estimate drops from three indexes to two, so within the same-maxmempoolbudget the mempool fits slightly more transactions.
I analyzed the reason=expiry evictions from a 15-node monitoring fleet (data courtesy of b10c) and checked what happened to each transaction afterwards.
Across 938,157 unique expired transactions (2024-02-16 to 2026-10-21):
- 92.0% (863,451) were later mined; only 8.0% (74,706) never confirmed.
- At least 34% (316,381) show rebroadcast evidence, and 87% of those confirmed.
- Of the ones that confirm, half are mined within about 5 days of first expiry and 90% within about 55 days.
So time-based expiry is evicting transactions that get mined anyway, usually after a rebroadcast, it costs relay bandwidth.
See thread https://bnoc.xyz/t/request-how-many-mempool-transactions-are-evicted-by-time/132