Merge pull request #2030 from lsankar4033/more_gossip_validations

Two more gossip validations
This commit is contained in:
Danny Ryan 2020-09-10 14:40:06 -06:00 committed by GitHub
commit e5f110a37b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -383,6 +383,7 @@ The `beacon_attestation_{subnet_id}` topics are used to propagate unaggregated a
to the subnet `subnet_id` (typically beacon and persistent committees) to be aggregated before being gossiped to `beacon_aggregate_and_proof`. to the subnet `subnet_id` (typically beacon and persistent committees) to be aggregated before being gossiped to `beacon_aggregate_and_proof`.
The following validations MUST pass before forwarding the `attestation` on the subnet. The following validations MUST pass before forwarding the `attestation` on the subnet.
- _[REJECT]_ The committee index is within the expected range -- i.e. `data.index < get_committee_count_per_slot(state, data.target.epoch)`.
- _[REJECT]_ The attestation is for the correct subnet -- - _[REJECT]_ The attestation is for the correct subnet --
i.e. `compute_subnet_for_attestation(committees_per_slot, attestation.data.slot, attestation.data.index) == subnet_id`, i.e. `compute_subnet_for_attestation(committees_per_slot, attestation.data.slot, attestation.data.index) == subnet_id`,
where `committees_per_slot = get_committee_count_per_slot(state, attestation.data.target.epoch)`, where `committees_per_slot = get_committee_count_per_slot(state, attestation.data.target.epoch)`,
@ -395,6 +396,8 @@ The following validations MUST pass before forwarding the `attestation` on the s
compute_epoch_at_slot(attestation.data.slot)` 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 for bit in attestation.aggregation_bits if bit]) == 1`, i.e. exactly 1 bit is set). that is, it has exactly one participating validator (`len([bit for bit in attestation.aggregation_bits if bit]) == 1`, i.e. exactly 1 bit is set).
- _[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))`.
- _[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
that has an identical `attestation.data.target.epoch` and participating validator index. that has an identical `attestation.data.target.epoch` and participating validator index.
- _[REJECT]_ The signature of `attestation` is valid. - _[REJECT]_ The signature of `attestation` is valid.
@ -410,7 +413,6 @@ The following validations MUST pass before forwarding the `attestation` on the s
#### 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.