Compare commits

...

1 Commits

Author SHA1 Message Date
terence tsao
4587d95037 Validate that each committee bitfield in an aggregate contains at least one non-zero bit 2024-11-25 06:51:07 -08:00
3 changed files with 7 additions and 1 deletions

View File

@@ -91,6 +91,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- corrects nil check on some interface attestation types
- temporary solution to handling electra attesation and attester_slashing events. [pr](14655)
- Diverse log improvements and comment additions.
- Validate that each committee bitfield in an aggregate contains at least one non-zero bit
### Security

View File

@@ -765,6 +765,8 @@ func TestServer_ListIndexedAttestationsElectra(t *testing.T) {
cb := primitives.NewAttestationCommitteeBits()
cb.SetBitAt(0, true)
blockExample := util.NewBeaconBlockElectra()
ab := bitfield.NewBitlist(128 / uint64(params.BeaconConfig().SlotsPerEpoch))
ab.SetBitAt(0, true)
blockExample.Block.Body.Attestations = []*ethpb.AttestationElectra{
{
Signature: make([]byte, fieldparams.BLSSignatureLength),
@@ -778,7 +780,7 @@ func TestServer_ListIndexedAttestationsElectra(t *testing.T) {
},
Slot: i,
},
AggregationBits: bitfield.NewBitlist(128 / uint64(params.BeaconConfig().SlotsPerEpoch)),
AggregationBits: ab,
CommitteeBits: cb,
},
}

View File

@@ -113,6 +113,9 @@ func AttestingIndices(att ethpb.Att, committees ...[]primitives.ValidatorIndex)
committeeAttesters = append(committeeAttesters, uint64(vi))
}
}
if len(committeeAttesters) == 0 {
return nil, fmt.Errorf("no attesting indices found in committee %v", c)
}
attesters = append(attesters, committeeAttesters...)
committeeOffset += len(c)
}