diff --git a/beacon-chain/core/helpers/payload_attestation.go b/beacon-chain/core/helpers/payload_attestation.go index f91003cf4af9..e7f643be62fd 100644 --- a/beacon-chain/core/helpers/payload_attestation.go +++ b/beacon-chain/core/helpers/payload_attestation.go @@ -76,7 +76,7 @@ func GetPayloadTimelinessCommittee(ctx context.Context, state state.ReadOnlyBeac } committeesPerSlot := math.LargestPowerOfTwo(math.Min(SlotCommitteeCount(activeCount), fieldparams.PTCSize)) membersPerCommittee := fieldparams.PTCSize / committeesPerSlot - for i := uint64(0); i <= committeesPerSlot; i++ { + for i := uint64(0); i < committeesPerSlot; i++ { committee, err := BeaconCommitteeFromState(ctx, state, slot, primitives.CommitteeIndex(i)) if err != nil { return nil, err diff --git a/beacon-chain/core/helpers/payload_attestation_test.go b/beacon-chain/core/helpers/payload_attestation_test.go index 5b9abda5817b..aa2c58c98408 100644 --- a/beacon-chain/core/helpers/payload_attestation_test.go +++ b/beacon-chain/core/helpers/payload_attestation_test.go @@ -84,6 +84,7 @@ func TestGetPayloadTimelinessCommittee(t *testing.T) { ptc, err := helpers.GetPayloadTimelinessCommittee(ctx, state, state.Slot()) require.NoError(t, err) + require.Equal(t, fieldparams.PTCSize, len(ptc)) committee1, err := helpers.BeaconCommitteeFromState(ctx, state, state.Slot(), 0) require.NoError(t, err)