cculianu / Fulcrum

A fast & nimble SPV Server for BCH, BTC, and LTC
Other
339 stars 76 forks source link

DB created on Windows is incompatible with Linux #219

Closed Javihache closed 9 months ago

Javihache commented 9 months ago

After 2 weeks trying to sync with bitcoind on my Linux box and failing every single time with some db corruption problem, I decided to give it a try on my Windows desktop.

This computer did a good job and it took 2 days to sync. This is a gaming computer so I moved the DB directory to my linux server and to my surprise I can't use it. FATAL: Caught exception: Incompatible database format -- delete the datadir and resynch.

Both machines are using Fulcrum 1.9.7 and the RocksDB version of both is identical.

Is this as intended? Is there anything I can do?

I am gonna try to once again sync on my linux machine... but really, syncing this application has become a nightmare. I can't understand how a Ryzen 5 2400GE with 16GB RAM fails while my Raspberry Pi 4 8GB RAM was able to sync this in a few days...

cculianu commented 9 months ago

Sorry you are having trouble. Whatever BTC docs you read probably aren't helpful.

Tips to synch:

  1. Turn on swap. Make sure you have a swapfile. "Just in case".
  2. Don't use --fast-sync that option is experimental and error prone.

I bet you followed some BTC docs that recommended --fast-sync 8000 or something crazy, right?

cculianu commented 9 months ago

And yes, to answer your question, hacks were made when devising the original serialization format. Hacks that sadly led to some binary incompatibility between the Windows and Linux data formats. If I had it to do over again, I wouldn't have done it that way. But.. here we are. Stuck with this incompatibility.

Javihache commented 9 months ago

No, I was careful with fast-sync (I have 16GB RAM and the max I used on one of the attempts was 4096) and I actually removed fast-sync in the last try on Linux. When that last try without fast-sync failed, I decided to try Windows. Lo-and-behold... I tried on Windows with 16GB RAM and 4096MB fast-sync and it worked!! Don't ask me what the difference could be.

On Linux I have the 16GB RAM, some ZRAM swap (4GB) configured with low priority and a swapfile of 4GB on the SSD. So there's PLENTY of memory. I will try one last time without fast-sync.

I understand that you made that decision when creating this pretty impressive piece of software, don't worry. I'll just delete that Windows database knowing that it's useless as I run my servers all on Linux.

Thanks for the fast answer and input! And thanks for the software too!