lighthouse-pulse/beacon_node/beacon_chain/src
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
..
attestation_verification.rs Add gossip conditions from spec v0.12.3 (#1667) 2020-09-27 20:59:40 +00:00
beacon_chain.rs Update state before producing attestation (#1596) 2020-09-08 11:25:43 +00:00
beacon_fork_choice_store.rs Apply store refactor to new fork choice 2020-06-17 15:20:44 +10:00
beacon_snapshot.rs Add no-copy block processing cache (#863) 2020-04-06 10:53:33 +10:00
block_verification.rs Fix bad assumption when checking finalized descendant (#1629) 2020-09-18 05:14:31 +00:00
builder.rs Apply hotfix for inconsistent head (#1639) 2020-09-22 02:06:10 +00:00
chain_config.rs Set default max skips to 700 (#1542) 2020-08-18 09:27:04 +00:00
errors.rs Fix bug in database pruning (#1564) 2020-08-26 00:01:06 +00:00
eth1_chain.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
events.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
head_tracker.rs Race condition fix + Reliability improvements around forks pruning (#1132) 2020-05-16 13:23:32 +10:00
lib.rs Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
metrics.rs v0.12 fork choice update (#1229) 2020-06-17 11:10:22 +10:00
migrate.rs Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
naive_aggregation_pool.rs Push naive attestations into op pool (#1466) 2020-08-06 07:26:46 +00:00
observed_attestations.rs Move long-running tests to dbg (#1137) 2020-05-13 10:55:02 +10:00
observed_attesters.rs Fix clippy warnings (#1385) 2020-07-23 14:18:00 +00:00
observed_block_producers.rs Add attestation gossip pre-verification (#983) 2020-05-06 21:42:56 +10:00
observed_operations.rs Process exits and slashings off the network (#1253) 2020-06-18 21:06:34 +10:00
persisted_beacon_chain.rs Apply hotfix for inconsistent head (#1639) 2020-09-22 02:06:10 +00:00
persisted_fork_choice.rs v0.12 fork choice update (#1229) 2020-06-17 11:10:22 +10:00
shuffling_cache.rs Optimize attestation processing (#841) 2020-03-05 17:19:35 +11:00
snapshot_cache.rs Support multiple BLS implementations (#1335) 2020-07-25 02:03:18 +00:00
test_utils.rs Alternative (to BeaconChainHarness) BeaconChain testing API (#1380) 2020-08-26 09:24:55 +00:00
timeout_rw_lock.rs Add timeouts to canonical head rwlock (#759) 2020-01-06 17:30:37 +11:00
validator_pubkey_cache.rs Support multiple BLS implementations (#1335) 2020-07-25 02:03:18 +00:00