377 return exit, nil
378}
379
380func generateVoluntaryExits( 381 bState state.BeaconState,
382 privs []bls.SecretKey,
383 numExits uint64,
422// validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH
423// and validator.effective_balance == MAX_EFFECTIVE_BALANCE
424// )
425func isEligibleForActivationQueue(activationEligibilityEpoch primitives.Epoch, effectiveBalance uint64) bool {426 return activationEligibilityEpoch == params.BeaconConfig().FarFutureEpoch &&
427 effectiveBalance == params.BeaconConfig().MaxEffectiveBalance
428}
474}
475
476// isEligibleForActivation carries out the logic for IsEligibleForActivation*
477func isEligibleForActivation(activationEligibilityEpoch, activationEpoch, finalizedEpoch primitives.Epoch) bool {478 return activationEligibilityEpoch <= finalizedEpoch &&
479 activationEpoch == params.BeaconConfig().FarFutureEpoch
480}
477// This assumes that a lock is already held on BeaconState.
478//
479// WARNING: This function does not work with the multi-value slice feature.
480func (b *BeaconState) stateRootAtIndex(idx uint64) ([32]byte, error) {481 if uint64(len(b.stateRoots)) <= idx {
482 return [32]byte{}, errors.Wrapf(consensus_types.ErrOutOfBounds, "state root index %d does not exist", idx)
483 }
334 return b.balanceAtIndex(idx)
335}
336
337func (b *BeaconState) balanceAtIndex(idx primitives.ValidatorIndex) (uint64, error) {338 if features.Get().EnableExperimentalState {
339 if b.balancesMultiValue == nil {
340 return 0, nil
Methods or fields of struct that have names different only by capitalization could be confusing.
type SomeType struct {
// actual build system to be inferred, based on the `BuildSystem` passed by user
buildSystem string
// name of the build system to use
BuildSystem string
}
type SomeType struct {
// actual build system to be inferred, based on the `BuildSystem` passed by user
internalBuildSystem string
// name of the build system to use
BuildSystem string
}