Documentation ¶
Index ¶
- Constants
- Variables
- type BeaconState
- func (b *BeaconState) AddCurrentEpochAtteastation(attestation *cltypes.PendingAttestation)
- func (b *BeaconState) AddCurrentEpochParticipationFlags(flags cltypes.ParticipationFlags)
- func (b *BeaconState) AddEth1DataVote(vote *cltypes.Eth1Data)
- func (b *BeaconState) AddHistoricalRoot(root libcommon.Hash)
- func (b *BeaconState) AddHistoricalSummary(summary *cltypes.HistoricalSummary)
- func (b *BeaconState) AddInactivityScore(score uint64)
- func (b *BeaconState) AddPreviousEpochAttestation(attestation *cltypes.PendingAttestation)
- func (b *BeaconState) AddPreviousEpochParticipationFlags(flags cltypes.ParticipationFlags)
- func (b *BeaconState) AddValidator(validator *cltypes.Validator, balance uint64)
- func (b *BeaconState) Balances() []uint64
- func (b *BeaconState) BaseReward(index uint64) (uint64, error)
- func (b *BeaconState) BaseRewardPerIncrement() uint64
- func (b *BeaconState) BeaconConfig() *clparams.BeaconChainConfig
- func (b *BeaconState) BlockRoot() ([32]byte, error)
- func (b *BeaconState) BlockRoots() [blockRootsLength]libcommon.Hash
- func (b *BeaconState) Clone() clonable.Clonable
- func (b *BeaconState) CommitteeCount(epoch uint64) uint64
- func (b *BeaconState) ComputeActivationExitEpoch(epoch uint64) uint64
- func (b *BeaconState) ComputeCommittee(indicies []uint64, seed libcommon.Hash, index, count uint64, ...) ([]uint64, error)
- func (b *BeaconState) ComputeNextSyncCommittee() (*cltypes.SyncCommittee, error)
- func (b *BeaconState) ComputeProposerIndex(indices []uint64, seed [32]byte) (uint64, error)
- func (b *BeaconState) ComputeShuffledIndex(ind, ind_count uint64, seed [32]byte, preInputs [][32]byte, ...) (uint64, error)
- func (b *BeaconState) ComputeShuffledIndexPreInputs(seed [32]byte) [][32]byte
- func (b *BeaconState) ComputeTimestampAtSlot(slot uint64) uint64
- func (b *BeaconState) Copy() *BeaconState
- func (b *BeaconState) CurrentEpochAttestations() []*cltypes.PendingAttestation
- func (b *BeaconState) CurrentJustifiedCheckpoint() *cltypes.Checkpoint
- func (b *BeaconState) CurrentSyncCommittee() *cltypes.SyncCommittee
- func (b *BeaconState) DecodeSSZ(buf []byte) error
- func (b *BeaconState) DecodeSSZWithVersion(buf []byte, version int) error
- func (b *BeaconState) DecreaseBalance(index, delta uint64) error
- func (b *BeaconState) EligibleValidatorsIndicies() (eligibleValidators []uint64)
- func (b *BeaconState) EncodeSSZ(buf []byte) ([]byte, error)
- func (b *BeaconState) EncodingSizeSSZ() (size int)
- func (b *BeaconState) Epoch() uint64
- func (b *BeaconState) EpochParticipation(currentEpoch bool) cltypes.ParticipationFlagsList
- func (b *BeaconState) EpochParticipationForValidatorIndex(isCurrentEpoch bool, index int) cltypes.ParticipationFlags
- func (b *BeaconState) Eth1Data() *cltypes.Eth1Data
- func (b *BeaconState) Eth1DataVotes() []*cltypes.Eth1Data
- func (b *BeaconState) Eth1DepositIndex() uint64
- func (b *BeaconState) ExpectedWithdrawals() []*types.Withdrawal
- func (b *BeaconState) FinalityDelay() uint64
- func (b *BeaconState) FinalizedCheckpoint() *cltypes.Checkpoint
- func (b *BeaconState) Fork() *cltypes.Fork
- func (b *BeaconState) GenesisTime() uint64
- func (b *BeaconState) GenesisValidatorsRoot() libcommon.Hash
- func (b *BeaconState) GetActiveValidatorsIndices(epoch uint64) (indicies []uint64)
- func (b *BeaconState) GetAttestationParticipationFlagIndicies(data *cltypes.AttestationData, inclusionDelay uint64) ([]uint8, error)
- func (b *BeaconState) GetAttestingIndicies(attestation *cltypes.AttestationData, aggregationBits []byte, ...) ([]uint64, error)
- func (b *BeaconState) GetBeaconCommitee(slot, committeeIndex uint64) ([]uint64, error)
- func (b *BeaconState) GetBeaconProposerIndex() (uint64, error)
- func (b *BeaconState) GetBlockRoot(epoch uint64) (libcommon.Hash, error)
- func (b *BeaconState) GetBlockRootAtSlot(slot uint64) (libcommon.Hash, error)
- func (b *BeaconState) GetDomain(domainType [4]byte, epoch uint64) ([]byte, error)
- func (b *BeaconState) GetEpochAtSlot(slot uint64) uint64
- func (b *BeaconState) GetIndexedAttestation(attestation *cltypes.Attestation, attestingIndicies []uint64) (*cltypes.IndexedAttestation, error)
- func (b *BeaconState) GetRandaoMixes(epoch uint64) [32]byte
- func (b *BeaconState) GetSeed(epoch uint64, domain [4]byte) libcommon.Hash
- func (b *BeaconState) GetTotalActiveBalance() uint64
- func (b *BeaconState) GetTotalBalance(validatorSet []uint64) (uint64, error)
- func (b *BeaconState) GetTotalSlashingAmount() (t uint64)
- func (b *BeaconState) GetUnslashedParticipatingIndices(flagIndex int, epoch uint64) (validatorSet []uint64, err error)
- func (b *BeaconState) GetValidatorChurnLimit() uint64
- func (b *BeaconState) HashSSZ() ([32]byte, error)
- func (b *BeaconState) HistoricalRoots() []libcommon.Hash
- func (b *BeaconState) HistoricalSummaries() []*cltypes.HistoricalSummary
- func (b *BeaconState) InactivityLeaking() bool
- func (b *BeaconState) InactivityScores() []uint64
- func (b *BeaconState) IncreaseBalance(index, delta uint64) error
- func (b *BeaconState) InitiateValidatorExit(index uint64) error
- func (b *BeaconState) IsMergeTransitionComplete() bool
- func (b *BeaconState) IsUnslashedParticipatingIndex(epoch, index uint64, flagIdx int) bool
- func (b *BeaconState) IsValidIndexedAttestation(att *cltypes.IndexedAttestation) (bool, error)
- func (b *BeaconState) IsValidatorEligibleForActivation(validator *cltypes.Validator) bool
- func (b *BeaconState) IsValidatorEligibleForActivationQueue(validator *cltypes.Validator) bool
- func (b *BeaconState) JustificationBits() cltypes.JustificationBits
- func (b *BeaconState) LatestBlockHeader() cltypes.BeaconBlockHeader
- func (b *BeaconState) LatestExecutionPayloadHeader() *cltypes.Eth1Header
- func (b *BeaconState) NextSyncCommittee() *cltypes.SyncCommittee
- func (b *BeaconState) NextWithdrawalIndex() uint64
- func (b *BeaconState) NextWithdrawalValidatorIndex() uint64
- func (b *BeaconState) PreviousEpoch() uint64
- func (b *BeaconState) PreviousJustifiedCheckpoint() *cltypes.Checkpoint
- func (b *BeaconState) PreviousSlot() uint64
- func (b *BeaconState) PreviousStateRoot() libcommon.Hash
- func (b *BeaconState) RandaoMixes() [randoMixesLength]libcommon.Hash
- func (b *BeaconState) ResetCurrentEpochAttestations()
- func (b *BeaconState) ResetEpochParticipation()
- func (b *BeaconState) ResetEth1DataVotes()
- func (b *BeaconState) RevertWithChangeset(changeset *beacon_changeset.ChangeSet)
- func (b *BeaconState) SetActivationEligibilityEpochForValidatorAtIndex(index int, epoch uint64)
- func (b *BeaconState) SetActivationEpochForValidatorAtIndex(index int, epoch uint64)
- func (b *BeaconState) SetBalances(balances []uint64)
- func (b *BeaconState) SetBlockRootAt(index int, root libcommon.Hash)
- func (b *BeaconState) SetCurrentJustifiedCheckpoint(currentJustifiedCheckpoint *cltypes.Checkpoint)
- func (b *BeaconState) SetCurrentSyncCommittee(currentSyncCommittee *cltypes.SyncCommittee)
- func (b *BeaconState) SetEffectiveBalanceForValidatorAtIndex(index int, balance uint64)
- func (b *BeaconState) SetEpochParticipationForValidatorIndex(isCurrentEpoch bool, index int, flags cltypes.ParticipationFlags)
- func (b *BeaconState) SetEth1Data(eth1Data *cltypes.Eth1Data)
- func (b *BeaconState) SetEth1DepositIndex(eth1DepositIndex uint64)
- func (b *BeaconState) SetExitEpochForValidatorAtIndex(index int, epoch uint64)
- func (b *BeaconState) SetFinalizedCheckpoint(finalizedCheckpoint *cltypes.Checkpoint)
- func (b *BeaconState) SetFork(fork *cltypes.Fork)
- func (b *BeaconState) SetHistoricalRootAt(index int, root [32]byte)
- func (b *BeaconState) SetJustificationBits(justificationBits cltypes.JustificationBits)
- func (b *BeaconState) SetLatestBlockHeader(header *cltypes.BeaconBlockHeader)
- func (b *BeaconState) SetLatestExecutionPayloadHeader(header *cltypes.Eth1Header)
- func (b *BeaconState) SetNextSyncCommittee(nextSyncCommittee *cltypes.SyncCommittee)
- func (b *BeaconState) SetNextWithdrawalIndex(index uint64)
- func (b *BeaconState) SetNextWithdrawalValidatorIndex(index uint64)
- func (b *BeaconState) SetPreviousEpochAttestations(attestations []*cltypes.PendingAttestation)
- func (b *BeaconState) SetPreviousJustifiedCheckpoint(previousJustifiedCheckpoint *cltypes.Checkpoint)
- func (b *BeaconState) SetPreviousStateRoot(root libcommon.Hash)
- func (b *BeaconState) SetRandaoMixAt(index int, mix libcommon.Hash)
- func (b *BeaconState) SetSlashingSegmentAt(index int, segment uint64)
- func (b *BeaconState) SetSlot(slot uint64)
- func (b *BeaconState) SetStateRootAt(index int, root libcommon.Hash)
- func (b *BeaconState) SetValidatorAtIndex(index int, validator *cltypes.Validator)
- func (b *BeaconState) SetValidatorBalance(index int, balance uint64) error
- func (b *BeaconState) SetValidatorInactivityScore(index int, score uint64) error
- func (b *BeaconState) SetValidators(validators []*cltypes.Validator) error
- func (b *BeaconState) SetWithdrawableEpochForValidatorAtIndex(index int, epoch uint64)
- func (b *BeaconState) SetWithdrawalCredentialForValidatorAtIndex(index int, creds libcommon.Hash)
- func (b *BeaconState) SlashValidator(slashedInd uint64, whistleblowerInd *uint64) error
- func (b *BeaconState) SlashingSegmentAt(pos int) uint64
- func (b *BeaconState) Slashings() [slashingsLength]uint64
- func (b *BeaconState) Slot() uint64
- func (b *BeaconState) StartCollectingForwardChangeSet()
- func (b *BeaconState) StartCollectingReverseChangeSet()
- func (b *BeaconState) StateRoots() [stateRootsLength]libcommon.Hash
- func (b *BeaconState) StopCollectingForwardChangeSet() *beacon_changeset.ChangeSet
- func (b *BeaconState) StopCollectingReverseChangeSet() *beacon_changeset.ChangeSet
- func (b *BeaconState) SyncRewards() (proposerReward, participantReward uint64, err error)
- func (b *BeaconState) UpgradeToAltair() error
- func (b *BeaconState) UpgradeToBellatrix() error
- func (b *BeaconState) UpgradeToCapella() error
- func (b *BeaconState) ValidatorBalance(index int) (uint64, error)
- func (b *BeaconState) ValidatorChurnLimit() uint64
- func (b *BeaconState) ValidatorForValidatorIndex(index int) (*cltypes.Validator, error)
- func (b *BeaconState) ValidatorFromDeposit(deposit *cltypes.Deposit) *cltypes.Validator
- func (b *BeaconState) ValidatorInactivityScore(index int) (uint64, error)
- func (b *BeaconState) ValidatorIndexByPubkey(key [48]byte) (uint64, bool)
- func (b *BeaconState) Validators() []*cltypes.Validator
- func (b *BeaconState) Version() clparams.StateVersion
- type HashFunc
- type StateLeafIndex
Constants ¶
const PreAllocatedRewardsAndPenalties = 8192
Variables ¶
var (
ErrGetBlockRootAtSlotFuture = errors.New("GetBlockRootAtSlot: slot in the future")
)
var ( // Error for missing validator ErrInvalidValidatorIndex = errors.New("invalid validator index") )
Functions ¶
This section is empty.
Types ¶
type BeaconState ¶
type BeaconState struct {
// contains filtered or unexported fields
}
func GetEmptyBeaconState ¶
func GetEmptyBeaconState() *BeaconState
func GetEmptyBeaconStateWithVersion ¶
func GetEmptyBeaconStateWithVersion(v clparams.StateVersion) *BeaconState
func New ¶
func New(cfg *clparams.BeaconChainConfig) *BeaconState
func (*BeaconState) AddCurrentEpochAtteastation ¶
func (b *BeaconState) AddCurrentEpochAtteastation(attestation *cltypes.PendingAttestation)
func (*BeaconState) AddCurrentEpochParticipationFlags ¶
func (b *BeaconState) AddCurrentEpochParticipationFlags(flags cltypes.ParticipationFlags)
func (*BeaconState) AddEth1DataVote ¶
func (b *BeaconState) AddEth1DataVote(vote *cltypes.Eth1Data)
func (*BeaconState) AddHistoricalRoot ¶
func (b *BeaconState) AddHistoricalRoot(root libcommon.Hash)
func (*BeaconState) AddHistoricalSummary ¶
func (b *BeaconState) AddHistoricalSummary(summary *cltypes.HistoricalSummary)
func (*BeaconState) AddInactivityScore ¶
func (b *BeaconState) AddInactivityScore(score uint64)
func (*BeaconState) AddPreviousEpochAttestation ¶
func (b *BeaconState) AddPreviousEpochAttestation(attestation *cltypes.PendingAttestation)
func (*BeaconState) AddPreviousEpochParticipationFlags ¶
func (b *BeaconState) AddPreviousEpochParticipationFlags(flags cltypes.ParticipationFlags)
func (*BeaconState) AddValidator ¶
func (b *BeaconState) AddValidator(validator *cltypes.Validator, balance uint64)
func (*BeaconState) Balances ¶
func (b *BeaconState) Balances() []uint64
func (*BeaconState) BaseReward ¶
func (b *BeaconState) BaseReward(index uint64) (uint64, error)
BaseReward return base rewards for processing sync committee and duties.
func (*BeaconState) BaseRewardPerIncrement ¶
func (b *BeaconState) BaseRewardPerIncrement() uint64
BaseRewardPerIncrement return base rewards for processing sync committee and duties.
func (*BeaconState) BeaconConfig ¶
func (b *BeaconState) BeaconConfig() *clparams.BeaconChainConfig
func (*BeaconState) BlockRoot ¶
func (b *BeaconState) BlockRoot() ([32]byte, error)
BlockRoot computes the block root for the state.
func (*BeaconState) BlockRoots ¶
func (b *BeaconState) BlockRoots() [blockRootsLength]libcommon.Hash
func (*BeaconState) Clone ¶
func (b *BeaconState) Clone() clonable.Clonable
func (*BeaconState) CommitteeCount ¶
func (b *BeaconState) CommitteeCount(epoch uint64) uint64
CommitteeCount returns current number of committee for epoch.
func (*BeaconState) ComputeActivationExitEpoch ¶
func (b *BeaconState) ComputeActivationExitEpoch(epoch uint64) uint64
func (*BeaconState) ComputeCommittee ¶
func (*BeaconState) ComputeNextSyncCommittee ¶
func (b *BeaconState) ComputeNextSyncCommittee() (*cltypes.SyncCommittee, error)
func (*BeaconState) ComputeProposerIndex ¶
func (b *BeaconState) ComputeProposerIndex(indices []uint64, seed [32]byte) (uint64, error)
func (*BeaconState) ComputeShuffledIndex ¶
func (*BeaconState) ComputeShuffledIndexPreInputs ¶
func (b *BeaconState) ComputeShuffledIndexPreInputs(seed [32]byte) [][32]byte
func (*BeaconState) ComputeTimestampAtSlot ¶
func (b *BeaconState) ComputeTimestampAtSlot(slot uint64) uint64
Compute the Unix timestamp at the specified slot number.
func (*BeaconState) Copy ¶
func (b *BeaconState) Copy() *BeaconState
func (*BeaconState) CurrentEpochAttestations ¶
func (b *BeaconState) CurrentEpochAttestations() []*cltypes.PendingAttestation
func (*BeaconState) CurrentJustifiedCheckpoint ¶
func (b *BeaconState) CurrentJustifiedCheckpoint() *cltypes.Checkpoint
func (*BeaconState) CurrentSyncCommittee ¶
func (b *BeaconState) CurrentSyncCommittee() *cltypes.SyncCommittee
func (*BeaconState) DecodeSSZ ¶
func (b *BeaconState) DecodeSSZ(buf []byte) error
MarshallSSZTo retrieve the SSZ encoded length of the state.
func (*BeaconState) DecodeSSZWithVersion ¶
func (b *BeaconState) DecodeSSZWithVersion(buf []byte, version int) error
func (*BeaconState) DecreaseBalance ¶
func (b *BeaconState) DecreaseBalance(index, delta uint64) error
func (*BeaconState) EligibleValidatorsIndicies ¶
func (b *BeaconState) EligibleValidatorsIndicies() (eligibleValidators []uint64)
Implementation of get_eligible_validator_indices as defined in the eth 2.0 specs.
func (*BeaconState) EncodingSizeSSZ ¶
func (b *BeaconState) EncodingSizeSSZ() (size int)
SSZ size of the Beacon State
func (*BeaconState) EpochParticipation ¶
func (b *BeaconState) EpochParticipation(currentEpoch bool) cltypes.ParticipationFlagsList
func (*BeaconState) EpochParticipationForValidatorIndex ¶
func (b *BeaconState) EpochParticipationForValidatorIndex(isCurrentEpoch bool, index int) cltypes.ParticipationFlags
func (*BeaconState) Eth1Data ¶
func (b *BeaconState) Eth1Data() *cltypes.Eth1Data
func (*BeaconState) Eth1DataVotes ¶
func (b *BeaconState) Eth1DataVotes() []*cltypes.Eth1Data
func (*BeaconState) Eth1DepositIndex ¶
func (b *BeaconState) Eth1DepositIndex() uint64
func (*BeaconState) ExpectedWithdrawals ¶
func (b *BeaconState) ExpectedWithdrawals() []*types.Withdrawal
ExpectedWithdrawals calculates the expected withdrawals that can be made by validators in the current epoch
func (*BeaconState) FinalityDelay ¶
func (b *BeaconState) FinalityDelay() uint64
FinalityDelay determines by how many epochs we are late on finality.
func (*BeaconState) FinalizedCheckpoint ¶
func (b *BeaconState) FinalizedCheckpoint() *cltypes.Checkpoint
func (*BeaconState) Fork ¶
func (b *BeaconState) Fork() *cltypes.Fork
func (*BeaconState) GenesisTime ¶
func (b *BeaconState) GenesisTime() uint64
func (*BeaconState) GenesisValidatorsRoot ¶
func (b *BeaconState) GenesisValidatorsRoot() libcommon.Hash
func (*BeaconState) GetActiveValidatorsIndices ¶
func (b *BeaconState) GetActiveValidatorsIndices(epoch uint64) (indicies []uint64)
GetActiveValidatorsIndices returns the list of validator indices active for the given epoch.
func (*BeaconState) GetAttestationParticipationFlagIndicies ¶
func (b *BeaconState) GetAttestationParticipationFlagIndicies(data *cltypes.AttestationData, inclusionDelay uint64) ([]uint8, error)
func (*BeaconState) GetAttestingIndicies ¶
func (b *BeaconState) GetAttestingIndicies(attestation *cltypes.AttestationData, aggregationBits []byte, checkBitsLength bool) ([]uint64, error)
GetAttestingIndicies retrieves attesting indicies for a specific attestation. however some tests will not expect the aggregation bits check. thus, it is a flag now.
func (*BeaconState) GetBeaconCommitee ¶
func (b *BeaconState) GetBeaconCommitee(slot, committeeIndex uint64) ([]uint64, error)
func (*BeaconState) GetBeaconProposerIndex ¶
func (b *BeaconState) GetBeaconProposerIndex() (uint64, error)
func (*BeaconState) GetBlockRoot ¶
func (b *BeaconState) GetBlockRoot(epoch uint64) (libcommon.Hash, error)
GetBlockRoot returns blook root at start of a given epoch
func (*BeaconState) GetBlockRootAtSlot ¶
func (b *BeaconState) GetBlockRootAtSlot(slot uint64) (libcommon.Hash, error)
GetBlockRootAtSlot returns the block root at a given slot
func (*BeaconState) GetDomain ¶
func (b *BeaconState) GetDomain(domainType [4]byte, epoch uint64) ([]byte, error)
func (*BeaconState) GetEpochAtSlot ¶
func (b *BeaconState) GetEpochAtSlot(slot uint64) uint64
GetEpochAtSlot gives the epoch for a certain slot
func (*BeaconState) GetIndexedAttestation ¶
func (b *BeaconState) GetIndexedAttestation(attestation *cltypes.Attestation, attestingIndicies []uint64) (*cltypes.IndexedAttestation, error)
func (*BeaconState) GetRandaoMixes ¶
func (b *BeaconState) GetRandaoMixes(epoch uint64) [32]byte
func (*BeaconState) GetSeed ¶
func (b *BeaconState) GetSeed(epoch uint64, domain [4]byte) libcommon.Hash
func (*BeaconState) GetTotalActiveBalance ¶
func (b *BeaconState) GetTotalActiveBalance() uint64
GetTotalActiveBalance return the sum of all balances within active validators.
func (*BeaconState) GetTotalBalance ¶
func (b *BeaconState) GetTotalBalance(validatorSet []uint64) (uint64, error)
GetTotalBalance return the sum of all balances within the given validator set.
func (*BeaconState) GetTotalSlashingAmount ¶
func (b *BeaconState) GetTotalSlashingAmount() (t uint64)
GetTotalSlashingAmount return the sum of all slashings.
func (*BeaconState) GetUnslashedParticipatingIndices ¶
func (b *BeaconState) GetUnslashedParticipatingIndices(flagIndex int, epoch uint64) (validatorSet []uint64, err error)
getUnslashedParticipatingIndices returns set of currently unslashed participating indexes
func (*BeaconState) GetValidatorChurnLimit ¶
func (b *BeaconState) GetValidatorChurnLimit() uint64
func (*BeaconState) HashSSZ ¶
func (b *BeaconState) HashSSZ() ([32]byte, error)
func (*BeaconState) HistoricalRoots ¶
func (b *BeaconState) HistoricalRoots() []libcommon.Hash
func (*BeaconState) HistoricalSummaries ¶
func (b *BeaconState) HistoricalSummaries() []*cltypes.HistoricalSummary
func (*BeaconState) InactivityLeaking ¶
func (b *BeaconState) InactivityLeaking() bool
Implementation of is_in_inactivity_leak. tells us if network is in danger pretty much. defined in ETH 2.0 specs.
func (*BeaconState) InactivityScores ¶
func (b *BeaconState) InactivityScores() []uint64
func (*BeaconState) IncreaseBalance ¶
func (b *BeaconState) IncreaseBalance(index, delta uint64) error
func (*BeaconState) InitiateValidatorExit ¶
func (b *BeaconState) InitiateValidatorExit(index uint64) error
func (*BeaconState) IsMergeTransitionComplete ¶
func (b *BeaconState) IsMergeTransitionComplete() bool
Check whether a merge transition is complete by verifying the presence of a valid execution payload header.
func (*BeaconState) IsUnslashedParticipatingIndex ¶
func (b *BeaconState) IsUnslashedParticipatingIndex(epoch, index uint64, flagIdx int) bool
func (*BeaconState) IsValidIndexedAttestation ¶
func (b *BeaconState) IsValidIndexedAttestation(att *cltypes.IndexedAttestation) (bool, error)
func (*BeaconState) IsValidatorEligibleForActivation ¶
func (b *BeaconState) IsValidatorEligibleForActivation(validator *cltypes.Validator) bool
Implementation of is_eligible_for_activation. Specs at: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation
func (*BeaconState) IsValidatorEligibleForActivationQueue ¶
func (b *BeaconState) IsValidatorEligibleForActivationQueue(validator *cltypes.Validator) bool
Implementation of is_eligible_for_activation_queue. Specs at: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue
func (*BeaconState) JustificationBits ¶
func (b *BeaconState) JustificationBits() cltypes.JustificationBits
func (*BeaconState) LatestBlockHeader ¶
func (b *BeaconState) LatestBlockHeader() cltypes.BeaconBlockHeader
func (*BeaconState) LatestExecutionPayloadHeader ¶
func (b *BeaconState) LatestExecutionPayloadHeader() *cltypes.Eth1Header
func (*BeaconState) NextSyncCommittee ¶
func (b *BeaconState) NextSyncCommittee() *cltypes.SyncCommittee
func (*BeaconState) NextWithdrawalIndex ¶
func (b *BeaconState) NextWithdrawalIndex() uint64
func (*BeaconState) NextWithdrawalValidatorIndex ¶
func (b *BeaconState) NextWithdrawalValidatorIndex() uint64
func (*BeaconState) PreviousEpoch ¶
func (b *BeaconState) PreviousEpoch() uint64
PreviousEpoch returns previous epoch.
func (*BeaconState) PreviousJustifiedCheckpoint ¶
func (b *BeaconState) PreviousJustifiedCheckpoint() *cltypes.Checkpoint
func (*BeaconState) PreviousSlot ¶
func (b *BeaconState) PreviousSlot() uint64
func (*BeaconState) PreviousStateRoot ¶
func (b *BeaconState) PreviousStateRoot() libcommon.Hash
PreviousStateRoot gets the previously saved state root and then deletes it.
func (*BeaconState) RandaoMixes ¶
func (b *BeaconState) RandaoMixes() [randoMixesLength]libcommon.Hash
func (*BeaconState) ResetCurrentEpochAttestations ¶
func (b *BeaconState) ResetCurrentEpochAttestations()
func (*BeaconState) ResetEpochParticipation ¶
func (b *BeaconState) ResetEpochParticipation()
func (*BeaconState) ResetEth1DataVotes ¶
func (b *BeaconState) ResetEth1DataVotes()
func (*BeaconState) RevertWithChangeset ¶
func (b *BeaconState) RevertWithChangeset(changeset *beacon_changeset.ChangeSet)
func (*BeaconState) SetActivationEligibilityEpochForValidatorAtIndex ¶
func (b *BeaconState) SetActivationEligibilityEpochForValidatorAtIndex(index int, epoch uint64)
func (*BeaconState) SetActivationEpochForValidatorAtIndex ¶
func (b *BeaconState) SetActivationEpochForValidatorAtIndex(index int, epoch uint64)
func (*BeaconState) SetBalances ¶
func (b *BeaconState) SetBalances(balances []uint64)
func (*BeaconState) SetBlockRootAt ¶
func (b *BeaconState) SetBlockRootAt(index int, root libcommon.Hash)
func (*BeaconState) SetCurrentJustifiedCheckpoint ¶
func (b *BeaconState) SetCurrentJustifiedCheckpoint(currentJustifiedCheckpoint *cltypes.Checkpoint)
func (*BeaconState) SetCurrentSyncCommittee ¶
func (b *BeaconState) SetCurrentSyncCommittee(currentSyncCommittee *cltypes.SyncCommittee)
func (*BeaconState) SetEffectiveBalanceForValidatorAtIndex ¶
func (b *BeaconState) SetEffectiveBalanceForValidatorAtIndex(index int, balance uint64)
func (*BeaconState) SetEpochParticipationForValidatorIndex ¶
func (b *BeaconState) SetEpochParticipationForValidatorIndex(isCurrentEpoch bool, index int, flags cltypes.ParticipationFlags)
func (*BeaconState) SetEth1Data ¶
func (b *BeaconState) SetEth1Data(eth1Data *cltypes.Eth1Data)
func (*BeaconState) SetEth1DepositIndex ¶
func (b *BeaconState) SetEth1DepositIndex(eth1DepositIndex uint64)
func (*BeaconState) SetExitEpochForValidatorAtIndex ¶
func (b *BeaconState) SetExitEpochForValidatorAtIndex(index int, epoch uint64)
func (*BeaconState) SetFinalizedCheckpoint ¶
func (b *BeaconState) SetFinalizedCheckpoint(finalizedCheckpoint *cltypes.Checkpoint)
func (*BeaconState) SetFork ¶
func (b *BeaconState) SetFork(fork *cltypes.Fork)
func (*BeaconState) SetHistoricalRootAt ¶
func (b *BeaconState) SetHistoricalRootAt(index int, root [32]byte)
func (*BeaconState) SetJustificationBits ¶
func (b *BeaconState) SetJustificationBits(justificationBits cltypes.JustificationBits)
func (*BeaconState) SetLatestBlockHeader ¶
func (b *BeaconState) SetLatestBlockHeader(header *cltypes.BeaconBlockHeader)
func (*BeaconState) SetLatestExecutionPayloadHeader ¶
func (b *BeaconState) SetLatestExecutionPayloadHeader(header *cltypes.Eth1Header)
func (*BeaconState) SetNextSyncCommittee ¶
func (b *BeaconState) SetNextSyncCommittee(nextSyncCommittee *cltypes.SyncCommittee)
func (*BeaconState) SetNextWithdrawalIndex ¶
func (b *BeaconState) SetNextWithdrawalIndex(index uint64)
func (*BeaconState) SetNextWithdrawalValidatorIndex ¶
func (b *BeaconState) SetNextWithdrawalValidatorIndex(index uint64)
func (*BeaconState) SetPreviousEpochAttestations ¶
func (b *BeaconState) SetPreviousEpochAttestations(attestations []*cltypes.PendingAttestation)
func (*BeaconState) SetPreviousJustifiedCheckpoint ¶
func (b *BeaconState) SetPreviousJustifiedCheckpoint(previousJustifiedCheckpoint *cltypes.Checkpoint)
func (*BeaconState) SetPreviousStateRoot ¶
func (b *BeaconState) SetPreviousStateRoot(root libcommon.Hash)
func (*BeaconState) SetRandaoMixAt ¶
func (b *BeaconState) SetRandaoMixAt(index int, mix libcommon.Hash)
func (*BeaconState) SetSlashingSegmentAt ¶
func (b *BeaconState) SetSlashingSegmentAt(index int, segment uint64)
func (*BeaconState) SetSlot ¶
func (b *BeaconState) SetSlot(slot uint64)
func (*BeaconState) SetStateRootAt ¶
func (b *BeaconState) SetStateRootAt(index int, root libcommon.Hash)
func (*BeaconState) SetValidatorAtIndex ¶
func (b *BeaconState) SetValidatorAtIndex(index int, validator *cltypes.Validator)
func (*BeaconState) SetValidatorBalance ¶
func (b *BeaconState) SetValidatorBalance(index int, balance uint64) error
func (*BeaconState) SetValidatorInactivityScore ¶
func (b *BeaconState) SetValidatorInactivityScore(index int, score uint64) error
func (*BeaconState) SetValidators ¶
func (b *BeaconState) SetValidators(validators []*cltypes.Validator) error
Should not be called if not for testing
func (*BeaconState) SetWithdrawableEpochForValidatorAtIndex ¶
func (b *BeaconState) SetWithdrawableEpochForValidatorAtIndex(index int, epoch uint64)
func (*BeaconState) SetWithdrawalCredentialForValidatorAtIndex ¶
func (b *BeaconState) SetWithdrawalCredentialForValidatorAtIndex(index int, creds libcommon.Hash)
func (*BeaconState) SlashValidator ¶
func (b *BeaconState) SlashValidator(slashedInd uint64, whistleblowerInd *uint64) error
func (*BeaconState) SlashingSegmentAt ¶
func (b *BeaconState) SlashingSegmentAt(pos int) uint64
func (*BeaconState) Slashings ¶
func (b *BeaconState) Slashings() [slashingsLength]uint64
func (*BeaconState) Slot ¶
func (b *BeaconState) Slot() uint64
func (*BeaconState) StartCollectingForwardChangeSet ¶
func (b *BeaconState) StartCollectingForwardChangeSet()
StartCollectingForwardChangeSet starts collection change sets.
func (*BeaconState) StartCollectingReverseChangeSet ¶
func (b *BeaconState) StartCollectingReverseChangeSet()
StartCollectingReverseChangeSet starts collection change sets.
func (*BeaconState) StateRoots ¶
func (b *BeaconState) StateRoots() [stateRootsLength]libcommon.Hash
func (*BeaconState) StopCollectingForwardChangeSet ¶
func (b *BeaconState) StopCollectingForwardChangeSet() *beacon_changeset.ChangeSet
StopCollectingForwardChangeSet stops collection change sets.
func (*BeaconState) StopCollectingReverseChangeSet ¶
func (b *BeaconState) StopCollectingReverseChangeSet() *beacon_changeset.ChangeSet
StopCollectingReverseChangeSet stops collection change sets.
func (*BeaconState) SyncRewards ¶
func (b *BeaconState) SyncRewards() (proposerReward, participantReward uint64, err error)
SyncRewards returns the proposer reward and the sync participant reward given the total active balance in state.
func (*BeaconState) UpgradeToAltair ¶
func (b *BeaconState) UpgradeToAltair() error
func (*BeaconState) UpgradeToBellatrix ¶
func (b *BeaconState) UpgradeToBellatrix() error
func (*BeaconState) UpgradeToCapella ¶
func (b *BeaconState) UpgradeToCapella() error
func (*BeaconState) ValidatorBalance ¶
func (b *BeaconState) ValidatorBalance(index int) (uint64, error)
func (*BeaconState) ValidatorChurnLimit ¶
func (b *BeaconState) ValidatorChurnLimit() uint64
Get the maximum number of validators that can be churned in a single epoch. See: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#get_validator_churn_limit
func (*BeaconState) ValidatorForValidatorIndex ¶
func (b *BeaconState) ValidatorForValidatorIndex(index int) (*cltypes.Validator, error)
func (*BeaconState) ValidatorFromDeposit ¶
func (b *BeaconState) ValidatorFromDeposit(deposit *cltypes.Deposit) *cltypes.Validator
func (*BeaconState) ValidatorInactivityScore ¶
func (b *BeaconState) ValidatorInactivityScore(index int) (uint64, error)
func (*BeaconState) ValidatorIndexByPubkey ¶
func (b *BeaconState) ValidatorIndexByPubkey(key [48]byte) (uint64, bool)
func (*BeaconState) Validators ¶
func (b *BeaconState) Validators() []*cltypes.Validator
func (*BeaconState) Version ¶
func (b *BeaconState) Version() clparams.StateVersion
type StateLeafIndex ¶
type StateLeafIndex uint
const ( GenesisTimeLeafIndex StateLeafIndex = 0 GenesisValidatorsRootLeafIndex StateLeafIndex = 1 SlotLeafIndex StateLeafIndex = 2 ForkLeafIndex StateLeafIndex = 3 LatestBlockHeaderLeafIndex StateLeafIndex = 4 BlockRootsLeafIndex StateLeafIndex = 5 StateRootsLeafIndex StateLeafIndex = 6 HistoricalRootsLeafIndex StateLeafIndex = 7 Eth1DataLeafIndex StateLeafIndex = 8 Eth1DataVotesLeafIndex StateLeafIndex = 9 Eth1DepositIndexLeafIndex StateLeafIndex = 10 ValidatorsLeafIndex StateLeafIndex = 11 BalancesLeafIndex StateLeafIndex = 12 RandaoMixesLeafIndex StateLeafIndex = 13 SlashingsLeafIndex StateLeafIndex = 14 PreviousEpochParticipationLeafIndex StateLeafIndex = 15 CurrentEpochParticipationLeafIndex StateLeafIndex = 16 JustificationBitsLeafIndex StateLeafIndex = 17 PreviousJustifiedCheckpointLeafIndex StateLeafIndex = 18 CurrentJustifiedCheckpointLeafIndex StateLeafIndex = 19 FinalizedCheckpointLeafIndex StateLeafIndex = 20 // Altair InactivityScoresLeafIndex StateLeafIndex = 21 CurrentSyncCommitteeLeafIndex StateLeafIndex = 22 NextSyncCommitteeLeafIndex StateLeafIndex = 23 // Bellatrix LatestExecutionPayloadHeaderLeafIndex StateLeafIndex = 24 // Capella NextWithdrawalIndexLeafIndex StateLeafIndex = 25 NextWithdrawalValidatorIndexLeafIndex StateLeafIndex = 26 HistoricalSummariesLeafIndex StateLeafIndex = 27 )
All position of all the leaves of the state merkle tree.