lighthouse/beacon_node/beacon_chain/tests
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
..
attestation_production.rs Support multiple BLS implementations (#1335) 2020-07-25 02:03:18 +00:00
attestation_verification.rs Support multiple BLS implementations (#1335) 2020-07-25 02:03:18 +00:00
block_verification.rs Restrict fork choice getters to finalized blocks (#1475) 2020-08-14 06:36:38 +00:00
op_verification.rs Support multiple BLS implementations (#1335) 2020-07-25 02:03:18 +00:00
persistence_tests.rs Merge remote-tracking branch 'origin/master' into spec-v0.12 2020-06-17 12:34:11 +10:00
store_tests.rs Fix bug in database pruning (#1564) 2020-08-26 00:01:06 +00:00
tests.rs Process exits and slashings off the network (#1253) 2020-06-18 21:06:34 +10:00