lighthouse/beacon_node/store
Michael Sproul a60ab4eff2 Refine compaction (#1916)
## Proposed Changes

In an attempt to fix OOM issues and database consistency issues observed by some users after the introduction of compaction in v0.3.4, this PR makes the following changes:

* Run compaction less often: roughly every 1024 epochs, including after long periods of non-finality. I think the division check proposed by Paul is pretty solid, and ensures we don't miss any events where we should be compacting. LevelDB lacks an easy way to check the size of the DB, which would be another good trigger.
* Make it possible to disable the compaction on finalization using `--auto-compact-db=false`
* Make it possible to trigger a manual, single-threaded foreground compaction on start-up using `--compact-db`
* Downgrade the pruning log to `DEBUG`, as it's particularly noisy during sync

I would like to ship these changes to affected users ASAP, and will document them further in the Advanced Database section of the book if they prove effective.
2020-11-17 09:10:53 +00:00
..
benches Fix clippy warnings (#813) 2020-01-21 18:38:56 +11:00
examples Fix clippy warnings (#813) 2020-01-21 18:38:56 +11:00
src Refine compaction (#1916) 2020-11-17 09:10:53 +00:00
Cargo.toml Update external deps (#1711) 2020-10-05 08:22:19 +00:00