electra

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SingleAttestationType = ContainerType("SingleAttestation", []FieldDef{
	{"committee_index", common.CommitteeIndexType},
	{"attester_index", common.ValidatorIndexType},
	{"data", phase0.AttestationDataType},
	{"signature", common.BLSSignatureType},
})

Functions

func AttestationBitsType

func AttestationBitsType(spec *common.Spec) *BitListTypeDef

func AttestationType

func AttestationType(spec *common.Spec) *ContainerTypeDef

func AttesterSlashingType

func AttesterSlashingType(spec *common.Spec) *ContainerTypeDef

func BeaconBlockBodyType

func BeaconBlockBodyType(spec *common.Spec) *ContainerTypeDef

func BeaconBlockType

func BeaconBlockType(spec *common.Spec) *ContainerTypeDef

func BeaconStateType

func BeaconStateType(spec *common.Spec) *ContainerTypeDef

func BlockAttestationsType

func BlockAttestationsType(spec *common.Spec) ListTypeDef

func BlockAttesterSlashingsType

func BlockAttesterSlashingsType(spec *common.Spec) ListTypeDef

func CommitteeBitsType

func CommitteeBitsType(spec *common.Spec) *BitVectorTypeDef

func ExecutionRequestsType

func ExecutionRequestsType(spec *common.Spec) *ContainerTypeDef

func IndexedAttestationType

func IndexedAttestationType(spec *common.Spec) *ContainerTypeDef

func SignedBeaconBlockType

func SignedBeaconBlockType(spec *common.Spec) *ContainerTypeDef

Types

type AggregateAndProof

type AggregateAndProof struct {
	AggregatorIndex common.ValidatorIndex `json:"aggregator_index"`
	Aggregate       Attestation           `json:"aggregate"`
	SelectionProof  common.BLSSignature   `json:"selection_proof"`
}

func (*AggregateAndProof) ByteLength

func (a *AggregateAndProof) ByteLength(spec *common.Spec) uint64

func (*AggregateAndProof) Deserialize

func (a *AggregateAndProof) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*AggregateAndProof) FixedLength

func (a *AggregateAndProof) FixedLength(*common.Spec) uint64

func (*AggregateAndProof) HashTreeRoot

func (a *AggregateAndProof) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*AggregateAndProof) Serialize

func (a *AggregateAndProof) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type Attestation

type Attestation struct {
	// [Modified in Electra:EIP7549]
	AggregationBits AttestationBits        `json:"aggregation_bits" yaml:"aggregation_bits"`
	Data            phase0.AttestationData `json:"data" yaml:"data"`
	Signature       common.BLSSignature    `json:"signature" yaml:"signature"`
	// [New in Electra:EIP7549]
	CommitteeBits CommitteeBits `json:"committee_bits" yaml:"committee_bits"`
}

func (*Attestation) ByteLength

func (a *Attestation) ByteLength(spec *common.Spec) uint64

func (*Attestation) Deserialize

func (a *Attestation) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*Attestation) FixedLength

func (a *Attestation) FixedLength(*common.Spec) uint64

func (*Attestation) HashTreeRoot

func (a *Attestation) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*Attestation) Serialize

func (a *Attestation) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type AttestationBits

type AttestationBits []byte

AttestationBits is formatted as a serialized SSZ bitlist, including the delimit bit

func (AttestationBits) BitLen

func (cb AttestationBits) BitLen() uint64

func (AttestationBits) ByteLength

func (a AttestationBits) ByteLength(spec *common.Spec) uint64

func (AttestationBits) Copy

func (cb AttestationBits) Copy() AttestationBits

func (AttestationBits) Covers

func (cb AttestationBits) Covers(other AttestationBits) (bool, error)

Returns true if other only has bits set to 1 that this bitfield also has set to 1

func (*AttestationBits) Deserialize

func (li *AttestationBits) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (AttestationBits) FilterNonParticipants

func (cb AttestationBits) FilterNonParticipants(committee []common.ValidatorIndex) []common.ValidatorIndex

In-place filters a list of committees indices to only keep the bitfield NON-participants. The result is not sorted. Returns the re-sliced filtered non-participants list.

WARNING: unsafe to use, panics if committee size does not match.

func (AttestationBits) FilterParticipants

func (cb AttestationBits) FilterParticipants(committee []common.ValidatorIndex) []common.ValidatorIndex

In-place filters a list of committees indices to only keep the bitfield participants. The result is not sorted. Returns the re-sliced filtered participants list.

WARNING: unsafe to use, panics if committee size does not match.

func (*AttestationBits) FixedLength

func (a *AttestationBits) FixedLength(*common.Spec) uint64

func (AttestationBits) GetBit

func (cb AttestationBits) GetBit(i uint64) bool

func (AttestationBits) HashTreeRoot

func (li AttestationBits) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (AttestationBits) MarshalText

func (cb AttestationBits) MarshalText() ([]byte, error)

func (AttestationBits) OnesCount

func (cb AttestationBits) OnesCount() uint64

func (AttestationBits) Or

func (cb AttestationBits) Or(other AttestationBits)

Sets the bits to true that are true in other. (in place)

func (AttestationBits) Serialize

func (a AttestationBits) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

func (AttestationBits) SetBit

func (cb AttestationBits) SetBit(i uint64, v bool)

func (AttestationBits) SingleParticipant

func (cb AttestationBits) SingleParticipant(committee []common.ValidatorIndex) (common.ValidatorIndex, error)

func (AttestationBits) String

func (cb AttestationBits) String() string

func (*AttestationBits) UnmarshalText

func (cb *AttestationBits) UnmarshalText(text []byte) error

func (AttestationBits) View

type AttestationBitsView

type AttestationBitsView struct {
	*BitListView
}

func AsAttestationBits

func AsAttestationBits(v View, err error) (*AttestationBitsView, error)

func (*AttestationBitsView) Raw

type Attestations

type Attestations []Attestation

func (Attestations) ByteLength

func (a Attestations) ByteLength(spec *common.Spec) (out uint64)

func (*Attestations) Deserialize

func (a *Attestations) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*Attestations) FixedLength

func (a *Attestations) FixedLength(*common.Spec) uint64

func (Attestations) HashTreeRoot

func (li Attestations) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (Attestations) MarshalJSON

func (li Attestations) MarshalJSON() ([]byte, error)

func (Attestations) Serialize

func (a Attestations) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type AttesterSlashing

type AttesterSlashing struct {
	// [Modified in Electra:EIP7549]
	Attestation1 IndexedAttestation `json:"attestation_1" yaml:"attestation_1"`
	// [Modified in Electra:EIP7549]
	Attestation2 IndexedAttestation `json:"attestation_2" yaml:"attestation_2"`
}

func (*AttesterSlashing) ByteLength

func (a *AttesterSlashing) ByteLength(spec *common.Spec) uint64

func (*AttesterSlashing) Deserialize

func (a *AttesterSlashing) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*AttesterSlashing) FixedLength

func (a *AttesterSlashing) FixedLength(*common.Spec) uint64

func (*AttesterSlashing) HashTreeRoot

func (a *AttesterSlashing) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*AttesterSlashing) Serialize

func (a *AttesterSlashing) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type AttesterSlashings

type AttesterSlashings []AttesterSlashing

func (AttesterSlashings) ByteLength

func (a AttesterSlashings) ByteLength(spec *common.Spec) (out uint64)

func (*AttesterSlashings) Deserialize

func (a *AttesterSlashings) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*AttesterSlashings) FixedLength

func (a *AttesterSlashings) FixedLength(*common.Spec) uint64

func (AttesterSlashings) HashTreeRoot

func (li AttesterSlashings) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (AttesterSlashings) MarshalJSON

func (li AttesterSlashings) MarshalJSON() ([]byte, error)

func (AttesterSlashings) Serialize

func (a AttesterSlashings) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type BeaconBlock

type BeaconBlock struct {
	Slot          common.Slot           `json:"slot" yaml:"slot"`
	ProposerIndex common.ValidatorIndex `json:"proposer_index" yaml:"proposer_index"`
	ParentRoot    common.Root           `json:"parent_root" yaml:"parent_root"`
	StateRoot     common.Root           `json:"state_root" yaml:"state_root"`
	Body          BeaconBlockBody       `json:"body" yaml:"body"`
}

func (*BeaconBlock) ByteLength

func (b *BeaconBlock) ByteLength(spec *common.Spec) uint64

func (*BeaconBlock) Deserialize

func (b *BeaconBlock) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*BeaconBlock) FixedLength

func (a *BeaconBlock) FixedLength(*common.Spec) uint64

func (*BeaconBlock) HashTreeRoot

func (b *BeaconBlock) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*BeaconBlock) Header

func (block *BeaconBlock) Header(spec *common.Spec) *common.BeaconBlockHeader

func (*BeaconBlock) Serialize

func (b *BeaconBlock) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type BeaconBlockBody

type BeaconBlockBody struct {
	RandaoReveal common.BLSSignature `json:"randao_reveal" yaml:"randao_reveal"`
	Eth1Data     common.Eth1Data     `json:"eth1_data" yaml:"eth1_data"`
	Graffiti     common.Root         `json:"graffiti" yaml:"graffiti"`

	// Operations
	ProposerSlashings phase0.ProposerSlashings `json:"proposer_slashings" yaml:"proposer_slashings"`
	// [Modified in Electra:EIP7549], MAX_ATTESTER_SLASHINGS_ELECTRA
	AttesterSlashings AttesterSlashings `json:"attester_slashings" yaml:"attester_slashings"`
	// [Modified in Electra:EIP7549], MAX_ATTESTATIONS_ELECTRA
	Attestations   Attestations          `json:"attestations" yaml:"attestations"`
	Deposits       phase0.Deposits       `json:"deposits" yaml:"deposits"`
	VoluntaryExits phase0.VoluntaryExits `json:"voluntary_exits" yaml:"voluntary_exits"`
	SyncAggregate  altair.SyncAggregate  `json:"sync_aggregate" yaml:"sync_aggregate"`
	// Execution
	ExecutionPayload      deneb.ExecutionPayload             `json:"execution_payload" yaml:"execution_payload"`
	BLSToExecutionChanges common.SignedBLSToExecutionChanges `json:"bls_to_execution_changes" yaml:"bls_to_execution_changes"`
	BlobKZGCommitments    deneb.KZGCommitments               `json:"blob_kzg_commitments" yaml:"blob_kzg_commitments"`
	// [New in Electra]
	ExecutionRequests ExecutionRequests `json:"execution_requests" yaml:"execution_requests"`
}

func (*BeaconBlockBody) ByteLength

func (b *BeaconBlockBody) ByteLength(spec *common.Spec) uint64

func (*BeaconBlockBody) CheckLimits

func (b *BeaconBlockBody) CheckLimits(spec *common.Spec) error

func (*BeaconBlockBody) Deserialize

func (b *BeaconBlockBody) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*BeaconBlockBody) FixedLength

func (a *BeaconBlockBody) FixedLength(*common.Spec) uint64

func (*BeaconBlockBody) GetBlobKZGCommitments

func (b *BeaconBlockBody) GetBlobKZGCommitments() []common.KZGCommitment

func (*BeaconBlockBody) GetTransactions

func (b *BeaconBlockBody) GetTransactions() []common.Transaction

func (*BeaconBlockBody) HashTreeRoot

func (b *BeaconBlockBody) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*BeaconBlockBody) Serialize

func (b *BeaconBlockBody) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

func (*BeaconBlockBody) Shallow

type BeaconBlockBodyShallow

type BeaconBlockBodyShallow struct {
	RandaoReveal common.BLSSignature `json:"randao_reveal" yaml:"randao_reveal"`
	Eth1Data     common.Eth1Data     `json:"eth1_data" yaml:"eth1_data"`
	Graffiti     common.Root         `json:"graffiti" yaml:"graffiti"`

	ProposerSlashings phase0.ProposerSlashings `json:"proposer_slashings" yaml:"proposer_slashings"`
	AttesterSlashings AttesterSlashings        `json:"attester_slashings" yaml:"attester_slashings"`
	Attestations      Attestations             `json:"attestations" yaml:"attestations"`
	Deposits          phase0.Deposits          `json:"deposits" yaml:"deposits"`
	VoluntaryExits    phase0.VoluntaryExits    `json:"voluntary_exits" yaml:"voluntary_exits"`

	SyncAggregate altair.SyncAggregate `json:"sync_aggregate" yaml:"sync_aggregate"`

	ExecutionPayloadRoot common.Root `json:"execution_payload_root" yaml:"execution_payload_root"`

	BLSToExecutionChanges common.SignedBLSToExecutionChanges `json:"bls_to_execution_changes" yaml:"bls_to_execution_changes"`

	BlobKZGCommitments deneb.KZGCommitments `json:"blob_kzg_commitments" yaml:"blob_kzg_commitments"` // new in EIP-4844
	// [New in Electra]
	ExecutionRequests ExecutionRequests `json:"execution_requests" yaml:"execution_requests"`
}

func (*BeaconBlockBodyShallow) ByteLength

func (b *BeaconBlockBodyShallow) ByteLength(spec *common.Spec) uint64

func (*BeaconBlockBodyShallow) Deserialize

func (b *BeaconBlockBodyShallow) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*BeaconBlockBodyShallow) FixedLength

func (a *BeaconBlockBodyShallow) FixedLength(*common.Spec) uint64

func (*BeaconBlockBodyShallow) HashTreeRoot

func (b *BeaconBlockBodyShallow) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*BeaconBlockBodyShallow) Serialize

func (b *BeaconBlockBodyShallow) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

func (*BeaconBlockBodyShallow) WithExecutionPayload

func (b *BeaconBlockBodyShallow) WithExecutionPayload(spec *common.Spec, payload deneb.ExecutionPayload) (*BeaconBlockBody, error)

type BeaconState

type BeaconState struct {
	// Versioning
	GenesisTime           common.Timestamp `json:"genesis_time" yaml:"genesis_time"`
	GenesisValidatorsRoot common.Root      `json:"genesis_validators_root" yaml:"genesis_validators_root"`
	Slot                  common.Slot      `json:"slot" yaml:"slot"`
	Fork                  common.Fork      `json:"fork" yaml:"fork"`
	// History
	LatestBlockHeader common.BeaconBlockHeader    `json:"latest_block_header" yaml:"latest_block_header"`
	BlockRoots        phase0.HistoricalBatchRoots `json:"block_roots" yaml:"block_roots"`
	StateRoots        phase0.HistoricalBatchRoots `json:"state_roots" yaml:"state_roots"`
	HistoricalRoots   phase0.HistoricalRoots      `json:"historical_roots" yaml:"historical_roots"` // Frozen in Capella, replaced by historical_summaries
	// Eth1
	Eth1Data         common.Eth1Data      `json:"eth1_data" yaml:"eth1_data"`
	Eth1DataVotes    phase0.Eth1DataVotes `json:"eth1_data_votes" yaml:"eth1_data_votes"`
	Eth1DepositIndex common.DepositIndex  `json:"eth1_deposit_index" yaml:"eth1_deposit_index"`
	// Registry
	Validators  phase0.ValidatorRegistry `json:"validators" yaml:"validators"`
	Balances    phase0.Balances          `json:"balances" yaml:"balances"`
	RandaoMixes phase0.RandaoMixes       `json:"randao_mixes" yaml:"randao_mixes"`
	Slashings   phase0.SlashingsHistory  `json:"slashings" yaml:"slashings"`
	// Participation
	PreviousEpochParticipation altair.ParticipationRegistry `json:"previous_epoch_participation" yaml:"previous_epoch_participation"`
	CurrentEpochParticipation  altair.ParticipationRegistry `json:"current_epoch_participation" yaml:"current_epoch_participation"`
	// Finality
	JustificationBits           common.JustificationBits `json:"justification_bits" yaml:"justification_bits"`
	PreviousJustifiedCheckpoint common.Checkpoint        `json:"previous_justified_checkpoint" yaml:"previous_justified_checkpoint"`
	CurrentJustifiedCheckpoint  common.Checkpoint        `json:"current_justified_checkpoint" yaml:"current_justified_checkpoint"`
	FinalizedCheckpoint         common.Checkpoint        `json:"finalized_checkpoint" yaml:"finalized_checkpoint"`
	// Inactivity
	InactivityScores altair.InactivityScores `json:"inactivity_scores" yaml:"inactivity_scores"`
	// Light client sync committees
	CurrentSyncCommittee common.SyncCommittee `json:"current_sync_committee" yaml:"current_sync_committee"`
	NextSyncCommittee    common.SyncCommittee `json:"next_sync_committee" yaml:"next_sync_committee"`
	// Execution-layer  (modified in EIP-4844)
	LatestExecutionPayloadHeader deneb.ExecutionPayloadHeader `json:"latest_execution_payload_header" yaml:"latest_execution_payload_header"`
	// Withdrawals
	NextWithdrawalIndex          common.WithdrawalIndex `json:"next_withdrawal_index" yaml:"next_withdrawal_index"`
	NextWithdrawalValidatorIndex common.ValidatorIndex  `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_index"`
	// Deep history valid from Capella onwards
	HistoricalSummaries capella.HistoricalSummaries `json:"historical_summaries"`
	// [New in Electra:EIP6110]
	DepositRequestsStartIndex Uint64View `json:"deposit_requests_start_index" yaml:"deposit_requests_start_index"`
	// [New in Electra:EIP7251]
	DepositBalanceToConsume common.Gwei `json:"deposit_balance_to_consume" yaml:"deposit_balance_to_consume"`
	// [New in Electra:EIP7251]
	ExitBalanceToConsume common.Gwei `json:"exit_balance_to_consume" yaml:"exit_balance_to_consume"`
	// [New in Electra:EIP7251]
	EarliestExitEpoch common.Epoch `json:"earliest_exit_epoch" yaml:"earliest_exit_epoch"`
	// [New in Electra:EIP7251]
	ConsolidationBalanceToConsume common.Gwei `json:"consolidation_balance_to_consume" yaml:"consolidation_balance_to_consume"`
	// [New in Electra:EIP7251]
	EarliestConsolidationEpoch common.Epoch `json:"earliest_consolidation_epoch" yaml:"earliest_consolidation_epoch"`
	// [New in Electra:EIP7251]
	PendingDeposits common.PendingDeposits `json:"pending_deposits" yaml:"pending_deposits"`
	// [New in Electra:EIP7251]
	PendingPartialWithdrawals common.PendingPartialWithdrawals `json:"pending_partial_withdrawals" yaml:"pending_partial_withdrawals"`
	// [New in Electra:EIP7251]
	PendingConsolidations common.PendingConsolidations `json:"pending_consolidations" yaml:"pending_consolidations"`
}

func (*BeaconState) ByteLength

func (v *BeaconState) ByteLength(spec *common.Spec) uint64

func (*BeaconState) Deserialize

func (v *BeaconState) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*BeaconState) FixedLength

func (*BeaconState) FixedLength(*common.Spec) uint64

func (*BeaconState) HashTreeRoot

func (v *BeaconState) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*BeaconState) Serialize

func (v *BeaconState) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type BeaconStateView

type BeaconStateView struct {
	*ContainerView
}

func AsBeaconStateView

func AsBeaconStateView(v View, err error) (*BeaconStateView, error)

To load a state:

state, err := beacon.AsBeaconStateView(beacon.BeaconStateType.Deserialize(codec.NewDecodingReader(reader, size)))

func NewBeaconStateView

func NewBeaconStateView(spec *common.Spec) *BeaconStateView

func UpgradeToElectra

func UpgradeToElectra(spec *common.Spec, epc *common.EpochsContext, pre *deneb.BeaconStateView) (*BeaconStateView, error)

func (*BeaconStateView) AddValidator

func (state *BeaconStateView) AddValidator(spec *common.Spec, pub common.BLSPubkey, withdrawalCreds common.Root, balance common.Gwei) error

func (*BeaconStateView) Balances

func (state *BeaconStateView) Balances() (common.BalancesRegistry, error)

func (*BeaconStateView) BlockRoots

func (state *BeaconStateView) BlockRoots() (common.BatchRoots, error)

func (*BeaconStateView) ConsolidationBalanceToConsume

func (state *BeaconStateView) ConsolidationBalanceToConsume() (common.Gwei, error)

func (*BeaconStateView) CopyState

func (state *BeaconStateView) CopyState() (common.BeaconState, error)

func (*BeaconStateView) CurrentEpochParticipation

func (state *BeaconStateView) CurrentEpochParticipation() (*altair.ParticipationRegistryView, error)

func (*BeaconStateView) CurrentJustifiedCheckpoint

func (state *BeaconStateView) CurrentJustifiedCheckpoint() (common.Checkpoint, error)

func (*BeaconStateView) CurrentSyncCommittee

func (state *BeaconStateView) CurrentSyncCommittee() (*common.SyncCommitteeView, error)

func (*BeaconStateView) DepositBalanceToConsume

func (state *BeaconStateView) DepositBalanceToConsume() (common.Gwei, error)

func (*BeaconStateView) DepositRequestsStartIndex

func (state *BeaconStateView) DepositRequestsStartIndex() (Uint64View, error)

func (*BeaconStateView) EarliestConsolidationEpoch

func (state *BeaconStateView) EarliestConsolidationEpoch() (common.Epoch, error)

func (*BeaconStateView) EarliestExitEpoch

func (state *BeaconStateView) EarliestExitEpoch() (common.Epoch, error)

func (*BeaconStateView) Eth1Data

func (state *BeaconStateView) Eth1Data() (common.Eth1Data, error)

func (*BeaconStateView) Eth1DataVotes

func (state *BeaconStateView) Eth1DataVotes() (common.Eth1DataVotes, error)

func (*BeaconStateView) Eth1DepositIndex

func (state *BeaconStateView) Eth1DepositIndex() (common.DepositIndex, error)

func (*BeaconStateView) ExitBalanceToConsume

func (state *BeaconStateView) ExitBalanceToConsume() (common.Gwei, error)

func (*BeaconStateView) FinalizedCheckpoint

func (state *BeaconStateView) FinalizedCheckpoint() (common.Checkpoint, error)

func (*BeaconStateView) Fork

func (state *BeaconStateView) Fork() (common.Fork, error)

func (*BeaconStateView) ForkSettings

func (state *BeaconStateView) ForkSettings(spec *common.Spec) *common.ForkSettings

func (*BeaconStateView) GenesisTime

func (state *BeaconStateView) GenesisTime() (common.Timestamp, error)

func (*BeaconStateView) GenesisValidatorsRoot

func (state *BeaconStateView) GenesisValidatorsRoot() (common.Root, error)

func (*BeaconStateView) HistoricalRoots

func (state *BeaconStateView) HistoricalRoots() (common.HistoricalRoots, error)

func (*BeaconStateView) HistoricalSummaries

func (state *BeaconStateView) HistoricalSummaries() (capella.HistoricalSummariesList, error)

func (*BeaconStateView) InactivityScores

func (state *BeaconStateView) InactivityScores() (*altair.InactivityScoresView, error)

func (*BeaconStateView) IncrementDepositIndex

func (state *BeaconStateView) IncrementDepositIndex() error

func (*BeaconStateView) IncrementNextWithdrawalIndex

func (state *BeaconStateView) IncrementNextWithdrawalIndex() error

func (*BeaconStateView) JustificationBits

func (state *BeaconStateView) JustificationBits() (common.JustificationBits, error)

func (*BeaconStateView) LatestBlockHeader

func (state *BeaconStateView) LatestBlockHeader() (*common.BeaconBlockHeader, error)

func (*BeaconStateView) LatestExecutionPayloadHeader

func (state *BeaconStateView) LatestExecutionPayloadHeader() (*deneb.ExecutionPayloadHeaderView, error)

func (*BeaconStateView) NextSyncCommittee

func (state *BeaconStateView) NextSyncCommittee() (*common.SyncCommitteeView, error)

func (*BeaconStateView) NextWithdrawalIndex

func (state *BeaconStateView) NextWithdrawalIndex() (common.WithdrawalIndex, error)

func (*BeaconStateView) NextWithdrawalValidatorIndex

func (state *BeaconStateView) NextWithdrawalValidatorIndex() (common.ValidatorIndex, error)

func (*BeaconStateView) PreviousEpochParticipation

func (state *BeaconStateView) PreviousEpochParticipation() (*altair.ParticipationRegistryView, error)

func (*BeaconStateView) PreviousJustifiedCheckpoint

func (state *BeaconStateView) PreviousJustifiedCheckpoint() (common.Checkpoint, error)

func (*BeaconStateView) ProcessBlock

func (state *BeaconStateView) ProcessBlock(ctx context.Context, spec *common.Spec, epc *common.EpochsContext, benv *common.BeaconBlockEnvelope) error

func (*BeaconStateView) ProcessEpoch

func (state *BeaconStateView) ProcessEpoch(ctx context.Context, spec *common.Spec, epc *common.EpochsContext) error

func (*BeaconStateView) RandaoMixes

func (state *BeaconStateView) RandaoMixes() (common.RandaoMixes, error)

func (*BeaconStateView) Raw

func (state *BeaconStateView) Raw(spec *common.Spec) (*BeaconState, error)

Raw converts the tree-structured state into a flattened native Go structure.

func (*BeaconStateView) RotateSyncCommittee

func (state *BeaconStateView) RotateSyncCommittee(next *common.SyncCommitteeView) error

func (*BeaconStateView) SeedRandao

func (state *BeaconStateView) SeedRandao(spec *common.Spec, seed common.Root) error

func (*BeaconStateView) SetBalances

func (state *BeaconStateView) SetBalances(balances []common.Gwei) error

func (*BeaconStateView) SetConsolidationBalanceToConsume added in v0.34.1

func (state *BeaconStateView) SetConsolidationBalanceToConsume(v common.Gwei) error

func (*BeaconStateView) SetCurrentJustifiedCheckpoint

func (state *BeaconStateView) SetCurrentJustifiedCheckpoint(c common.Checkpoint) error

func (*BeaconStateView) SetCurrentSyncCommittee

func (state *BeaconStateView) SetCurrentSyncCommittee(v *common.SyncCommitteeView) error

func (*BeaconStateView) SetDepositBalanceToConsume added in v0.34.1

func (state *BeaconStateView) SetDepositBalanceToConsume(v common.Gwei) error

func (*BeaconStateView) SetDepositRequestsStartIndex added in v0.34.1

func (state *BeaconStateView) SetDepositRequestsStartIndex(v Uint64View) error

func (*BeaconStateView) SetEarliestConsolidationEpoch added in v0.34.1

func (state *BeaconStateView) SetEarliestConsolidationEpoch(v common.Epoch) error

func (*BeaconStateView) SetEarliestExitEpoch added in v0.34.1

func (state *BeaconStateView) SetEarliestExitEpoch(v common.Epoch) error

func (*BeaconStateView) SetEth1Data

func (state *BeaconStateView) SetEth1Data(v common.Eth1Data) error

func (*BeaconStateView) SetExitBalanceToConsume added in v0.34.1

func (state *BeaconStateView) SetExitBalanceToConsume(v common.Gwei) error

func (*BeaconStateView) SetFinalizedCheckpoint

func (state *BeaconStateView) SetFinalizedCheckpoint(c common.Checkpoint) error

func (*BeaconStateView) SetFork

func (state *BeaconStateView) SetFork(f common.Fork) error

func (*BeaconStateView) SetGenesisTime

func (state *BeaconStateView) SetGenesisTime(t common.Timestamp) error

func (*BeaconStateView) SetGenesisValidatorsRoot

func (state *BeaconStateView) SetGenesisValidatorsRoot(r common.Root) error

func (*BeaconStateView) SetJustificationBits

func (state *BeaconStateView) SetJustificationBits(bits common.JustificationBits) error

func (*BeaconStateView) SetLatestBlockHeader

func (state *BeaconStateView) SetLatestBlockHeader(v *common.BeaconBlockHeader) error

func (*BeaconStateView) SetLatestExecutionPayloadHeader

func (state *BeaconStateView) SetLatestExecutionPayloadHeader(h *deneb.ExecutionPayloadHeader) error

func (*BeaconStateView) SetNextSyncCommittee

func (state *BeaconStateView) SetNextSyncCommittee(v *common.SyncCommitteeView) error

func (*BeaconStateView) SetNextWithdrawalIndex

func (state *BeaconStateView) SetNextWithdrawalIndex(nextIndex common.WithdrawalIndex) error

func (*BeaconStateView) SetNextWithdrawalValidatorIndex

func (state *BeaconStateView) SetNextWithdrawalValidatorIndex(nextValidator common.ValidatorIndex) error

func (*BeaconStateView) SetPreviousJustifiedCheckpoint

func (state *BeaconStateView) SetPreviousJustifiedCheckpoint(c common.Checkpoint) error

func (*BeaconStateView) SetSlot

func (state *BeaconStateView) SetSlot(slot common.Slot) error

func (*BeaconStateView) Slashings

func (state *BeaconStateView) Slashings() (common.Slashings, error)

func (*BeaconStateView) Slot

func (state *BeaconStateView) Slot() (common.Slot, error)

func (*BeaconStateView) StateRoots

func (state *BeaconStateView) StateRoots() (common.BatchRoots, error)

func (*BeaconStateView) Validators

func (state *BeaconStateView) Validators() (common.ValidatorRegistry, error)

type CommitteeBits

type CommitteeBits []byte

CommitteeBits is formatted as a serialized SSZ bitvector, with trailing zero bits if length does not align with byte length.

func (CommitteeBits) ByteLength

func (li CommitteeBits) ByteLength(spec *common.Spec) uint64

func (*CommitteeBits) Deserialize

func (li *CommitteeBits) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*CommitteeBits) FixedLength

func (li *CommitteeBits) FixedLength(spec *common.Spec) uint64

func (CommitteeBits) GetBit

func (li CommitteeBits) GetBit(i uint64) bool

func (CommitteeBits) HashTreeRoot

func (li CommitteeBits) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (CommitteeBits) MarshalText

func (li CommitteeBits) MarshalText() ([]byte, error)

func (CommitteeBits) Serialize

func (li CommitteeBits) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

func (CommitteeBits) SetBit

func (li CommitteeBits) SetBit(i uint64, v bool)

func (CommitteeBits) String

func (li CommitteeBits) String() string

func (*CommitteeBits) UnmarshalText

func (li *CommitteeBits) UnmarshalText(text []byte) error

func (CommitteeBits) View

func (li CommitteeBits) View(spec *common.Spec) *CommitteeBitsView

type CommitteeBitsView

type CommitteeBitsView struct {
	*BitVectorView
}

func AsCommitteeBits

func AsCommitteeBits(v View, err error) (*CommitteeBitsView, error)

func (*CommitteeBitsView) Raw

func (v *CommitteeBitsView) Raw(spec *common.Spec) (CommitteeBits, error)

type ExecutionRequests

type ExecutionRequests struct {
	// [New in Electra:EIP6110]
	Deposits common.DepositRequests `json:"deposits" yaml:"deposits"`
	// [New in Electra:EIP7002:EIP7251]
	Withdrawals common.WithdrawalRequests `json:"withdrawals" yaml:"withdrawals"`
	// [New in Electra:EIP7251]
	Consolidations common.ConsolidationRequests `json:"consolidations" yaml:"consolidations"`
}

func (*ExecutionRequests) ByteLength

func (p *ExecutionRequests) ByteLength(spec *common.Spec) uint64

func (*ExecutionRequests) Deserialize

func (p *ExecutionRequests) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*ExecutionRequests) FixedLength

func (*ExecutionRequests) FixedLength(*common.Spec) uint64

func (*ExecutionRequests) HashTreeRoot

func (p *ExecutionRequests) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*ExecutionRequests) Serialize

func (p *ExecutionRequests) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type ExecutionTrackingBeaconState

type ExecutionTrackingBeaconState interface {
	common.BeaconState

	LatestExecutionPayloadHeader() (*deneb.ExecutionPayloadHeaderView, error)
	SetLatestExecutionPayloadHeader(h *deneb.ExecutionPayloadHeader) error
}

type IndexedAttestation

type IndexedAttestation struct {
	// [Modified in Electra:EIP7549]
	// List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
	AttestingIndices common.SlotCommitteeIndices `json:"attesting_indices" yaml:"attesting_indices"`
	Data             phase0.AttestationData      `json:"data" yaml:"data"`
	Signature        common.BLSSignature         `json:"signature" yaml:"signature"`
}

func (*IndexedAttestation) ByteLength

func (a *IndexedAttestation) ByteLength(spec *common.Spec) uint64

func (*IndexedAttestation) Deserialize

func (p *IndexedAttestation) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*IndexedAttestation) FixedLength

func (*IndexedAttestation) FixedLength(*common.Spec) uint64

func (*IndexedAttestation) HashTreeRoot

func (p *IndexedAttestation) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*IndexedAttestation) Serialize

func (a *IndexedAttestation) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type SignedAggregateAndProof

type SignedAggregateAndProof struct {
	Message   AggregateAndProof   `json:"message"`
	Signature common.BLSSignature `json:"signature"`
}

func (*SignedAggregateAndProof) ByteLength

func (a *SignedAggregateAndProof) ByteLength(spec *common.Spec) uint64

func (*SignedAggregateAndProof) Deserialize

func (a *SignedAggregateAndProof) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*SignedAggregateAndProof) FixedLength

func (a *SignedAggregateAndProof) FixedLength(*common.Spec) uint64

func (*SignedAggregateAndProof) HashTreeRoot

func (a *SignedAggregateAndProof) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*SignedAggregateAndProof) Serialize

func (a *SignedAggregateAndProof) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type SignedBeaconBlock

type SignedBeaconBlock struct {
	Message   BeaconBlock         `json:"message" yaml:"message"`
	Signature common.BLSSignature `json:"signature" yaml:"signature"`
}

func (*SignedBeaconBlock) ByteLength

func (b *SignedBeaconBlock) ByteLength(spec *common.Spec) uint64

func (*SignedBeaconBlock) Deserialize

func (b *SignedBeaconBlock) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*SignedBeaconBlock) Envelope

func (*SignedBeaconBlock) FixedLength

func (a *SignedBeaconBlock) FixedLength(*common.Spec) uint64

func (*SignedBeaconBlock) HashTreeRoot

func (b *SignedBeaconBlock) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*SignedBeaconBlock) Serialize

func (b *SignedBeaconBlock) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

func (*SignedBeaconBlock) SignedHeader

func (block *SignedBeaconBlock) SignedHeader(spec *common.Spec) *common.SignedBeaconBlockHeader

type SingleAttestation

type SingleAttestation struct {
	CommitteeIndex common.CommitteeIndex  `json:"committee_index" yaml:"committee_index"`
	AttesterIndex  common.ValidatorIndex  `json:"attester_index" yaml:"attester_index"`
	Data           phase0.AttestationData `json:"data" yaml:"data"`
	Signature      common.BLSSignature    `json:"signature" yaml:"signature"`
}

func (*SingleAttestation) ByteLength

func (a *SingleAttestation) ByteLength() uint64

func (*SingleAttestation) Deserialize

func (a *SingleAttestation) Deserialize(dr *codec.DecodingReader) error

func (*SingleAttestation) FixedLength

func (*SingleAttestation) FixedLength() uint64

func (*SingleAttestation) HashTreeRoot

func (a *SingleAttestation) HashTreeRoot(hFn tree.HashFn) common.Root

func (*SingleAttestation) Serialize

func (a *SingleAttestation) Serialize(w *codec.EncodingWriter) error

Jump to

Keyboard shortcuts

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