Skip to content

Commit 121c148

Browse files
authored
Early fail on 0 active validators when computing sync committees (#7585)
1 parent ef391e9 commit 121c148

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/helpers/BeaconStateAccessorsAltair.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public IntList getNextSyncCommitteeIndices(final BeaconState state) {
101101
final UInt64 epoch = getCurrentEpoch(state).plus(1);
102102
final IntList activeValidatorIndices = getActiveValidatorIndices(state, epoch);
103103
final int activeValidatorCount = activeValidatorIndices.size();
104+
checkArgument(activeValidatorCount > 0, "Provided state has no active validators");
105+
104106
final Bytes32 seed = getSeed(state, epoch, Domain.SYNC_COMMITTEE);
105107
int i = 0;
106108
final SszList<Validator> validators = state.getValidators();

0 commit comments

Comments
 (0)