lighthouse/beacon_node/beacon_chain/src
Paul Hauner 931daa40d7 Add fork choice EF tests (#2737)
## Issue Addressed

Resolves #2545

## Proposed Changes

Adds the long-overdue EF tests for fork choice. Although we had pretty good coverage via other implementations that closely followed our approach, it is nonetheless important for us to implement these tests too.

During testing I found that we were using a hard-coded `SAFE_SLOTS_TO_UPDATE_JUSTIFIED` value rather than one from the `ChainSpec`. This caused a failure during a minimal preset test. This doesn't represent a risk to mainnet or testnets, since the hard-coded value matched the mainnet preset.

## Failing Cases

There is one failing case which is presently marked as `SkippedKnownFailure`:

```
case 4 ("new_finalized_slot_is_justified_checkpoint_ancestor") from /home/paul/development/lighthouse/testing/ef_tests/consensus-spec-tests/tests/minimal/phase0/fork_choice/on_block/pyspec_tests/new_finalized_slot_is_justified_checkpoint_ancestor failed with NotEqual:
head check failed: Got Head { slot: Slot(40), root: 0x9183dbaed4191a862bd307d476e687277fc08469fc38618699863333487703e7 } | Expected Head { slot: Slot(24), root: 0x105b49b51bf7103c182aa58860b039550a89c05a4675992e2af703bd02c84570 }
```

This failure is due to #2741. It's not a particularly high priority issue at the moment, so we fix it after merging this PR.
2021-11-08 07:29:04 +00:00
..
attestation_verification Batch BLS verification for attestations (#2399) 2021-09-22 08:49:41 +00:00
attestation_verification.rs Add fork choice EF tests (#2737) 2021-11-08 07:29:04 +00:00
attester_cache.rs Add AttesterCache for attestation production (#2478) 2021-07-29 04:38:26 +00:00
beacon_chain.rs Add fork choice EF tests (#2737) 2021-11-08 07:29:04 +00:00
beacon_fork_choice_store.rs Tree hash caching and optimisations for Altair (#2459) 2021-07-23 00:23:53 +00:00
beacon_proposer_cache.rs Optimize validator duties (#2243) 2021-03-17 05:09:57 +00:00
beacon_snapshot.rs Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
block_times_cache.rs Add BlockTimesCache to allow additional block delay metrics (#2546) 2021-09-30 04:31:41 +00:00
block_verification.rs Implement checkpoint sync (#2244) 2021-09-22 00:37:28 +00:00
builder.rs Fix I/O atomicity issues with checkpoint sync (#2671) 2021-10-05 03:53:17 +00:00
chain_config.rs Add flag to disable lock timeouts (#2714) 2021-10-19 00:30:40 +00:00
errors.rs Implement checkpoint sync (#2244) 2021-09-22 00:37:28 +00:00
eth1_chain.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
events.rs Add BlockTimesCache to allow additional block delay metrics (#2546) 2021-09-30 04:31:41 +00:00
fork_revert.rs Add fork choice EF tests (#2737) 2021-11-08 07:29:04 +00:00
head_tracker.rs Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
historical_blocks.rs Reduce lock contention in backfill sync (#2716) 2021-10-15 03:28:03 +00:00
lib.rs Add fork choice EF tests (#2737) 2021-11-08 07:29:04 +00:00
metrics.rs Add op pool metrics for attestations (#2758) 2021-11-01 05:52:31 +00:00
migrate.rs Implement checkpoint sync (#2244) 2021-09-22 00:37:28 +00:00
naive_aggregation_pool.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
observed_aggregates.rs [Altair] Sync committee pools (#2321) 2021-07-15 00:52:02 +00:00
observed_attesters.rs Ensure doppelganger detects attestations in blocks (#2495) 2021-08-09 02:43:03 +00:00
observed_block_producers.rs Doppelganger detection (#2230) 2021-07-31 03:50:52 +00:00
observed_operations.rs Clippy 1.49.0 updates and dht persistence test fix (#2156) 2021-01-19 00:34:28 +00:00
persisted_beacon_chain.rs Fix head tracker concurrency bugs (#1771) 2020-10-19 05:58:39 +00:00
persisted_fork_choice.rs v0.12 fork choice update (#1229) 2020-06-17 11:10:22 +10:00
schema_change.rs Implement checkpoint sync (#2244) 2021-09-22 00:37:28 +00:00
shuffling_cache.rs Advance state to next slot after importing block (#2174) 2021-02-15 07:17:52 +00:00
snapshot_cache.rs Add BeaconChainHarness::builder (#2707) 2021-10-14 02:58:10 +00:00
state_advance_timer.rs Add AttesterCache for attestation production (#2478) 2021-07-29 04:38:26 +00:00
sync_committee_verification.rs Validator monitor support for sync committees (#2476) 2021-08-31 23:31:36 +00:00
test_utils.rs Add fork choice EF tests (#2737) 2021-11-08 07:29:04 +00:00
timeout_rw_lock.rs Add flag to disable lock timeouts (#2714) 2021-10-19 00:30:40 +00:00
validator_monitor.rs Reduce validator monitor logging verbosity (#2606) 2021-10-12 05:06:48 +00:00
validator_pubkey_cache.rs Add BeaconChainHarness::builder (#2707) 2021-10-14 02:58:10 +00:00