mimblewimble / grin

Minimal implementation of the Mimblewimble protocol.
https://grin.mw/
Apache License 2.0
5.04k stars 991 forks source link

Blockchain sync stuck at 3% #1318

Closed azilber closed 6 years ago

azilber commented 6 years ago

Hi, I built version 0.3.0 on arm. Synced up to 3% and stuck there for 48 hours. Tried re-running it, and same thing. Could be related to issues 1293?

screen shot 2018-08-06 at 8 06 14 am screen shot 2018-08-06 at 8 05 57 am

Specs on the hardware: Banana Pi, 2GB ram + 2gb swap, ssd drive

garyyu commented 6 years ago

Do you have logs please?

azilber commented 6 years ago

grin.log.gz

Here's the log file!

hashmap commented 6 years ago

I see LMDB error MDB_MAP_FULL: Environment mapsize limit reached so your header head stuck at 1325, your node is asking for the same headers over and over again but was not able to store them.

In Grin mapsize limit is half a TB https://github.com/mimblewimble/grin/blob/master/store/src/lmdb.rs#L65 but as you can see in the comment it's not supposed to work on 32-bit cpu.

I'm not an ARM expert but v7 could be 32-bit. Another explanation is 2gb ram, in the past I had some issues with less than 4Gb.

azilber commented 6 years ago

Ouch, no 32bit? Yes, it's a 32bit chip (sun8iw11p1). But, I have swap enabled (2gb) and it's not hitting swap at all, so the issue is most likely that allocation limit.

I guess with https://github.com/mimblewimble/grin/blob/master/store/src/lmdb.rs#L65 the dream of running it on that box is shattered :(

Would it break things considerably if I tried changing the limit to something 32bit friendly?

hashmap commented 6 years ago

@azilber I'd try, let us know if it works!

azilber commented 6 years ago

And so I shall @hashmap ! I'm currently at 12%. I'll post updates in a few hours.

ignopeverell commented 6 years ago

Both LMDB and our MMR storage (smaller) rely on memory maps. Which means that the whole thing needs to be addressable with a single address, unlike "classic" DBs that rely on file chunks. So on a 32 bits system, things are going to get iffy when LMDB reaches 2.1GB or possibly 4.2GB if you're lucky.

That being said, in fast sync and pruning mode (the default), it's possible that neither LMDB nor pruned MMRs will ever each that size. Still a bit risky.

hashmap commented 6 years ago

Closing, feel free to reopen