Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
I’m testing v25.0rc2. Occasionally it becomes unresponsive. Simple requests like ‘getblockcount’ time out.
I tried running in gdb to see where the code was getting hung up. It was loading the mempool.dat file, spending lots of time in CTxMemPool::addUnchecked()
, running this line:
vTxHashes.emplace_back(tx.GetWitnessHash(), newit);
and also in CTxMemPool::TrimToSize()
.
I added some LogPrintf() calls. It took 2380 seconds to load just 26 tx from the mempool.dat. That’s 91 seconds per tx. Here’s the relevant section of the debug.log.
The issue only happens when the maxmempool
value is reached, but that’s not enough to trigger it. The only time I’ve seen the issue happen is with the default 300 MB mempool limit. I tried using a 200 MB limit, but this issue didn’t happen. Then I set it back to the default 300 and now I can’t reproduce the issue.
Expected behaviour
I expect ‘getblockcount’ to be quick.
Steps to reproduce
I’m not able to reproduce.
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
v25.0rc2
Operating system and version
Debian GNU/Linux 11 (bullseye)
Machine specifications
Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz SSL disk Cable internet