diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationSchema.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationSchema.java index 4dde0a0efae..f3b45e20c0f 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationSchema.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/AttestationSchema.java @@ -41,9 +41,9 @@ default SszBitlist createEmptyAggregationBits() { return bitsSchema.ofBits(Math.toIntExact(bitsSchema.getMaxLength())); } - default SszBitlist createAggregationBitsOf(final int... indices) { + default SszBitlist createAggregationBitsOf(final int size, final int... indices) { final SszBitlistSchema bitsSchema = getAggregationBitsSchema(); - return bitsSchema.ofBits(Math.toIntExact(bitsSchema.getMaxLength()), indices); + return bitsSchema.ofBits(size, indices); } default Optional createEmptyCommitteeBits() { diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/util/AttestationUtilElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/util/AttestationUtilElectra.java index ed17d20c082..c248a7abb12 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/util/AttestationUtilElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/util/AttestationUtilElectra.java @@ -262,7 +262,7 @@ private SszBitlist getSingleAttestationAggregationBits( .toVersionElectra() .orElseThrow() .getAttestationSchema() - .createAggregationBitsOf(validatorCommitteeBit); + .createAggregationBitsOf(committee.size(), validatorCommitteeBit); } private UInt64 getValidatorIndexFromAttestation(