Documentation ¶
Index ¶
- Variables
- func CommitteeCount(activeValidators uint64) uint64
- type Balances
- type BalancesState
- type RegistryState
- type RegistryUpdateEpochProcess
- type RegistryUpdatesFeature
- type ValidatorRegistry
- type ValidatorsState
- func (state *ValidatorsState) ComputeActiveIndexRoot(epoch Epoch) Root
- func (state *ValidatorsState) EffectiveBalance(index ValidatorIndex) Gwei
- func (state *ValidatorsState) ExitQueueEnd(epoch Epoch) Epoch
- func (state *ValidatorsState) FilterUnslashed(indices []ValidatorIndex) []ValidatorIndex
- func (state *ValidatorsState) GetActiveValidatorCount(epoch Epoch) (count uint64)
- func (state *ValidatorsState) GetActiveValidatorIndices(epoch Epoch) RegistryIndices
- func (state *ValidatorsState) GetAttestersStake(statuses []AttesterStatus, mask AttesterFlag) (out Gwei)
- func (state *ValidatorsState) GetChurnLimit(epoch Epoch) uint64
- func (state *ValidatorsState) GetCommitteeCountAtSlot(slot Slot) uint64
- func (state *ValidatorsState) GetIndicesToSlash(withdrawal Epoch) (out []ValidatorIndex)
- func (state *ValidatorsState) GetTotalStake() (out Gwei)
- func (state *ValidatorsState) GetTotalStakedBalance(epoch Epoch) (sum Gwei)
- func (state *ValidatorsState) IsActive(index ValidatorIndex, epoch Epoch) bool
- func (state *ValidatorsState) IsSlashed(index ValidatorIndex) bool
- func (state *ValidatorsState) IsValidIndex(index ValidatorIndex) bool
- func (state *ValidatorsState) ProcessActivationQueue(currentEpoch Epoch, finalizedEpoch Epoch)
- func (state *ValidatorsState) Pubkey(index ValidatorIndex) BLSPubkey
- func (state *ValidatorsState) SumEffectiveBalanceOf(indices []ValidatorIndex) (sum Gwei)
- func (state *ValidatorsState) Validator(index ValidatorIndex) *Validator
- func (state *ValidatorsState) ValidatorCount() uint64
- func (state *ValidatorsState) ValidatorIndex(pubkey BLSPubkey) (index ValidatorIndex, exists bool)
- func (state *ValidatorsState) WithdrawableEpoch(index ValidatorIndex) Epoch
Constants ¶
This section is empty.
Variables ¶
View Source
var RegistryIndicesSSZ = zssz.GetSSZ((*RegistryIndices)(nil))
View Source
var ValidatorRegistrySSZ = zssz.GetSSZ((*ValidatorRegistry)(nil))
Functions ¶
func CommitteeCount ¶
Types ¶
type BalancesState ¶
type BalancesState struct {
Balances Balances
}
func (*BalancesState) ApplyDeltas ¶
func (state *BalancesState) ApplyDeltas(deltas *Deltas)
func (*BalancesState) DecreaseBalance ¶
func (state *BalancesState) DecreaseBalance(index ValidatorIndex, delta Gwei)
func (*BalancesState) GetBalance ¶
func (state *BalancesState) GetBalance(index ValidatorIndex) Gwei
func (*BalancesState) IncreaseBalance ¶
func (state *BalancesState) IncreaseBalance(index ValidatorIndex, delta Gwei)
type RegistryState ¶
type RegistryState struct { ValidatorsState BalancesState }
Validator registry
func (*RegistryState) AddNewValidator ¶
func (state *RegistryState) AddNewValidator(pubkey BLSPubkey, withdrawalCreds Root, balance Gwei)
func (*RegistryState) InitiateValidatorExit ¶
func (state *RegistryState) InitiateValidatorExit(currentEpoch Epoch, index ValidatorIndex)
Initiate the exit of the validator of the given index
func (*RegistryState) UpdateEffectiveBalances ¶
func (state *RegistryState) UpdateEffectiveBalances()
Update effective balances with hysteresis
type RegistryUpdateEpochProcess ¶
type RegistryUpdateEpochProcess interface {
ProcessEpochRegistryUpdates()
}
type RegistryUpdatesFeature ¶
type RegistryUpdatesFeature struct { State *RegistryState Meta interface { meta.Versioning meta.Finality meta.ActivationExit } }
func (*RegistryUpdatesFeature) ProcessEpochRegistryUpdates ¶
func (f *RegistryUpdatesFeature) ProcessEpochRegistryUpdates()
type ValidatorRegistry ¶
type ValidatorRegistry []*Validator
func (*ValidatorRegistry) Limit ¶
func (_ *ValidatorRegistry) Limit() uint64
type ValidatorsState ¶
type ValidatorsState struct {
Validators ValidatorRegistry
}
func (*ValidatorsState) ComputeActiveIndexRoot ¶
func (state *ValidatorsState) ComputeActiveIndexRoot(epoch Epoch) Root
func (*ValidatorsState) EffectiveBalance ¶
func (state *ValidatorsState) EffectiveBalance(index ValidatorIndex) Gwei
func (*ValidatorsState) ExitQueueEnd ¶
func (state *ValidatorsState) ExitQueueEnd(epoch Epoch) Epoch
func (*ValidatorsState) FilterUnslashed ¶
func (state *ValidatorsState) FilterUnslashed(indices []ValidatorIndex) []ValidatorIndex
Filters a slice in-place. Only keeps the unslashed validators. If input is sorted, then the result will be sorted.
func (*ValidatorsState) GetActiveValidatorCount ¶
func (state *ValidatorsState) GetActiveValidatorCount(epoch Epoch) (count uint64)
func (*ValidatorsState) GetActiveValidatorIndices ¶
func (state *ValidatorsState) GetActiveValidatorIndices(epoch Epoch) RegistryIndices
func (*ValidatorsState) GetAttestersStake ¶ added in v0.8.4
func (state *ValidatorsState) GetAttestersStake(statuses []AttesterStatus, mask AttesterFlag) (out Gwei)
func (*ValidatorsState) GetChurnLimit ¶
func (state *ValidatorsState) GetChurnLimit(epoch Epoch) uint64
func (*ValidatorsState) GetCommitteeCountAtSlot ¶ added in v0.9.0
func (state *ValidatorsState) GetCommitteeCountAtSlot(slot Slot) uint64
func (*ValidatorsState) GetIndicesToSlash ¶
func (state *ValidatorsState) GetIndicesToSlash(withdrawal Epoch) (out []ValidatorIndex)
func (*ValidatorsState) GetTotalStake ¶ added in v0.8.4
func (state *ValidatorsState) GetTotalStake() (out Gwei)
func (*ValidatorsState) GetTotalStakedBalance ¶
func (state *ValidatorsState) GetTotalStakedBalance(epoch Epoch) (sum Gwei)
Return the total balance sum (1 Gwei minimum to avoid divisions by zero.)
func (*ValidatorsState) IsActive ¶
func (state *ValidatorsState) IsActive(index ValidatorIndex, epoch Epoch) bool
func (*ValidatorsState) IsSlashed ¶
func (state *ValidatorsState) IsSlashed(index ValidatorIndex) bool
func (*ValidatorsState) IsValidIndex ¶
func (state *ValidatorsState) IsValidIndex(index ValidatorIndex) bool
func (*ValidatorsState) ProcessActivationQueue ¶
func (state *ValidatorsState) ProcessActivationQueue(currentEpoch Epoch, finalizedEpoch Epoch)
func (*ValidatorsState) Pubkey ¶
func (state *ValidatorsState) Pubkey(index ValidatorIndex) BLSPubkey
func (*ValidatorsState) SumEffectiveBalanceOf ¶
func (state *ValidatorsState) SumEffectiveBalanceOf(indices []ValidatorIndex) (sum Gwei)
Return the combined effective balance of an array of validators. (1 Gwei minimum to avoid divisions by zero.)
func (*ValidatorsState) Validator ¶
func (state *ValidatorsState) Validator(index ValidatorIndex) *Validator
func (*ValidatorsState) ValidatorCount ¶
func (state *ValidatorsState) ValidatorCount() uint64
func (*ValidatorsState) ValidatorIndex ¶
func (state *ValidatorsState) ValidatorIndex(pubkey BLSPubkey) (index ValidatorIndex, exists bool)
func (*ValidatorsState) WithdrawableEpoch ¶
func (state *ValidatorsState) WithdrawableEpoch(index ValidatorIndex) Epoch
Click to show internal directories.
Click to hide internal directories.