lighthouse/beacon_node
Paul Hauner 1ef4f0ea12 Add gossip conditions from spec v0.12.3 (#1667)
## Issue Addressed

NA

## Proposed Changes

There are four new conditions introduced in v0.12.3:

 1. _[REJECT]_ The attestation's epoch matches its target -- i.e. `attestation.data.target.epoch ==
  compute_epoch_at_slot(attestation.data.slot)`
1. _[REJECT]_ The attestation's target block is an ancestor of the block named in the LMD vote -- i.e.
  `get_ancestor(store, attestation.data.beacon_block_root, compute_start_slot_at_epoch(attestation.data.target.epoch)) == attestation.data.target.root`
1. _[REJECT]_ The committee index is within the expected range -- i.e. `data.index < get_committee_count_per_slot(state, data.target.epoch)`.
1. _[REJECT]_ The number of aggregation bits matches the committee size -- i.e.
  `len(attestation.aggregation_bits) == len(get_beacon_committee(state, data.slot, data.index))`.

This PR implements new logic to suit (1) and (2). Tests are added for (3) and (4), although they were already implicitly enforced.

## Additional Info

- There's a bit of edge-case with target root verification that I raised here: https://github.com/ethereum/eth2.0-specs/pull/2001#issuecomment-699246659
- I've had to add an `--ignore` to `cargo audit` to get CI to pass. See https://github.com/sigp/lighthouse/issues/1669
2020-09-27 20:59:40 +00:00
..
beacon_chain Add gossip conditions from spec v0.12.3 (#1667) 2020-09-27 20:59:40 +00:00
client Beacon node does not quit on eth1 errors (#1663) 2020-09-25 00:43:45 +00:00
eth1 Beacon node does not quit on eth1 errors (#1663) 2020-09-25 00:43:45 +00:00
eth2_libp2p Remove banned peers from DHT and track IPs (#1656) 2020-09-25 01:52:39 +00:00
genesis Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
network Add gossip conditions from spec v0.12.3 (#1667) 2020-09-27 20:59:40 +00:00
operation_pool Lighthouse crate v0.2.0 bump (#1450) 2020-08-06 03:43:05 +00:00
rest_api minimize the number of places we are calling update_pubkey_cache (#1626) 2020-09-23 01:19:56 +00:00
src Add --staking flag (#1641) 2020-09-23 01:19:58 +00:00
store Update LevelDB to v0.8.6, removing patch (#1636) 2020-09-21 11:53:53 +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 Prepare for v0.2.12 (#1672) 2020-09-26 06:35:45 +00:00