lighthouse/beacon_node
Michael Sproul 4763f03dcc Fix bug in database pruning (#1564)
## Issue Addressed

Closes #1488

## Proposed Changes

* Prevent the pruning algorithm from over-eagerly deleting states at skipped slots when they are shared with the canonical chain.
* Add `debug` logging to the pruning algorithm so we have so better chance of debugging future issues from logs.
* Modify the handling of the "finalized state" in the beacon chain, so that it's always the state at the first slot of the finalized epoch (previously it was the state at the finalized block). This gives database pruning a clearer and cleaner view of things, and will marginally impact the pruning of the op pool, observed proposers, etc (in ways that are safe as far as I can tell).
* Remove duplicated `RevertedFinalizedEpoch` check from `after_finalization`
* Delete useless and unused `max_finality_distance`
* Add tests that exercise pruning with shared states at skip slots
* Delete unnecessary `block_strategy` argument from `add_blocks` and friends in the test harness (will likely conflict with #1380 slightly, sorry @adaszko -- but we can fix that)
* Bonus: add a `BeaconChain::with_head` method. I didn't end up needing it, but it turned out quite nice, so I figured we could keep it?

## Additional Info

Any users who have experienced pruning errors on Medalla will need to resync after upgrading to a release including this change. This should end unbounded `chain_db` growth! 🎉
2020-08-26 00:01:06 +00:00
..
beacon_chain Fix bug in database pruning (#1564) 2020-08-26 00:01:06 +00:00
client Clean up logs (#1541) 2020-08-18 08:11:39 +00:00
eth1 Cross-compile to vendored x86_84, aarch64 (Raspberry Pi 4) (#1497) 2020-08-11 05:16:30 +00:00
eth2_libp2p reuse beacon_node methods for initializing network configs in boot_node (#1520) 2020-08-21 12:00:01 +00:00
genesis Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
network Refactor attestation service (#1415) 2020-08-19 08:46:25 +00:00
operation_pool Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
rest_api Remove rayon from rest_api (#1562) 2020-08-24 07:28:54 +00:00
src reuse beacon_node methods for initializing network configs in boot_node (#1520) 2020-08-21 12:00:01 +00:00
store Fix bug in database pruning (#1564) 2020-08-26 00:01:06 +00:00
tests Improve tokio task execution (#1181) 2020-06-04 21:48:05 +10:00
timer Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
websocket_server Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
Cargo.toml Bump to v0.2.7 (#1561) 2020-08-24 08:25:34 +00:00