Fix DB synchronization error
Closed this issue ยท 4 comments
Description
Chain syncing is resulting in some DB error after some time, syncing is not able to recover. This has to be debugged and fixed.
Hi! I'd like to give this task a try, how can I reproduce?
Thanks :)
Hi, cool, you're welcome! ๐ Just run the client start command from the Readme, this should occur every time I've a couple of block sync messages.
Ok, I'm getting this error after a while:
/home/fgimenez/workspace/ethereumjs-client/node_modules/ethereumjs-blockchain/index.js:268
var hash = block.hash()
^
TypeError: block.hash is not a function
at Blockchain._putBlock (/home/fgimenez/workspace/ethereumjs-client/node_modules/ethereumjs-blockchain/index.js:268:20)
at /home/fgimenez/workspace/ethereumjs-client/node_modules/ethereumjs-blockchain/index.js:246:12
at /home/fgimenez/workspace/ethereumjs-client/node_modules/ethereumjs-blockchain/index.js:255:7
at Object.item.task (/home/fgimenez/workspace/ethereumjs-client/node_modules/semaphore/lib/semaphore.js:40:29)
at Object.take (/home/fgimenez/workspace/ethereumjs-client/node_modules/semaphore/lib/semaphore.js:51:9)
at lockUnlock (/home/fgimenez/workspace/ethereumjs-client/node_modules/ethereumjs-blockchain/index.js:253:24)
at Timeout.self._initLock.await [as _onTimeout] (/home/fgimenez/workspace/ethereumjs-client/node_modules/ethereumjs-blockchain/index.js:245:5)
at ontimeout (timers.js:488:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:283:5)
Looks like when this happens block is the string OPEN
instead of a proper block object. This value is set here https://github.com/ethereumjs/ethereumjs-client/blob/master/lib/net/NetworkManager.js#L85, not sure yet why this happens, but this should fix it #24.
I'd like to add some tests, any suggestion about how to write them for this concrete issue?