lighthouse/consensus
Adam Szkoda d9f4819fe0 Alternative (to BeaconChainHarness) BeaconChain testing API (#1380)
The PR:

* Adds the ability to generate a crucial test scenario that isn't possible with `BeaconChainHarness` (i.e. two blocks occupying the same slot; previously forks necessitated skipping slots):

![image](https://user-images.githubusercontent.com/165678/88195404-4bce3580-cc40-11ea-8c08-b48d2e1d5959.png)

* New testing API: Instead of repeatedly calling add_block(), you generate a sorted `Vec<Slot>` and leave it up to the framework to generate blocks at those slots.
* Jumping backwards to an earlier epoch is a hard error, so that tests necessarily generate blocks in a epoch-by-epoch manner.
* Configures the test logger so that output is printed on the console in case a test fails.  The logger also plays well with `--nocapture`, contrary to the existing testing framework
* Rewrites existing fork pruning tests to use the new API
* Adds a tests that triggers finalization at a non epoch boundary slot
* Renamed `BeaconChainYoke` to `BeaconChainTestingRig` because the former has been too confusing
* Fixed multiple tests (e.g. `block_production_different_shuffling_long`, `delete_blocks_and_states`, `shuffling_compatible_simple_fork`) that relied on a weird (and accidental) feature of the old `BeaconChainHarness` that attestations aren't produced for epochs earlier than the current one, thus masking potential bugs in test cases.

Co-authored-by: Michael Sproul <michael@sigmaprime.io>
2020-08-26 09:24:55 +00:00
..
cached_tree_hash Update smallvec (#1339) 2020-07-07 16:57:27 +10:00
fork_choice Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
int_to_bytes Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00
merkle_proof Deny warnings on CI (#1372) 2020-07-21 05:51:33 +00:00
proto_array Shift HTTP server heavy-lifting to blocking executor (#1518) 2020-08-24 03:06:10 +00:00
safe_arith Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00
serde_hex Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00
ssz Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
ssz_derive Fix eval order lint in ssz_derive (#1210) 2020-05-28 11:37:40 +10:00
ssz_types Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
state_processing Support multiple BLS implementations (#1335) 2020-07-25 02:03:18 +00:00
swap_or_not_shuffle Bump all spec tags to v0.12.1 (#1275) 2020-06-19 11:18:27 +10:00
tree_hash Add caching for state.eth1_data_votes (#919) 2020-07-24 02:19:47 +00:00
tree_hash_derive Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00
types Memory usage reduction (#1522) 2020-08-17 08:05:13 +00:00