Skip to content

Commit

Permalink
add final
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 18, 2023
1 parent 173c4eb commit 3f98c8e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ public UInt64 getPreviousEpoch(BeaconState state) {
return currentEpoch.equals(GENESIS_EPOCH) ? GENESIS_EPOCH : currentEpoch.minus(UInt64.ONE);
}

public UInt64 getValidatorChurnLimit(BeaconState state) {
public UInt64 getValidatorChurnLimit(final BeaconState state) {
final int activeValidatorCount =
getActiveValidatorIndices(state, getCurrentEpoch(state)).size();
return getValidatorChurnLimit(activeValidatorCount);
}

public UInt64 getValidatorActivationChurnLimit(BeaconState state) {
return getValidatorChurnLimit(state);
}

public UInt64 getValidatorChurnLimit(final int activeValidatorCount) {
return UInt64.valueOf(config.getMinPerEpochChurnLimit())
.max(UInt64.valueOf(activeValidatorCount / config.getChurnLimitQuotient()));
}

public UInt64 getValidatorActivationChurnLimit(final BeaconState state) {
return getValidatorChurnLimit(state);
}

public Optional<BLSPublicKey> getValidatorPubKey(BeaconState state, UInt64 validatorIndex) {
if (state.getValidators().size() <= validatorIndex.longValue()
|| validatorIndex.longValue() < 0) {
Expand Down

0 comments on commit 3f98c8e

Please sign in to comment.