From 404bb71c6ed577f6ab192b65a5d89d2c740ad591 Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:21:18 -0500 Subject: [PATCH] Use isGreaterThanOrEqualTo when checking committee index (#8268) --- .../logic/versions/electra/block/BlockProcessorElectra.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java index 44c16a551f0..6e884e07b9c 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java @@ -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 committeeCheckResult = checkCommittees( @@ -408,7 +406,7 @@ private Optional 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 =