-
Notifications
You must be signed in to change notification settings - Fork 148
Description
Motivation:
We should flatten BadgerDB instances before exporting them for the snapshots, to prevent needless storage, download bandwidth, and replicated pending compaction on all the nodes using it (credit @peternose).
Moreover, it would be useful as general purpose maintenance command and should as such be added under appropriate doc section.
Solution space:
Add a new command to oasis node e.g. oasis-node compact databases that would flatten all the databases.
This would be a long running operation so cannot be triggered on the node shutdown. As from the Flatten documentation, ideally there should be no writes happening, so this should be called once the node is stopped or syncing is paused.
Follow-up:
It would be useful to have a separate command for pruning consensus blocks, and another for consensus and runtime state, without starting the full-node.
Not sure this is even possible, given that ABCI Commit with lastRetainedHeight defines what can be pruned and what not (prune handlers).