Documentation ¶
Index ¶
Constants ¶
const ( // Epoch Attestations is switched with participation bits in Altair. PreviousEpochParticipationBits = PreviousEpochAttestations CurrentEpochParticipationBits = CurrentEpochAttestations )
Altair fields which replaced previous phase 0 fields.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeaconStateField ¶
type BeaconStateField interface { String(stateVersion int) string RealPosition() int ElemsInChunk() (uint64, error) Native() bool }
BeaconStateField represents a field of the beacon state.
type DataType ¶
type DataType int
DataType signifies the data type of the field.
const ( // BasicArray represents a simple array type for a field. BasicArray DataType = iota // CompositeArray represents a variable length array with // a non primitive type. CompositeArray // CompressedArray represents a variable length array which // can pack multiple elements into a leaf of the underlying // trie. CompressedArray )
List of current data types the state supports.
type FieldIndex ¶
type FieldIndex int
FieldIndex represents the relevant field position in the state struct for a field.
const ( GenesisTime FieldIndex = iota GenesisValidatorsRoot Slot Fork LatestBlockHeader BlockRoots StateRoots HistoricalRoots Eth1Data Eth1DataVotes Eth1DepositIndex Validators Balances RandaoMixes Slashings PreviousEpochAttestations CurrentEpochAttestations JustificationBits PreviousJustifiedCheckpoint CurrentJustifiedCheckpoint FinalizedCheckpoint // State Fields Added in Altair. InactivityScores CurrentSyncCommittee NextSyncCommittee // State fields added in Bellatrix. LatestExecutionPayloadHeader // State fields added in Capella LatestExecutionPayloadHeaderCapella NextWithdrawalIndex NextWithdrawalValidatorIndex )
Below we define a set of useful enum values for the field indices of the beacon state. For example, genesisTime is the 0th field of the beacon state. This is helpful when we are updating the Merkle branches up the trie representation of the beacon state. The below field indexes correspond to the v1 state.
func (FieldIndex) ElemsInChunk ¶
func (f FieldIndex) ElemsInChunk() (uint64, error)
ElemsInChunk returns the number of elements in the chunk (number of elements that are able to be packed).
func (FieldIndex) Native ¶
func (FieldIndex) Native() bool
func (FieldIndex) RealPosition ¶
func (f FieldIndex) RealPosition() int
RealPosition denotes the position of the field in the beacon state. The value might differ for different state versions.
func (FieldIndex) String ¶
func (f FieldIndex) String(stateVersion int) string
String returns the name of the field index.