orbs-network / lean-helix-go

Go implementation of the Lean Helix Byzantine fault tolerant consensus algorithm
MIT License
37 stars 0 forks source link

Message storage - need to delete all previous messages since beginning of time #81

Open IdoZilberberg opened 5 years ago

IdoZilberberg commented 5 years ago

When starting to work on a new block, message storage is deleted from the previous block. It might be possible that due to successive node syncs, dangling data will remain.

It is safer to try to delete all messages since the beginning of time (block height = 0) up to the previous block.

Go over the keys of every map (prepareStorage, commitStorage, etc) and delete() all those with block heights older than current one. Or - delete them all, as there is not supposed to be any relevant data in the map at that point.