lighthouse/consensus
Michael Sproul 5828ff1204 Implement slasher (#1567)
This is an implementation of a slasher that lives inside the BN and can be enabled via `lighthouse bn --slasher`.

Features included in this PR:

- [x] Detection of attester slashing conditions (double votes, surrounds existing, surrounded by existing)
- [x] Integration into Lighthouse's attestation verification flow
- [x] Detection of proposer slashing conditions
- [x] Extraction of attestations from blocks as they are verified
- [x] Compression of chunks
- [x] Configurable history length
- [x] Pruning of old attestations and blocks
- [x] More tests

Future work:

* Focus on a slice of history separate from the most recent N epochs (e.g. epochs `current - K` to `current - M`)
* Run out-of-process
* Ingest attestations from the chain without a resync

Design notes are here https://hackmd.io/@sproul/HJSEklmPL
2020-11-23 03:43:22 +00:00
..
cached_tree_hash Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
fork_choice Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
int_to_bytes Update external deps (#1711) 2020-10-05 08:22:19 +00:00
merkle_proof Implement matches! macro (#1777) 2020-10-15 21:42:43 +00:00
proto_array Update external deps (#1711) 2020-10-05 08:22:19 +00:00
safe_arith Remove saturating arith from state_processing (#1644) 2020-09-25 05:18:21 +00:00
serde_utils Update external deps (#1711) 2020-10-05 08:22:19 +00:00
ssz Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
ssz_derive Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
ssz_types Avoid allocations on VariableList (#1921) 2020-11-17 04:28:40 +00:00
state_processing Ensure deposit signatures do not use aggregate functions (#1935) 2020-11-20 03:37:20 +00:00
swap_or_not_shuffle Update external deps (#1711) 2020-10-05 08:22:19 +00:00
tree_hash Address clippy lints, panic in ssz_derive on overflow (#1714) 2020-10-25 23:27:39 +00:00
tree_hash_derive Update external deps (#1711) 2020-10-05 08:22:19 +00:00
types Implement slasher (#1567) 2020-11-23 03:43:22 +00:00