lighthouse/testing/ef_tests/src
Michael Sproul 20067b9465 Remove checkpoint alignment requirements and enable historic state pruning (#4610)
## Issue Addressed

Closes #3210
Closes #3211

## Proposed Changes

- Checkpoint sync from the latest finalized state regardless of its alignment.
- Add the `block_root` to the database's split point. This is _only_ added to the in-memory split in order to avoid a schema migration. See `load_split`.
- Add a new method to the DB called `get_advanced_state`, which looks up a state _by block root_, with a `state_root` as fallback. Using this method prevents accidental accesses of the split's unadvanced state, which does not exist in the hot DB and is not guaranteed to exist in the freezer DB at all. Previously Lighthouse would look up this state _from the freezer DB_, even if it was required for block/attestation processing, which was suboptimal.
- Replace several state look-ups in block and attestation processing with `get_advanced_state` so that they can't hit the split block's unadvanced state.
- Do not store any states in the freezer database by default. All states will be deleted upon being evicted from the hot database unless `--reconstruct-historic-states` is set. The anchor info which was previously used for checkpoint sync is used to implement this, including when syncing from genesis.

## Additional Info

Needs further testing. I want to stress-test the pruned database under Hydra.

The `get_advanced_state` method is intended to become more relevant over time: `tree-states` includes an identically named method that returns advanced states from its in-memory cache.

Co-authored-by: realbigsean <seananderson33@gmail.com>
2023-08-21 05:02:32 +00:00
..
cases Remove checkpoint alignment requirements and enable historic state pruning (#4610) 2023-08-21 05:02:32 +00:00
bls_setting.rs Bump the MSRV to 1.62 and using #[derive(Default)] on enums (#3304) 2022-07-15 07:31:19 +00:00
case_result.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
cases.rs Added Merkle Proof Generation for Beacon State (#3674) 2022-11-08 01:58:18 +00:00
decode.rs Replace OpenOptions::new with File::options to be readable (#3059) 2022-03-07 06:30:18 +00:00
error.rs Add fork choice EF tests (#2737) 2021-11-08 07:29:04 +00:00
handler.rs Fork choice modifications and cleanup (#3962) 2023-03-21 07:34:41 +00:00
lib.rs add historical summaries (#3865) 2023-01-11 12:40:21 +11:00
results.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
type_name.rs Clean capella (#4019) 2023-03-01 03:19:02 +00:00