lighthouse/beacon_node
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
..
beacon_chain Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
client Clean up logs (#1541) 2020-08-18 08:11:39 +00:00
eth1 Cross-compile to vendored x86_84, aarch64 (Raspberry Pi 4) (#1497) 2020-08-11 05:16:30 +00:00
eth2_libp2p reuse beacon_node methods for initializing network configs in boot_node (#1520) 2020-08-21 12:00:01 +00:00
genesis Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
network Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
operation_pool Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
rest_api Remove rayon from rest_api (#1562) 2020-08-24 07:28:54 +00:00
src reuse beacon_node methods for initializing network configs in boot_node (#1520) 2020-08-21 12:00:01 +00:00
store Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
tests Improve tokio task execution (#1181) 2020-06-04 21:48:05 +10:00
timer Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
websocket_server Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
Cargo.toml Bump to v0.2.7 (#1561) 2020-08-24 08:25:34 +00:00