From 56e1f6753b24cebf769b01885c695c58eb2023a3 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sun, 19 Nov 2023 23:12:53 -0800 Subject: [PATCH] use same helper for individual attestations as well --- beacon_chain/gossip_processing/gossip_validation.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index d2ac5aedbf..0d55c25aac 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -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") @@ -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):