Merge pull request #2001 from lsankar4033/attestation-epoch-consistency

Add self-consistency check to attestation gossip validation
This commit is contained in:
Danny Ryan 2020-08-11 12:59:19 -06:00 committed by GitHub
commit 2a41c516d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -391,6 +391,8 @@ The following validations MUST pass before forwarding the `attestation` on the s
(within a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) -- (within a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) --
i.e. `attestation.data.slot + ATTESTATION_PROPAGATION_SLOT_RANGE >= current_slot >= attestation.data.slot` i.e. `attestation.data.slot + ATTESTATION_PROPAGATION_SLOT_RANGE >= current_slot >= attestation.data.slot`
(a client MAY queue future attestations for processing at the appropriate slot). (a client MAY queue future attestations for processing at the appropriate slot).
- _[REJECT]_ The attestation's epoch matches its target -- i.e. `attestation.data.target.epoch ==
compute_epoch_at_slot(attestation.data.slot)`
- _[REJECT]_ The attestation is unaggregated -- - _[REJECT]_ The attestation is unaggregated --
that is, it has exactly one participating validator (`len([bit in bit attestation.aggregation_bits if bit]) == 1`, i.e. exactly 1 bit is set). that is, it has exactly one participating validator (`len([bit in bit attestation.aggregation_bits if bit]) == 1`, i.e. exactly 1 bit is set).
- _[IGNORE]_ There has been no other valid attestation seen on an attestation subnet - _[IGNORE]_ There has been no other valid attestation seen on an attestation subnet
@ -400,12 +402,15 @@ The following validations MUST pass before forwarding the `attestation` on the s
(via both gossip and non-gossip sources) (via both gossip and non-gossip sources)
(a client MAY queue aggregates for processing once block is retrieved). (a client MAY queue aggregates for processing once block is retrieved).
- _[REJECT]_ The block being voted for (`attestation.data.beacon_block_root`) passes validation. - _[REJECT]_ The block being voted for (`attestation.data.beacon_block_root`) passes validation.
- _[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`
- _[REJECT]_ The current `finalized_checkpoint` is an ancestor of the `block` defined by `attestation.data.beacon_block_root` -- i.e. - _[REJECT]_ The current `finalized_checkpoint` is an ancestor of the `block` defined by `attestation.data.beacon_block_root` -- i.e.
`get_ancestor(store, attestation.data.beacon_block_root, compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)) `get_ancestor(store, attestation.data.beacon_block_root, compute_start_slot_at_epoch(store.finalized_checkpoint.epoch))
== store.finalized_checkpoint.root` == store.finalized_checkpoint.root`
#### Attestations and Aggregation #### Attestations and Aggregation
Attestation broadcasting is grouped into subnets defined by a topic. Attestation broadcasting is grouped into subnets defined by a topic.