Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
When transactions are re-admitted to the mempool during block reorganizations, a race condition exists between UpdateTransactionsFromBlock() and LimitMempoolSize() that causes:
Stale UTXO cache (m_view) data used for transaction validation Valid transactions incorrectly rejected with “mempool full” Inconsistent mempool state across nodes during reorg windows Potential consensus divergence between peers Affected Code: validation.cpp lines 300-400 (MaybeUpdateMempoolForReorg) and lines 585-900 (MemPoolAccept class)
Expected Behaviour UTXO cache should be properly synchronized after mempool state changes Transaction validation must use current, accurate coin data All nodes should reach consistent mempool state regardless of timing No race conditions between mempool trimming and transaction acceptance
Expected behaviour
Mempool fee calculations should remain consistent and accurate during block reorganizations UTXO cache (m_view) must be properly synchronized after any mempool state change Transaction validation should use fresh, accurate coin data No race conditions should exist between mempool trimming and fee estimation All nodes should reach consensus on mempool contents regardless of timing
Steps to reproduce
Run Bitcoin Core with near-full mempool: bitcoind -maxmempool=300 -debug=mempool -regtest
2.Generate blocks and fill mempool to ~90% capacity 3.Trigger manual reorg (2-3 blocks deep): bitcoin-cli invalidateblock <block_hash> bitcoin-cli reconsiderblock <block_hash> 3.During the reorg window, broadcast transactions with borderline fees (near mempool minimum) 4.Observe inconsistent acceptance across nodes - some accept, others reject as “mempool full”
Relevant log output
2026-02-13T10:23:45Z [mempool] replacing mempool tx abc123… (fees=500, vsize=250) 2026-02-13T10:23:45Z [validation] AcceptToMemoryPool: tx REJECTED (reason: mempool full) 2026-02-13T10:23:45Z [validation] BUG! PLEASE REPORT THIS! CheckInputScripts failed 2026-02-13T10:23:46Z [mempool] transaction failed: mempool full (code 64)
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
Bitcoin Core version v30.99.0-dev
Operating system and version
Ubuntu 22.04 LTS Also reproducible on macOS 13+ and Windows 10/11
Machine specifications
No response