registry

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func CommitteeCount(activeValidators uint64) uint64

Types

type Balances

type Balances []Gwei

func (*Balances) Limit

func (_ *Balances) Limit() uint64

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL