mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-14 05:58:19 +00:00
Fix current epoch committee count (#2099)
* fix current epoch committee count * prev epoch
This commit is contained in:
parent
839845645c
commit
761f3352a0
@ -77,12 +77,12 @@ func EpochCommitteeCount(activeValidatorCount uint64) uint64 {
|
|||||||
// """
|
// """
|
||||||
// current_active_validators = get_active_validator_indices(
|
// current_active_validators = get_active_validator_indices(
|
||||||
// state.validator_registry,
|
// state.validator_registry,
|
||||||
// state.current_calculation_epoch,
|
// get_current_epoch(state),
|
||||||
// )
|
// )
|
||||||
// return get_epoch_committee_count(len(current_active_validators)
|
// return get_epoch_committee_count(len(current_active_validators)
|
||||||
func CurrentEpochCommitteeCount(state *pb.BeaconState) uint64 {
|
func CurrentEpochCommitteeCount(state *pb.BeaconState) uint64 {
|
||||||
currActiveValidatorIndices := ActiveValidatorIndices(
|
currActiveValidatorIndices := ActiveValidatorIndices(
|
||||||
state.ValidatorRegistry, state.CurrentShufflingEpoch)
|
state.ValidatorRegistry, CurrentEpoch(state))
|
||||||
return EpochCommitteeCount(uint64(len(currActiveValidatorIndices)))
|
return EpochCommitteeCount(uint64(len(currActiveValidatorIndices)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,12 +96,12 @@ func CurrentEpochCommitteeCount(state *pb.BeaconState) uint64 {
|
|||||||
// """
|
// """
|
||||||
// previous_active_validators = get_active_validator_indices(
|
// previous_active_validators = get_active_validator_indices(
|
||||||
// state.validator_registry,
|
// state.validator_registry,
|
||||||
// state.previous_calculation_epoch,
|
// state.previous_epoch,
|
||||||
// )
|
// )
|
||||||
// return get_epoch_committee_count(len(previous_active_validators))
|
// return get_epoch_committee_count(len(previous_active_validators))
|
||||||
func PrevEpochCommitteeCount(state *pb.BeaconState) uint64 {
|
func PrevEpochCommitteeCount(state *pb.BeaconState) uint64 {
|
||||||
prevActiveValidatorIndices := ActiveValidatorIndices(
|
prevActiveValidatorIndices := ActiveValidatorIndices(
|
||||||
state.ValidatorRegistry, state.PreviousShufflingEpoch)
|
state.ValidatorRegistry, PrevEpoch(state))
|
||||||
return EpochCommitteeCount(uint64(len(prevActiveValidatorIndices)))
|
return EpochCommitteeCount(uint64(len(prevActiveValidatorIndices)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user