lighthouse/consensus
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
..
cached_tree_hash Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
fork_choice Add fork choice EF tests (#2737) 2021-11-08 07:29:04 +00:00
int_to_bytes Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
merkle_proof Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
proto_array Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
safe_arith Remove saturating arith from state_processing (#1644) 2020-09-25 05:18:21 +00:00
serde_utils Updates to make crates publishable (#2472) 2021-09-03 01:10:25 +00:00
ssz Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
ssz_derive Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
ssz_types Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
state_processing Check proposer index during block production (#2740) 2021-11-01 07:44:40 +00:00
swap_or_not_shuffle Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
tree_hash Get arbitrary check passing (2.0) (#2710) 2021-10-14 02:58:11 +00:00
tree_hash_derive Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
types Add API version headers and map_fork_name! (#2745) 2021-10-28 01:18:04 +00:00