LiskArchive / lisk-engine

:bullettrain_front: Lisk blockchain engine
https://lisk.com
Apache License 2.0
0 stars 0 forks source link

Panic when DB failed with unexpected reason #57

Closed shuse2 closed 1 year ago

shuse2 commented 1 year ago

Description

Update db to panic when unexpected error happens. With that, we could update general DB interface to be

Get(key []byte): ([]byte, bool)
Set(key, value []byte)
Del(key []byte)

Motivation

If underlying DB fails with unexpected reason (ex: other than not found error), there is no way to recover or continue from that state automatically. Further more, if it proceed with the state, it could result in unexpected state. Therefore, unrecoverable error should be panic and stop the process.