lighthouse/beacon_node
Adam Szkoda 9c3f76a33b
Prune abandoned forks (#916)
* Address compiler warning

* Prune abandoned fork choice forks

* New approach to pruning

* Wrap some block hashes in a newtype pattern

For increased type safety.

* Add Graphviz chain dump emitter for debugging

* Fix broken test case

* Make prunes_abandoned_forks use real DiskStore

* Mark finalized blocks in the GraphViz output

* Refine debug stringification of Slot and Epoch

Before this commit: print!("{:?}", Slot(123)) == "Slot(\n123\n)".
After this commit: print!("{:?", Slot(123)) == "Slot(123)".

* Simplify build_block()

* Rewrite test case using more composable test primitives

* Working rewritten test case

* Tighten fork prunning test checks

* Add another pruning test case

* Bugfix: Finalized blocks weren't always properly detected

* Pruning: Add pruning_does_not_touch_blocks_prior_to_finalization test case

* Tighten pruning tests: check if heads are tracked properly

* Add a failing test case for a buggy scenario

* Change name of function to a more accurate one

* Fix failing test case

* Test case: Were skipped slots' states pruned?

* Style fix: Simplify dereferencing

* Tighten pruning tests: check if abandoned states are deleted

* Towards atomicity of db ops

* Correct typo

* Prune also skipped slots' states

* New logic for handling skipped states

* Make skipped slots test pass

* Post conflict resolution fixes

* Formatting fixes

* Tests passing

* Block hashes in Graphviz node labels

* Removed unused changes

* Fix bug with states having < SlotsPerHistoricalRoot roots

* Consolidate State/BlockRootsIterator for pruning

* Address review feedback

* Fix a bug in pruning tests

* Detach prune_abandoned_forks() from its object

* Move migrate.rs from store to beacon_chain

* Move forks pruning onto a background thread

* Bugfix: Heads weren't pruned when prune set contained only the head

* Rename: freeze_to_state() -> process_finalization()

* Eliminate redundant function parameter

Co-authored-by: Michael Sproul <michael@sigmaprime.io>
2020-04-20 19:59:56 +10:00
..
beacon_chain Prune abandoned forks (#916) 2020-04-20 19:59:56 +10:00
client Prune abandoned forks (#916) 2020-04-20 19:59:56 +10:00
eth1 Prune abandoned forks (#916) 2020-04-20 19:59:56 +10:00
eth2-libp2p Shifts tests to use random ports (#998) 2020-04-16 17:24:12 +10:00
genesis Use checked arithmetic in types and state proc (#1009) 2020-04-20 12:35:11 +10:00
network move the parent lookup process to a dedicated thread (#906) 2020-03-23 12:07:41 +11:00
rest_api Use global pubkey cache for block processing (#849) 2020-04-06 14:13:19 +10:00
src Prune abandoned forks (#916) 2020-04-20 19:59:56 +10:00
store Prune abandoned forks (#916) 2020-04-20 19:59:56 +10:00
tests Faster attestation production (#838) 2020-03-04 17:10:22 +11:00
version Apply clippy suggestions 2019-03-19 23:20:39 +11:00
websocket_server Improve beacon node logging (#660) 2019-12-06 18:44:38 +11:00
Cargo.toml Fix issues with testnet dir, update docs (#992) 2020-04-17 17:49:29 +10:00