-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mempool file over 32 MB cannot be deserialized #30
Comments
Reproduced it on Windows. |
Bitcoin Knots version v0.20.1 was also doing this, but we thought it's just a fluke. |
How to reproduceOverride See an error in debug.log
After this mempool lost and the node starting build up the mempool from scratch. Our backend is using Ubuntu, I reproduced it on Windows, both had the bug so it is platform-independent. |
FYI: test/functional/mempool_persist.py pass
Using the @molnard mempool.dat file it seems to fail while deserializing the "txs" entry. |
It seems the mempool.dat file ~$ cat ~/.bitcoin/regtest/mempool.dat | xxd | head -100 00000000: 0200 0000 0000 0000 0306 6465 6c74 6173 ..........deltas 00000010: 0100 066d 696e 6665 6511 7680 d2c5 c53b ...minfee.v....; 00000020: bf40 0188 6d36 6000 0000 0003 7478 73fe .@..m6`.....txs. 00000030: 79ee 9506 fece 3801 0002 00fd e501 0200 y.....8......... |
Just mentioning, I saved the file on the fly - I did not stop bitcoind service, I was afraid of losing the mempool again. |
Here's a mempool file created by Knots: if you load it with Bitcoin Core 21, then it's successful, if you do it with Bitcoin Knots 21 then it fails. |
FTR @luke-jr the reason why we're investigating it so fiercely because we cannot restart Knots on the server without the mempool corrupting. |
And this takes away our most powerful skill of trouble shooting - trying to turn it off and on again... 😢 |
It seems it cannot load |
A workaround would probably be I had planned to drop the custom mempool.dat format in 22.0 already (0.21 added compatibility code for Core's format), but sounds like it might be good to do it sooner. |
It is a priority issue for us. 32Mb mempool is a no-go, on the contrary, it should be increased more to avoid wallet state inconsistencies. All the clients (without the Full node), maintain their mempool according to the backend's mempool. Every time I need to restart the backend - for any reason mempool lost. It is like sitting on a bomb. Is it possible to fix this ASAP in a hotfix release, under any conditions? |
@molnard If you can apply a patch and build yourself, this one should write a Core mempool.dat instead (which is supported by Knots 0.21) https://dpaste.com/ELMEQ8ZUG Does this hotfix work for you, or you need more? |
@luke-jr I am a bit blocked with this hotfix. I applied the patch and compiled it but I cannot make the
/tmp/bitcoin_func_test_seni8rds
This is because knots-v0.19.1 says:
What am i doing wrong? How can I run the Thanks for the hotfix. |
It is expecting Core releases for the compatibility tests. (I do have a Knots compatibility variant locally, but it's a hack and I didn't adapt it to this hotfix) |
Tested. It is compatible with Core |
Here is the diff: And the release Awesome @lontivero @luke-jr 🙏 |
With this mempool file, you will end up the same as here.
https://github.com/molnard/bitcoin/releases/download/v0.21.0.0-14a6a1dd2/mempool.dat |
This should be fixed in 0.21.1.knots20210629. Please close the issue once you've confirmed. (Additional gitian signatures would be appreciated BTW) |
Fixed and deployed. |
Expected behavior
Mempool should be deserialized without error.
Actual behavior
To reproduce
It seems to happen always with no exception (100% reproducible in our environment)
Note
We didn't experienced this with Bitcoin Core.
System information
Bitcoin Knots version v0.21.0.0-gd4a64f61c1346b15ccb91eafbae16ffc8f52e577 (release build)
But this same problem was present in the previous released version v0.20.0
Ubuntu 18.04.4 LTS (no GUI)
Logs
The text was updated successfully, but these errors were encountered: