Skip to content

Commit

Permalink
Early fail on 0 active validators when computing sync committees (#7585)
Browse files Browse the repository at this point in the history
  • Loading branch information
zilm13 committed Oct 9, 2023
1 parent ef391e9 commit 121c148
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public IntList getNextSyncCommitteeIndices(final BeaconState state) {
final UInt64 epoch = getCurrentEpoch(state).plus(1);
final IntList activeValidatorIndices = getActiveValidatorIndices(state, epoch);
final int activeValidatorCount = activeValidatorIndices.size();
checkArgument(activeValidatorCount > 0, "Provided state has no active validators");

final Bytes32 seed = getSeed(state, epoch, Domain.SYNC_COMMITTEE);
int i = 0;
final SszList<Validator> validators = state.getValidators();
Expand Down

0 comments on commit 121c148

Please sign in to comment.