Skip to content

Commit

Permalink
Use isGreaterThanOrEqualTo when checking committee index (Consensys#8268
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jtraglia authored Apr 30, 2024
1 parent b27ca50 commit 404bb71
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,6 @@ protected void assertAttestationValid(
final UInt64 committeeCountPerSlot =
beaconStateAccessors.getCommitteeCountPerSlot(
state, attestation.getData().getTarget().getEpoch());
beaconStateAccessors.getCommitteeCountPerSlot(
state, attestation.getData().getTarget().getEpoch());
final SszBitlist aggregationBits = attestation.getAggregationBits();
final Optional<OperationInvalidReason> committeeCheckResult =
checkCommittees(
Expand All @@ -408,7 +406,7 @@ private Optional<OperationInvalidReason> checkCommittees(
final SszBitlist aggregationBits) {
int participantsCount = 0;
for (final UInt64 committeeIndex : committeeIndices) {
if (committeeIndex.isGreaterThan(committeeCountPerSlot)) {
if (committeeIndex.isGreaterThanOrEqualTo(committeeCountPerSlot)) {
return Optional.of(AttestationInvalidReason.COMMITTEE_INDEX_TOO_HIGH);
}
final IntList committee =
Expand Down

0 comments on commit 404bb71

Please sign in to comment.