lighthouse-pulse/beacon_node/store/src
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
..
impls Write new blocks and states to the database atomically (#1285) 2020-07-01 12:45:57 +10:00
chunked_iter.rs Make key value storage abstractions more accurate (#1267) 2020-06-16 11:34:04 +10:00
chunked_vector.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
config.rs removed state-cache-size flag from beacon_node/src (#1120) 2020-05-14 22:34:24 +10:00
errors.rs Harden the freezing procedure against failures (#1323) 2020-07-03 09:47:31 +10:00
forwards_iter.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
hot_cold_store.rs Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
impls.rs Clean up database abstractions (#1200) 2020-06-01 08:13:49 +10:00
iter.rs Make key value storage abstractions more accurate (#1267) 2020-06-16 11:34:04 +10:00
leveldb_store.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
lib.rs Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
memory_store.rs Harden the freezing procedure against failures (#1323) 2020-07-03 09:47:31 +10:00
metrics.rs Write new blocks and states to the database atomically (#1285) 2020-07-01 12:45:57 +10:00
partial_beacon_state.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00