Skip to content

Commit

Permalink
use same helper for individual attestations as well
Browse files Browse the repository at this point in the history
  • Loading branch information
etan-status committed Nov 20, 2023
1 parent 85b8592 commit 56e1f67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions beacon_chain/gossip_processing/gossip_validation.nim
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,8 @@ proc validateAttestation*(
# This uses the same epochRef as data.target.epoch, because the attestation's
# epoch matches its target and attestation.data.target.root is an ancestor of
# attestation.data.beacon_block_root.
if not (attestation.aggregation_bits.lenu64 == get_beacon_committee_len(
shufflingRef, attestation.data.slot, committee_index)):
if not attestation.aggregation_bits.compatible_with_shuffling(
shufflingRef, slot, committee_index):
return pool.checkedReject(
"Attestation: number of aggregation bits and committee size mismatch")

Expand Down Expand Up @@ -890,7 +890,8 @@ proc validateAggregate*(
idx.get()
if not aggregate.aggregation_bits.compatible_with_shuffling(
shufflingRef, slot, committee_index):
return pool.checkedReject("Aggregate: invalid aggregation bits")
return pool.checkedReject(
"Aggregate: number of aggregation bits and committee size mismatch")

if checkCover and
pool[].covers(aggregate.data, aggregate.aggregation_bits):
Expand Down

0 comments on commit 56e1f67

Please sign in to comment.