Documentation
¶
Index ¶
- Variables
- type AttestationRewards
- type AttesterDuty
- type BeaconBlockHeader
- type BeaconCommittee
- type BeaconCommitteeSelection
- type BeaconCommitteeSubscription
- type BlobSidecarEvent
- type Blobs
- func (t *Blobs) HashTreeRoot() (root [32]byte, err error)
- func (t *Blobs) HashTreeRootWith(hh sszutils.HashWalker) error
- func (t *Blobs) MarshalSSZ() ([]byte, error)
- func (t *Blobs) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (t *Blobs) SizeSSZ() int
- func (b *Blobs) String() string
- func (t *Blobs) UnmarshalSSZ(buf []byte) (err error)
- type BlockEvent
- type BlockGossipEvent
- type BlockRewards
- type ChainReorgEvent
- type DataColumnSidecarEvent
- type DepositContract
- type Event
- type ExecutionPayloadAvailableEvent
- type ExecutionPayloadEvent
- type FastConfirmationEvent
- type Finality
- type FinalizedCheckpointEvent
- type ForkChoice
- type ForkChoiceNode
- type ForkChoiceNodeV2
- type ForkChoiceNodeValidity
- type ForkChoicePayloadStatus
- type ForkChoiceV2
- type Genesis
- type HeadEvent
- type HeadEventV2
- type IdealAttestationRewards
- type InclusionList
- type InclusionListEvent
- type NodeIdentity
- type NodeIdentityMetadata
- type PayloadAttributesData
- type PayloadAttributesEvent
- type PayloadAttributesV1
- type PayloadAttributesV2
- type PayloadAttributesV3
- type PayloadAttributesV4
- type PayloadAttributesV5
- type Peer
- type ProposalPreparation
- type ProposerDuty
- type SignedInclusionList
- type SignedValidatorRegistration
- func (t *SignedValidatorRegistration) HashTreeRoot() (root [32]byte, err error)
- func (t *SignedValidatorRegistration) HashTreeRootWith(hh sszutils.HashWalker) error
- func (s *SignedValidatorRegistration) MarshalJSON() ([]byte, error)
- func (t *SignedValidatorRegistration) MarshalSSZ() ([]byte, error)
- func (t *SignedValidatorRegistration) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (s *SignedValidatorRegistration) MarshalYAML() ([]byte, error)
- func (t *SignedValidatorRegistration) SizeSSZ() int
- func (s *SignedValidatorRegistration) String() string
- func (s *SignedValidatorRegistration) UnmarshalJSON(input []byte) error
- func (t *SignedValidatorRegistration) UnmarshalSSZ(buf []byte) (err error)
- func (s *SignedValidatorRegistration) UnmarshalYAML(input []byte) error
- type SyncCommittee
- type SyncCommitteeDuty
- type SyncCommitteeReward
- type SyncCommitteeSubscription
- type SyncState
- type Validator
- type ValidatorAttestationRewards
- type ValidatorBalance
- type ValidatorLiveness
- type ValidatorRegistration
- func (t *ValidatorRegistration) HashTreeRoot() (root [32]byte, err error)
- func (t *ValidatorRegistration) HashTreeRootWith(hh sszutils.HashWalker) error
- func (v *ValidatorRegistration) MarshalJSON() ([]byte, error)
- func (t *ValidatorRegistration) MarshalSSZ() ([]byte, error)
- func (t *ValidatorRegistration) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (v *ValidatorRegistration) MarshalYAML() ([]byte, error)
- func (t *ValidatorRegistration) SizeSSZ() int
- func (v *ValidatorRegistration) String() string
- func (v *ValidatorRegistration) UnmarshalJSON(input []byte) error
- func (t *ValidatorRegistration) UnmarshalSSZ(buf []byte) (err error)
- func (v *ValidatorRegistration) UnmarshalYAML(input []byte) error
- type ValidatorState
- func (v ValidatorState) HasActivated() bool
- func (v ValidatorState) HasBalance() bool
- func (v ValidatorState) HasExited() bool
- func (v ValidatorState) IsActive() bool
- func (v ValidatorState) IsAttesting() bool
- func (v ValidatorState) IsExited() bool
- func (v ValidatorState) IsPending() bool
- func (v *ValidatorState) MarshalJSON() ([]byte, error)
- func (v ValidatorState) String() string
- func (v *ValidatorState) UnmarshalJSON(input []byte) error
Constants ¶
This section is empty.
Variables ¶
var ForkChoiceNodeValidityStrings = [...]string{
"unknown",
"invalid",
"valid",
"optimistic",
"not_yet_revealed",
}
ForkChoiceNodeValidityStrings are the strings for fork choice validity names.
var ForkChoicePayloadStatusStrings = [...]string{
"unknown",
"empty",
"full",
"pending",
}
ForkChoicePayloadStatusStrings are the strings for fork choice payload status names.
var SupportedEventTopics = map[string]bool{ "attestation": true, "attester_slashing": true, "blob_sidecar": true, "block": true, "block_gossip": true, "bls_to_execution_change": true, "chain_reorg": true, "contribution_and_proof": true, "data_column_sidecar": true, "execution_payload": true, "execution_payload_available": true, "execution_payload_bid": true, "execution_payload_gossip": true, "fast_confirmation": true, "finalized_checkpoint": true, "head": true, "head_v2": true, "inclusion_list": true, "payload_attestation_message": true, "payload_attributes": true, "proposer_preferences": true, "proposer_slashing": true, "single_attestation": true, "voluntary_exit": true, }
SupportedEventTopics is a map of supported event topics.
Functions ¶
This section is empty.
Types ¶
type AttestationRewards ¶
type AttestationRewards struct {
IdealRewards []IdealAttestationRewards `json:"ideal_rewards"`
TotalRewards []ValidatorAttestationRewards `json:"total_rewards"`
}
AttestationRewards are the rewards for a number of attesting validators.
type AttesterDuty ¶
type AttesterDuty struct {
// PubKey is the public key of the validator that should attest.
PubKey phase0.BLSPubKey
// Slot is the slot in which the validator should attest.
Slot phase0.Slot
// ValidatorIndex is the index of the validator that should attest.
ValidatorIndex phase0.ValidatorIndex
// CommitteeIndex is the index of the committee in which the attesting validator has been placed.
CommitteeIndex phase0.CommitteeIndex
// CommitteeLength is the length of the committee in which the attesting validator has been placed.
CommitteeLength uint64
// CommitteesAtSlot is the number of committees in the slot.
CommitteesAtSlot uint64
// ValidatorCommitteeIndex is the index of the validator in the list of validators in the committee.
ValidatorCommitteeIndex uint64
}
AttesterDuty is the data regarding which validators have the duty to attest in a slot.
func (*AttesterDuty) MarshalJSON ¶
func (a *AttesterDuty) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*AttesterDuty) String ¶
func (a *AttesterDuty) String() string
String returns a string version of the structure.
func (*AttesterDuty) UnmarshalJSON ¶
func (a *AttesterDuty) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BeaconBlockHeader ¶
type BeaconBlockHeader struct {
// Root is the root of the beacon block.
Root phase0.Root
// Canonical is true if the block is considered canonical.
Canonical bool
// Header is the beacon block header.
Header *phase0.SignedBeaconBlockHeader
}
BeaconBlockHeader is the data providing information about beacon blocks.
func (*BeaconBlockHeader) MarshalJSON ¶
func (b *BeaconBlockHeader) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BeaconBlockHeader) String ¶
func (b *BeaconBlockHeader) String() string
String returns a string version of the structure.
func (*BeaconBlockHeader) UnmarshalJSON ¶
func (b *BeaconBlockHeader) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BeaconCommittee ¶
type BeaconCommittee struct {
// Slot is the slot in which the committee attests.
Slot phase0.Slot
// Index is the index of the committee.
Index phase0.CommitteeIndex
// Validators is the list of validator indices in the committee.
Validators []phase0.ValidatorIndex
}
BeaconCommittee is the data providing information validator membership of committees.
func (*BeaconCommittee) MarshalJSON ¶
func (b *BeaconCommittee) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BeaconCommittee) String ¶
func (b *BeaconCommittee) String() string
String returns a string version of the structure.
func (*BeaconCommittee) UnmarshalJSON ¶
func (b *BeaconCommittee) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BeaconCommitteeSelection ¶ added in v0.1.0
type BeaconCommitteeSelection struct {
// ValidatorIndex is the index of the validator making the selection request.
ValidatorIndex phase0.ValidatorIndex
// Slot is the slot for which the validator is attesting.
Slot phase0.Slot
// SelectionProof is the proof of the validator being selected for beacon committee aggregation.
SelectionProof phase0.BLSSignature
}
BeaconCommitteeSelection is the data required for a beacon committee selection.
func (*BeaconCommitteeSelection) MarshalJSON ¶ added in v0.1.0
func (b *BeaconCommitteeSelection) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BeaconCommitteeSelection) String ¶ added in v0.1.0
func (b *BeaconCommitteeSelection) String() string
String returns a string version of the structure.
func (*BeaconCommitteeSelection) UnmarshalJSON ¶ added in v0.1.0
func (b *BeaconCommitteeSelection) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BeaconCommitteeSubscription ¶
type BeaconCommitteeSubscription struct {
// ValidatorIndex is the index of the validator making the subscription request.
ValidatorIndex phase0.ValidatorIndex
// Slot is the slot for which the validator is attesting.
Slot phase0.Slot
// CommitteeIndex is the index of the committee of which the validator is a member at the given slot.
CommitteeIndex phase0.CommitteeIndex
// CommitteesAtSlot is the number of committees at the given slot.
CommitteesAtSlot uint64
// IsAggregator is true if the validator that wishes to subscribe is required to aggregate attestations.
IsAggregator bool
}
BeaconCommitteeSubscription is the data required for a beacon committee subscription.
func (*BeaconCommitteeSubscription) MarshalJSON ¶
func (b *BeaconCommitteeSubscription) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BeaconCommitteeSubscription) String ¶
func (b *BeaconCommitteeSubscription) String() string
String returns a string version of the structure.
func (*BeaconCommitteeSubscription) UnmarshalJSON ¶
func (b *BeaconCommitteeSubscription) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BlobSidecarEvent ¶
type BlobSidecarEvent struct {
BlockRoot phase0.Root
Slot phase0.Slot
Index deneb.BlobIndex
KZGCommitment deneb.KZGCommitment
VersionedHash deneb.VersionedHash
}
BlobSidecarEvent is the data for the blob sidecar event.
func (*BlobSidecarEvent) MarshalJSON ¶
func (e *BlobSidecarEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BlobSidecarEvent) String ¶
func (e *BlobSidecarEvent) String() string
String returns a string version of the structure.
func (*BlobSidecarEvent) UnmarshalJSON ¶
func (e *BlobSidecarEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Blobs ¶
Blobs represents a list of blobs.
func (*Blobs) HashTreeRoot ¶
HashTreeRoot computes the SSZ hash tree root of the *Blobs.
func (*Blobs) HashTreeRootWith ¶
func (t *Blobs) HashTreeRootWith(hh sszutils.HashWalker) error
HashTreeRootWith computes the SSZ hash tree root of the *Blobs using the given hash walker.
func (*Blobs) MarshalSSZ ¶
MarshalSSZ marshals the *Blobs to SSZ-encoded bytes.
func (*Blobs) MarshalSSZTo ¶
MarshalSSZTo marshals the *Blobs to SSZ-encoded bytes, appending to the provided buffer.
func (*Blobs) UnmarshalSSZ ¶
UnmarshalSSZ unmarshals the *Blobs from SSZ-encoded bytes.
type BlockEvent ¶
type BlockEvent struct {
Slot phase0.Slot
Block phase0.Root
ExecutionOptimistic bool
// BuilderIndex and BlockHash come from the block's
// signed_execution_payload_bid.message. They are only sent from Gloas
// onwards, and are nil when the beacon node does not send them. A pointer
// is used because 0 is a valid builder index.
BuilderIndex *uint64
BlockHash *phase0.Hash32
}
BlockEvent is the data for the block event.
func (*BlockEvent) MarshalJSON ¶
func (e *BlockEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BlockEvent) String ¶
func (e *BlockEvent) String() string
String returns a string version of the structure.
func (*BlockEvent) UnmarshalJSON ¶
func (e *BlockEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BlockGossipEvent ¶
BlockGossipEvent is the data for the block gossip event.
func (*BlockGossipEvent) MarshalJSON ¶
func (e *BlockGossipEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BlockGossipEvent) String ¶
func (e *BlockGossipEvent) String() string
String returns a string version of the structure.
func (*BlockGossipEvent) UnmarshalJSON ¶
func (e *BlockGossipEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BlockRewards ¶
type BlockRewards struct {
ProposerIndex phase0.ValidatorIndex
Total phase0.Gwei
Attestations phase0.Gwei
SyncAggregate phase0.Gwei
ProposerSlashings phase0.Gwei
AttesterSlashings phase0.Gwei
}
BlockRewards are the rewards for proposing a block.
func (*BlockRewards) MarshalJSON ¶
func (b *BlockRewards) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*BlockRewards) String ¶
func (b *BlockRewards) String() string
String returns a string version of the structure.
func (*BlockRewards) UnmarshalJSON ¶
func (b *BlockRewards) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ChainReorgEvent ¶
type ChainReorgEvent struct {
Slot phase0.Slot
Depth uint64
OldHeadBlock phase0.Root
NewHeadBlock phase0.Root
OldHeadState phase0.Root
NewHeadState phase0.Root
// Epoch is the epoch of Slot as reported by the beacon node.
//
// The beacon-APIs chain_reorg event has no formal schema, only an example,
// and not every beacon node sends this field (Nimbus omits it). It is left
// at zero when absent; consumers that need it should derive it from Slot
// (epoch = slot / SLOTS_PER_EPOCH), which is what every client that does
// send it reports.
Epoch phase0.Epoch
ExecutionOptimistic bool
}
ChainReorgEvent is the data for the head event.
func (*ChainReorgEvent) MarshalJSON ¶
func (e *ChainReorgEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ChainReorgEvent) String ¶
func (e *ChainReorgEvent) String() string
String returns a string version of the structure.
func (*ChainReorgEvent) UnmarshalJSON ¶
func (e *ChainReorgEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type DataColumnSidecarEvent ¶
type DataColumnSidecarEvent struct {
BlockRoot phase0.Root
Slot phase0.Slot
Index uint64
KZGCommitments []deneb.KZGCommitment
}
DataColumnSidecarEvent is the data for the data column sidecar event.
KZGCommitments is optional. beacon-APIs #583 removed kzg_commitments from the event; Lighthouse omits it for every fork, Lodestar, Teku and Grandine omit it from Gloas onwards, and Prysm and Nimbus still send it. It is nil when the beacon node omitted the field, and an empty non-nil slice when the node sent an empty list.
func (*DataColumnSidecarEvent) MarshalJSON ¶
func (e *DataColumnSidecarEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*DataColumnSidecarEvent) String ¶
func (e *DataColumnSidecarEvent) String() string
String returns a string version of the structure.
func (*DataColumnSidecarEvent) UnmarshalJSON ¶
func (e *DataColumnSidecarEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type DepositContract ¶
DepositContract represents the details of the Ethereum 1 deposit contract for a chain.
func (*DepositContract) MarshalJSON ¶
func (d *DepositContract) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*DepositContract) String ¶
func (d *DepositContract) String() string
String returns a string version of the structure.
func (*DepositContract) UnmarshalJSON ¶
func (d *DepositContract) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Event ¶
type Event struct {
// Topic is the topic of the event.
Topic string
// Data is the data of the event.
Data any
}
Event is the container for events sent from the API.
func (*Event) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ExecutionPayloadAvailableEvent ¶
ExecutionPayloadAvailableEvent is the data for the execution payload available event.
func (*ExecutionPayloadAvailableEvent) MarshalJSON ¶
func (e *ExecutionPayloadAvailableEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ExecutionPayloadAvailableEvent) String ¶
func (e *ExecutionPayloadAvailableEvent) String() string
String returns a string version of the structure.
func (*ExecutionPayloadAvailableEvent) UnmarshalJSON ¶
func (e *ExecutionPayloadAvailableEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ExecutionPayloadEvent ¶ added in v0.1.6
type ExecutionPayloadEvent struct {
Slot phase0.Slot
BuilderIndex uint64
BlockHash phase0.Hash32
BlockRoot phase0.Root
ExecutionOptimistic bool
}
ExecutionPayloadEvent is the data for the `execution_payload` and `execution_payload_gossip` EIP-7732 events. Both carry a flat summary of a revealed execution payload (not the full SignedExecutionPayloadEnvelope): the `execution_payload` event fires when the envelope is imported into the fork-choice store, and `execution_payload_gossip` when it passes gossip validation. ExecutionOptimistic is only present on the `execution_payload` event.
func (*ExecutionPayloadEvent) MarshalJSON ¶ added in v0.1.6
func (e *ExecutionPayloadEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ExecutionPayloadEvent) String ¶ added in v0.1.6
func (e *ExecutionPayloadEvent) String() string
String returns a string version of the structure.
func (*ExecutionPayloadEvent) UnmarshalJSON ¶ added in v0.1.6
func (e *ExecutionPayloadEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
Only the identifying slot and block root are required. builder_index and block_hash are parsed when present and validated for length, tolerating per-client field divergence (e.g. some clients emit an extra, non-spec state_root, which is ignored).
type FastConfirmationEvent ¶ added in v0.1.3
type FastConfirmationEvent struct {
Slot phase0.Slot
Block phase0.Root
// CurrentSlot is the wall-clock slot at which the algorithm was executed.
// It is nil when the beacon node does not send it.
CurrentSlot *phase0.Slot
}
FastConfirmationEvent is the data for the fast confirmation event.
func (*FastConfirmationEvent) MarshalJSON ¶ added in v0.1.3
func (e *FastConfirmationEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*FastConfirmationEvent) String ¶ added in v0.1.3
func (e *FastConfirmationEvent) String() string
String returns a string version of the structure.
func (*FastConfirmationEvent) UnmarshalJSON ¶ added in v0.1.3
func (e *FastConfirmationEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Finality ¶
type Finality struct {
// Finalized is the finalized checkpoint.
Finalized *phase0.Checkpoint
// Justified is the justified checkpoint.
Justified *phase0.Checkpoint
// PreviousJustified is the previous justified checkpoint.
PreviousJustified *phase0.Checkpoint
}
Finality is the data regarding finality checkpoints at a given state.
func (*Finality) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Finality) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type FinalizedCheckpointEvent ¶
type FinalizedCheckpointEvent struct {
Block phase0.Root
State phase0.Root
Epoch phase0.Epoch
ExecutionOptimistic bool
}
FinalizedCheckpointEvent is the data for the finalized checkpoint event.
func (*FinalizedCheckpointEvent) MarshalJSON ¶
func (e *FinalizedCheckpointEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*FinalizedCheckpointEvent) String ¶
func (e *FinalizedCheckpointEvent) String() string
String returns a string version of the structure.
func (*FinalizedCheckpointEvent) UnmarshalJSON ¶
func (e *FinalizedCheckpointEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ForkChoice ¶
type ForkChoice struct {
// JustifiedCheckpoint is the current justified checkpoint.
JustifiedCheckpoint phase0.Checkpoint
// FInalizedCheckpoint is the current finalized checkpoint.
FinalizedCheckpoint phase0.Checkpoint
// ForkChoiceNodes contains the fork choice nodes.
ForkChoiceNodes []*ForkChoiceNode
// ExtraData is the optional, client-specific extra data of the fork choice store.
ExtraData map[string]any
}
ForkChoice is the data regarding the node's current fork choice context.
func (*ForkChoice) MarshalJSON ¶
func (f *ForkChoice) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ForkChoice) String ¶
func (f *ForkChoice) String() string
String returns a string version of the structure.
func (*ForkChoice) UnmarshalJSON ¶
func (f *ForkChoice) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ForkChoiceNode ¶
type ForkChoiceNode struct {
// Slot is the slot of the node.
Slot phase0.Slot
// BlockRoot is the block root of the node.
BlockRoot phase0.Root
// ParentRoot is the parent root of the node.
// A zero root means none: some clients return a null parent root for the oldest retained node.
ParentRoot phase0.Root
// JustifiedEpcoh is the justified epoch of the node.
JustifiedEpoch phase0.Epoch
// FinalizedEpoch is the finalized epoch of the node.
FinalizedEpoch phase0.Epoch
// Weight is the weight of the node.
Weight uint64
// Validity is the validity of the node.
Validity ForkChoiceNodeValidity
// ExecutionBlockHash is the execution block hash of the node.
ExecutionBlockHash phase0.Root
// ExtraData is the extra data of the node.
ExtraData map[string]any
}
ForkChoiceNode is a node in the fork choice tree.
func (*ForkChoiceNode) MarshalJSON ¶
func (f *ForkChoiceNode) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ForkChoiceNode) String ¶
func (f *ForkChoiceNode) String() string
String returns a string version of the structure.
func (*ForkChoiceNode) UnmarshalJSON ¶
func (f *ForkChoiceNode) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ForkChoiceNodeV2 ¶ added in v0.1.10
type ForkChoiceNodeV2 struct {
// Slot is the slot of the beacon block.
Slot phase0.Slot
// BlockRoot is the block root of the beacon block.
BlockRoot phase0.Root
// PayloadStatus is the payload status of the node.
PayloadStatus ForkChoicePayloadStatus
// ParentRoot is the block root of the parent fork choice node. For Gloas empty and full nodes
// this is the node's own block root, pointing at its pending node; otherwise it is the beacon
// block's parent root.
ParentRoot phase0.Root
// ParentPayloadStatus is the payload status of the parent fork choice node, nil if the parent is
// not retained in the fork choice tree.
ParentPayloadStatus *ForkChoicePayloadStatus
// JustifiedCheckpoint is the justified checkpoint recorded for the node.
JustifiedCheckpoint phase0.Checkpoint
// FinalizedCheckpoint is the finalized checkpoint recorded for the node.
FinalizedCheckpoint phase0.Checkpoint
// Weight is the raw stored weight of the node in Gwei.
Weight phase0.Gwei
// Validity is the execution validity of the chain ending at ExecutionBlockHash.
Validity ForkChoiceNodeValidity
// ExecutionBlockHash is the execution payload hash for full nodes, and the bid's parent block hash
// for Gloas pending and empty nodes.
ExecutionBlockHash phase0.Hash32
// PayloadAttesterCount is the number of PTC positions with a recorded vote.
PayloadAttesterCount uint64
// PayloadAvailabilityYesCount is the number of PTC positions voting that the payload was received on time.
PayloadAvailabilityYesCount uint64
// PayloadDataAvailabilityYesCount is the number of PTC positions voting that the blob data is available.
PayloadDataAvailabilityYesCount uint64
// ExtraData is the client-specific extra data of the node; empty if the client provides none.
ExtraData map[string]any
}
ForkChoiceNodeV2 is a node in the fork choice tree, identified by its block root and payload status.
func (ForkChoiceNodeV2) MarshalJSON ¶ added in v0.1.10
func (f ForkChoiceNodeV2) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ForkChoiceNodeV2) String ¶ added in v0.1.10
func (f *ForkChoiceNodeV2) String() string
String returns a string version of the structure.
func (*ForkChoiceNodeV2) UnmarshalJSON ¶ added in v0.1.10
func (f *ForkChoiceNodeV2) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ForkChoiceNodeValidity ¶
type ForkChoiceNodeValidity uint64
ForkChoiceNodeValidity represents the validity of a fork choice node.
const ( // ForkChoiceNodeValidityUnknown is an unknown fork choice node. ForkChoiceNodeValidityUnknown ForkChoiceNodeValidity = iota // ForkChoiceNodeValidityInvalid is an invalid fork choice node. ForkChoiceNodeValidityInvalid // ForkChoiceNodeValidityValid is a valid fork choice node. ForkChoiceNodeValidityValid // ForkChoiceNodeValidityOptimistic is an optimistic fork choice node. ForkChoiceNodeValidityOptimistic // ForkChoiceNodeValidityNotYetRevealed is a Gloas fork choice node whose // execution payload has not been revealed. ForkChoiceNodeValidityNotYetRevealed )
func ForkChoiceNodeValidityFromString ¶
func ForkChoiceNodeValidityFromString(input string) (ForkChoiceNodeValidity, error)
ForkChoiceNodeValidityFromString converts a string input to a fork choice.
func (*ForkChoiceNodeValidity) MarshalJSON ¶
func (d *ForkChoiceNodeValidity) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (ForkChoiceNodeValidity) String ¶
func (d ForkChoiceNodeValidity) String() string
String returns a string representation of the ForkChoiceNodeValidity.
func (*ForkChoiceNodeValidity) UnmarshalJSON ¶
func (d *ForkChoiceNodeValidity) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler. Unlike fork choice node decoding, which keeps an unrecognised validity in the node's ExtraData, a lone validity has nowhere to keep the original value, so an unrecognised one is an error rather than silently unknown.
type ForkChoicePayloadStatus ¶ added in v0.1.10
type ForkChoicePayloadStatus uint64
ForkChoicePayloadStatus is the payload status of a Gloas fork choice node.
const ( // ForkChoicePayloadStatusUnknown is an unknown payload status. ForkChoicePayloadStatusUnknown ForkChoicePayloadStatus = iota // ForkChoicePayloadStatusEmpty is the node representing a block without its execution payload. ForkChoicePayloadStatusEmpty // ForkChoicePayloadStatusFull is the node representing a block with its execution payload. ForkChoicePayloadStatusFull // ForkChoicePayloadStatusPending is the node that is the parent of a block's empty and full nodes. ForkChoicePayloadStatusPending )
func ForkChoicePayloadStatusFromString ¶ added in v0.1.10
func ForkChoicePayloadStatusFromString(input string) (ForkChoicePayloadStatus, error)
ForkChoicePayloadStatusFromString converts a string input to a fork choice payload status. Only the values the beacon API defines (pending, empty, full) are accepted.
func (ForkChoicePayloadStatus) MarshalJSON ¶ added in v0.1.10
func (s ForkChoicePayloadStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (ForkChoicePayloadStatus) String ¶ added in v0.1.10
func (s ForkChoicePayloadStatus) String() string
String returns a string representation of the ForkChoicePayloadStatus.
func (*ForkChoicePayloadStatus) UnmarshalJSON ¶ added in v0.1.10
func (s *ForkChoicePayloadStatus) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ForkChoiceV2 ¶ added in v0.1.10
type ForkChoiceV2 struct {
// JustifiedCheckpoint is the current justified checkpoint.
JustifiedCheckpoint phase0.Checkpoint
// FinalizedCheckpoint is the current finalized checkpoint.
FinalizedCheckpoint phase0.Checkpoint
// ForkChoiceNodes contains the fork choice nodes.
ForkChoiceNodes []*ForkChoiceNodeV2
// ExtraData is the client-specific extra data of the fork choice store; empty if the
// client provides none.
ExtraData map[string]any
}
ForkChoiceV2 is the data regarding the node's current fork choice context, as returned by GET /eth/v2/debug/fork_choice (ethereum/beacon-APIs#615). It contains one node per (block root, payload status) pair.
Decoding follows the spec: every field it requires must be present, and enumerations only accept the values it defines.
func (ForkChoiceV2) MarshalJSON ¶ added in v0.1.10
func (f ForkChoiceV2) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ForkChoiceV2) String ¶ added in v0.1.10
func (f *ForkChoiceV2) String() string
String returns a string version of the structure.
func (*ForkChoiceV2) UnmarshalJSON ¶ added in v0.1.10
func (f *ForkChoiceV2) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Genesis ¶
type Genesis struct {
GenesisTime time.Time
GenesisValidatorsRoot phase0.Root
GenesisForkVersion phase0.Version
}
Genesis provides information about the genesis of a chain.
func (*Genesis) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Genesis) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type HeadEvent ¶
type HeadEvent struct {
Slot phase0.Slot
Block phase0.Root
State phase0.Root
EpochTransition bool
CurrentDutyDependentRoot phase0.Root
PreviousDutyDependentRoot phase0.Root
ExecutionOptimistic bool
}
HeadEvent is the data for the head event.
func (*HeadEvent) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*HeadEvent) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type HeadEventV2 ¶ added in v0.1.7
type HeadEventV2 struct {
Slot phase0.Slot
Block phase0.Root
State phase0.Root
PayloadStatus string
EpochTransition bool
CurrentEpochDependentRoot phase0.Root
NextEpochDependentRoot phase0.Root
ExecutionOptimistic bool
}
HeadEventV2 is the data for the head_v2 event (Gloas / EIP-7732).
Relative to HeadEvent it drops previous_duty_dependent_root, renames current_duty_dependent_root to current_epoch_dependent_root, and adds next_epoch_dependent_root plus payload_status. The event can be emitted twice for the same block when payload_status transitions from empty to full.
func (*HeadEventV2) MarshalJSON ¶ added in v0.1.7
func (e *HeadEventV2) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*HeadEventV2) String ¶ added in v0.1.7
func (e *HeadEventV2) String() string
String returns a string version of the structure.
func (*HeadEventV2) UnmarshalJSON ¶ added in v0.1.7
func (e *HeadEventV2) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type IdealAttestationRewards ¶
type IdealAttestationRewards struct {
EffectiveBalance phase0.Gwei
Head int64
Target int64
Source int64
InclusionDelay *phase0.Gwei
Inactivity int64
}
IdealAttestationRewards are the ideal attestation rewards for an attestation. Head, target, source and inactivity are signed Gwei values, as in the beacon API spec.
func (*IdealAttestationRewards) MarshalJSON ¶
func (i *IdealAttestationRewards) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*IdealAttestationRewards) String ¶
func (i *IdealAttestationRewards) String() string
String returns a string version of the structure.
func (*IdealAttestationRewards) UnmarshalJSON ¶
func (i *IdealAttestationRewards) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type InclusionList ¶
type InclusionList struct {
Slot phase0.Slot
ValidatorIndex phase0.ValidatorIndex
DependentRoot phase0.Root `ssz-size:"32"`
Transactions []bellatrix.Transaction `ssz-max:"1048576,1073741824" ssz-size:"?,?"`
}
InclusionList represents the inclusion list.
func (*InclusionList) UnmarshalJSON ¶
func (e *InclusionList) UnmarshalJSON(input []byte) error
type InclusionListEvent ¶
type InclusionListEvent struct {
// Version is the fork version of the beacon chain.
Version spec.DataVersion
// Data is the data of the event.
Data *SignedInclusionList
}
InclusionListEvent represents the inclusion list event.
func (*InclusionListEvent) MarshalJSON ¶
func (e *InclusionListEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*InclusionListEvent) String ¶
func (e *InclusionListEvent) String() string
String returns a string version of the structure.
func (*InclusionListEvent) UnmarshalJSON ¶
func (e *InclusionListEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NodeIdentity ¶ added in v0.1.6
type NodeIdentity struct {
// PeerID is the node's libp2p peer ID.
PeerID string `json:"peer_id"`
// ENR is the node's Ethereum node record.
ENR string `json:"enr"`
// P2PAddresses are the multiaddrs on which eth2 RPC requests are served.
P2PAddresses []string `json:"p2p_addresses"`
// DiscoveryAddresses are the multiaddrs on which the node listens for
// discv5 requests.
DiscoveryAddresses []string `json:"discovery_addresses"`
// Metadata is the node's libp2p metadata.
Metadata NodeIdentityMetadata `json:"metadata"`
}
NodeIdentity contains the node's network identity.
func (*NodeIdentity) String ¶ added in v0.1.6
func (n *NodeIdentity) String() string
String returns a string version of the structure.
type NodeIdentityMetadata ¶ added in v0.1.6
type NodeIdentityMetadata struct {
// SeqNumber versions the node's metadata (decimal string).
SeqNumber string `json:"seq_number"`
// Attnets is the hex bitvector of persistent attestation subnet
// subscriptions.
Attnets string `json:"attnets"`
// Syncnets is the hex bitvector of sync committee subnet subscriptions
// (Altair onwards).
Syncnets string `json:"syncnets,omitempty"`
// CustodyGroupCount is the node's custody group count (Fulu onwards,
// decimal string).
CustodyGroupCount string `json:"custody_group_count,omitempty"`
}
NodeIdentityMetadata is the node's libp2p metadata.
type PayloadAttributesData ¶
type PayloadAttributesData struct {
// ProposerIndex is the index of the proposer.
ProposerIndex phase0.ValidatorIndex
// ProposalSlot is the slot of the proposal.
ProposalSlot phase0.Slot
// ParentBlockNumber is the number of the parent block.
// The field is not part of the event from Gloas onwards: it is 0 there unless
// the beacon node still sends it, and is never marshaled.
ParentBlockNumber uint64
// ParentBlockRoot is the root of the parent block.
ParentBlockRoot phase0.Root
// ParentBlockHash is the hash of the parent block.
ParentBlockHash phase0.Hash32
// SafeBlockHash is the execution block hash the node would pass as
// safeBlockHash in engine_forkchoiceUpdated. Part of the event from Gloas
// onwards; nil when the beacon node does not send it.
SafeBlockHash *phase0.Hash32
// FinalizedBlockHash is the execution block hash the node would pass as
// finalizedBlockHash in engine_forkchoiceUpdated. Part of the event from
// Gloas onwards; nil when the beacon node does not send it.
FinalizedBlockHash *phase0.Hash32
// V1 is the v1 payload attributes (Bellatrix).
V1 *PayloadAttributesV1
// V2 is the v2 payload attributes (Capella).
V2 *PayloadAttributesV2
// V3 is the v3 payload attributes (Deneb, Electra, Fulu).
V3 *PayloadAttributesV3
// V4 is the v4 payload attributes (Gloas).
V4 *PayloadAttributesV4
// V5 is the v5 payload attributes (Heze).
V5 *PayloadAttributesV5
}
PayloadAttributesData represents the data of a payload_attributes event.
type PayloadAttributesEvent ¶
type PayloadAttributesEvent struct {
// Version is the fork version of the beacon chain.
Version spec.DataVersion
// Data is the data of the event.
Data *PayloadAttributesData
}
PayloadAttributesEvent represents the data of a payload_attributes event.
func (*PayloadAttributesEvent) MarshalJSON ¶
func (e *PayloadAttributesEvent) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*PayloadAttributesEvent) String ¶
func (e *PayloadAttributesEvent) String() string
String returns a string version of the structure.
func (*PayloadAttributesEvent) UnmarshalJSON ¶
func (e *PayloadAttributesEvent) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PayloadAttributesV1 ¶
type PayloadAttributesV1 struct {
// Timestamp is the timestamp of the payload.
Timestamp uint64
// PrevRandao is the previous randao.
PrevRandao [32]byte
// SuggestedFeeRecipient is the suggested fee recipient.
SuggestedFeeRecipient bellatrix.ExecutionAddress
}
PayloadAttributesV1 represents the payload attributes.
func (*PayloadAttributesV1) UnmarshalJSON ¶
func (p *PayloadAttributesV1) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PayloadAttributesV2 ¶
type PayloadAttributesV2 struct {
// Timestamp is the timestamp of the payload.
Timestamp uint64
// PrevRandao is the previous randao.
PrevRandao [32]byte
// SuggestedFeeRecipient is the suggested fee recipient.
SuggestedFeeRecipient bellatrix.ExecutionAddress
// Withdrawals is the list of withdrawals.
Withdrawals []*capella.Withdrawal
}
PayloadAttributesV2 represents the payload attributes v2.
func (*PayloadAttributesV2) UnmarshalJSON ¶
func (p *PayloadAttributesV2) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PayloadAttributesV3 ¶
type PayloadAttributesV3 struct {
// Timestamp is the timestamp of the payload.
Timestamp uint64
// PrevRandao is the previous randao.
PrevRandao [32]byte
// SuggestedFeeRecipient is the suggested fee recipient.
SuggestedFeeRecipient bellatrix.ExecutionAddress
// Withdrawals is the list of withdrawals.
Withdrawals []*capella.Withdrawal
// ParentBeaconBlockRoot is the parent beacon block root.
ParentBeaconBlockRoot phase0.Root
}
PayloadAttributesV3 represents the payload attributes v3.
func (*PayloadAttributesV3) UnmarshalJSON ¶
func (p *PayloadAttributesV3) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PayloadAttributesV4 ¶
type PayloadAttributesV4 struct {
// Timestamp is the timestamp of the payload.
Timestamp uint64
// PrevRandao is the previous randao.
PrevRandao [32]byte
// SuggestedFeeRecipient is the suggested fee recipient.
SuggestedFeeRecipient bellatrix.ExecutionAddress
// Withdrawals is the list of withdrawals.
Withdrawals []*capella.Withdrawal
// ParentBeaconBlockRoot is the parent beacon block root.
ParentBeaconBlockRoot phase0.Root
// SlotNumber is the slot number of the payload.
SlotNumber uint64
// TargetGasLimit is the target gas limit of the payload.
TargetGasLimit uint64
}
PayloadAttributesV4 represents the payload attributes v4.
func (*PayloadAttributesV4) UnmarshalJSON ¶
func (p *PayloadAttributesV4) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PayloadAttributesV5 ¶ added in v0.1.8
type PayloadAttributesV5 struct {
// Timestamp is the timestamp of the payload.
Timestamp uint64
// PrevRandao is the previous randao.
PrevRandao [32]byte
// SuggestedFeeRecipient is the suggested fee recipient.
SuggestedFeeRecipient bellatrix.ExecutionAddress
// Withdrawals is the list of withdrawals.
Withdrawals []*capella.Withdrawal
// ParentBeaconBlockRoot is the parent beacon block root.
ParentBeaconBlockRoot phase0.Root
// SlotNumber is the slot number of the payload.
SlotNumber uint64
// TargetGasLimit is the target gas limit of the payload.
TargetGasLimit uint64
// InclusionListTransactions is the list of inclusion list transactions.
InclusionListTransactions []bellatrix.Transaction
}
PayloadAttributesV5 represents the payload attributes v5.
func (*PayloadAttributesV5) UnmarshalJSON ¶ added in v0.1.8
func (p *PayloadAttributesV5) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Peer ¶
type Peer struct {
PeerID string `json:"peer_id"`
Enr string `json:"enr,omitempty"`
LastSeenP2PAddress string `json:"last_seen_p2p_address"`
State string `json:"state"`
Direction string `json:"direction"`
}
Peer contains all the available information about a nodes peer.
func (*Peer) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Peer) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ProposalPreparation ¶
type ProposalPreparation struct {
// ValidatorIndex is the index of the validator making the proposal request.
ValidatorIndex phase0.ValidatorIndex
// FeeRecipient is the execution address to be used with preparing blocks.
FeeRecipient bellatrix.ExecutionAddress `ssz-size:"20"`
}
ProposalPreparation is the data required for proposal preparation.
func (*ProposalPreparation) MarshalJSON ¶
func (p *ProposalPreparation) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ProposalPreparation) String ¶
func (p *ProposalPreparation) String() string
String returns a string version of the structure.
func (*ProposalPreparation) UnmarshalJSON ¶
func (p *ProposalPreparation) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ProposerDuty ¶
type ProposerDuty struct {
PubKey phase0.BLSPubKey
Slot phase0.Slot
ValidatorIndex phase0.ValidatorIndex
}
ProposerDuty represents a duty of a validator to propose a slot.
func (*ProposerDuty) MarshalJSON ¶
func (p *ProposerDuty) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ProposerDuty) String ¶
func (p *ProposerDuty) String() string
String returns a string version of the structure.
func (*ProposerDuty) UnmarshalJSON ¶
func (p *ProposerDuty) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SignedInclusionList ¶
type SignedInclusionList struct {
Message *InclusionList
Signature phase0.BLSSignature `ssz-size:"96"`
}
SignedInclusionList represents the data of the inclusion list event.
type SignedValidatorRegistration ¶
type SignedValidatorRegistration struct {
Message *ValidatorRegistration
Signature phase0.BLSSignature `ssz-size:"96"`
}
SignedValidatorRegistration is a signed ValidatorRegistrationV1.
func (*SignedValidatorRegistration) HashTreeRoot ¶
func (t *SignedValidatorRegistration) HashTreeRoot() (root [32]byte, err error)
HashTreeRoot computes the SSZ hash tree root of the *SignedValidatorRegistration.
func (*SignedValidatorRegistration) HashTreeRootWith ¶
func (t *SignedValidatorRegistration) HashTreeRootWith(hh sszutils.HashWalker) error
HashTreeRootWith computes the SSZ hash tree root of the *SignedValidatorRegistration using the given hash walker.
func (*SignedValidatorRegistration) MarshalJSON ¶
func (s *SignedValidatorRegistration) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SignedValidatorRegistration) MarshalSSZ ¶
func (t *SignedValidatorRegistration) MarshalSSZ() ([]byte, error)
MarshalSSZ marshals the *SignedValidatorRegistration to SSZ-encoded bytes.
func (*SignedValidatorRegistration) MarshalSSZTo ¶
func (t *SignedValidatorRegistration) MarshalSSZTo(buf []byte) (dst []byte, err error)
MarshalSSZTo marshals the *SignedValidatorRegistration to SSZ-encoded bytes, appending to the provided buffer.
func (*SignedValidatorRegistration) MarshalYAML ¶
func (s *SignedValidatorRegistration) MarshalYAML() ([]byte, error)
MarshalYAML implements yaml.Marshaler.
func (*SignedValidatorRegistration) SizeSSZ ¶
func (t *SignedValidatorRegistration) SizeSSZ() int
SizeSSZ returns the SSZ encoded size of the *SignedValidatorRegistration.
func (*SignedValidatorRegistration) String ¶
func (s *SignedValidatorRegistration) String() string
String returns a string version of the structure.
func (*SignedValidatorRegistration) UnmarshalJSON ¶
func (s *SignedValidatorRegistration) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*SignedValidatorRegistration) UnmarshalSSZ ¶
func (t *SignedValidatorRegistration) UnmarshalSSZ(buf []byte) (err error)
UnmarshalSSZ unmarshals the *SignedValidatorRegistration from SSZ-encoded bytes.
func (*SignedValidatorRegistration) UnmarshalYAML ¶
func (s *SignedValidatorRegistration) UnmarshalYAML(input []byte) error
UnmarshalYAML implements yaml.Unmarshaler.
type SyncCommittee ¶
type SyncCommittee struct {
// Validators is the list of validator indices in the committee.
Validators []phase0.ValidatorIndex
// ValidatorAggregates are the lists of validators in each aggregate.
ValidatorAggregates [][]phase0.ValidatorIndex
}
SyncCommittee is the data providing validator membership of sync committees.
func (*SyncCommittee) MarshalJSON ¶
func (s *SyncCommittee) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SyncCommittee) String ¶
func (s *SyncCommittee) String() string
String returns a string version of the structure.
func (*SyncCommittee) UnmarshalJSON ¶
func (s *SyncCommittee) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SyncCommitteeDuty ¶
type SyncCommitteeDuty struct {
// PubKey is the public key of the validator that should contribute.
PubKey phase0.BLSPubKey
// ValidatorIndex is the index of the validator that should contribute.
ValidatorIndex phase0.ValidatorIndex
// ValidatorSyncCommitteeIndices is the index of the validator in the list of validators in the committee.
ValidatorSyncCommitteeIndices []phase0.CommitteeIndex
}
SyncCommitteeDuty is the data regarding which validators have the duty to contribute to sync committees in a slot.
func (*SyncCommitteeDuty) MarshalJSON ¶
func (s *SyncCommitteeDuty) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SyncCommitteeDuty) String ¶
func (s *SyncCommitteeDuty) String() string
String returns a string version of the structure.
func (*SyncCommitteeDuty) UnmarshalJSON ¶
func (s *SyncCommitteeDuty) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SyncCommitteeReward ¶
type SyncCommitteeReward struct {
ValidatorIndex phase0.ValidatorIndex
// Reward can be negative, so it is an int64 (but still a Gwei value).
Reward int64
}
SyncCommitteeReward is the rewards for a validator in a sync committee.
func (*SyncCommitteeReward) MarshalJSON ¶
func (s *SyncCommitteeReward) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SyncCommitteeReward) String ¶
func (s *SyncCommitteeReward) String() string
String returns a string version of the structure.
func (*SyncCommitteeReward) UnmarshalJSON ¶
func (s *SyncCommitteeReward) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SyncCommitteeSubscription ¶
type SyncCommitteeSubscription struct {
// ValidatorIndex is the index of the validator making the subscription request.
ValidatorIndex phase0.ValidatorIndex
// SyncCommitteeIndices are the indices of the sync committees of which the validator is a member.
SyncCommitteeIndices []phase0.CommitteeIndex
// UntilEpoch is the epoch at which the subscription no longer applies.
UntilEpoch phase0.Epoch
}
SyncCommitteeSubscription is the data required for a sync committee subscription.
func (*SyncCommitteeSubscription) MarshalJSON ¶
func (s *SyncCommitteeSubscription) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SyncCommitteeSubscription) String ¶
func (s *SyncCommitteeSubscription) String() string
String returns a string version of the structure.
func (*SyncCommitteeSubscription) UnmarshalJSON ¶
func (s *SyncCommitteeSubscription) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SyncState ¶
type SyncState struct {
// HeadSlot is the head slot of the chain as understood by the node.
HeadSlot phase0.Slot
// SyncDistance is the distance between the node's highest synced slot and the head slot.
SyncDistance phase0.Slot
// IsOptimistic is true if the node is optimistic.
IsOptimistic bool
// IsSyncing is true if the node is syncing.
IsSyncing bool
}
SyncState is the data regarding the node's synchronization state to the chain.
func (*SyncState) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*SyncState) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Validator ¶
type Validator struct {
Index phase0.ValidatorIndex
Balance phase0.Gwei
Status ValidatorState
Validator *phase0.Validator
}
Validator contains the spec validator plus additional fields.
func (*Validator) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Validator) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ValidatorAttestationRewards ¶
type ValidatorAttestationRewards struct {
ValidatorIndex phase0.ValidatorIndex
Head int64
Target int64
Source int64
InclusionDelay *phase0.Gwei
Inactivity int64
}
ValidatorAttestationRewards are the attestation rewards for a validator. Head, target, source and inactivity are signed Gwei values, as in the beacon API spec.
func (*ValidatorAttestationRewards) MarshalJSON ¶
func (v *ValidatorAttestationRewards) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ValidatorAttestationRewards) String ¶
func (v *ValidatorAttestationRewards) String() string
String returns a string version of the structure.
func (*ValidatorAttestationRewards) UnmarshalJSON ¶
func (v *ValidatorAttestationRewards) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ValidatorBalance ¶
type ValidatorBalance struct {
Index phase0.ValidatorIndex
Balance phase0.Gwei
}
ValidatorBalance contains the balance of a validator.
func (*ValidatorBalance) MarshalJSON ¶
func (v *ValidatorBalance) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ValidatorBalance) String ¶
func (v *ValidatorBalance) String() string
String returns a string version of the structure.
func (*ValidatorBalance) UnmarshalJSON ¶
func (v *ValidatorBalance) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ValidatorLiveness ¶
type ValidatorLiveness struct {
// Index is the validator index.
Index phase0.ValidatorIndex
// IsLive indicates whether the validator is live in the given epoch.
IsLive bool
}
ValidatorLiveness represents the observed liveness state of a validator.
func (*ValidatorLiveness) MarshalJSON ¶
func (v *ValidatorLiveness) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ValidatorLiveness) String ¶
func (v *ValidatorLiveness) String() string
String returns a string version of the structure.
func (*ValidatorLiveness) UnmarshalJSON ¶
func (v *ValidatorLiveness) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ValidatorRegistration ¶
type ValidatorRegistration struct {
FeeRecipient bellatrix.ExecutionAddress `ssz-size:"20"`
GasLimit uint64
Timestamp time.Time
Pubkey phase0.BLSPubKey `ssz-size:"48"`
}
ValidatorRegistration represents a ValidatorRegistrationV1.
func (*ValidatorRegistration) HashTreeRoot ¶
func (t *ValidatorRegistration) HashTreeRoot() (root [32]byte, err error)
HashTreeRoot computes the SSZ hash tree root of the *ValidatorRegistration.
func (*ValidatorRegistration) HashTreeRootWith ¶
func (t *ValidatorRegistration) HashTreeRootWith(hh sszutils.HashWalker) error
HashTreeRootWith computes the SSZ hash tree root of the *ValidatorRegistration using the given hash walker.
func (*ValidatorRegistration) MarshalJSON ¶
func (v *ValidatorRegistration) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ValidatorRegistration) MarshalSSZ ¶
func (t *ValidatorRegistration) MarshalSSZ() ([]byte, error)
MarshalSSZ marshals the *ValidatorRegistration to SSZ-encoded bytes.
func (*ValidatorRegistration) MarshalSSZTo ¶
func (t *ValidatorRegistration) MarshalSSZTo(buf []byte) (dst []byte, err error)
MarshalSSZTo marshals the *ValidatorRegistration to SSZ-encoded bytes, appending to the provided buffer.
func (*ValidatorRegistration) MarshalYAML ¶
func (v *ValidatorRegistration) MarshalYAML() ([]byte, error)
MarshalYAML implements yaml.Marshaler.
func (*ValidatorRegistration) SizeSSZ ¶
func (t *ValidatorRegistration) SizeSSZ() int
SizeSSZ returns the SSZ encoded size of the *ValidatorRegistration.
func (*ValidatorRegistration) String ¶
func (v *ValidatorRegistration) String() string
String returns a string version of the structure.
func (*ValidatorRegistration) UnmarshalJSON ¶
func (v *ValidatorRegistration) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*ValidatorRegistration) UnmarshalSSZ ¶
func (t *ValidatorRegistration) UnmarshalSSZ(buf []byte) (err error)
UnmarshalSSZ unmarshals the *ValidatorRegistration from SSZ-encoded bytes.
func (*ValidatorRegistration) UnmarshalYAML ¶
func (v *ValidatorRegistration) UnmarshalYAML(input []byte) error
UnmarshalYAML implements yaml.Unmarshaler.
type ValidatorState ¶
type ValidatorState int
ValidatorState defines the state of the validator.
const ( // ValidatorStateUnknown means no information can be found about the validator. ValidatorStateUnknown ValidatorState = iota // ValidatorStatePendingInitialized means the validator is not yet in the queue to be activated. ValidatorStatePendingInitialized // ValidatorStatePendingQueued means the validator is in the queue to be activated. ValidatorStatePendingQueued // ValidatorStateActiveOngoing means the validator is active. ValidatorStateActiveOngoing // ValidatorStateActiveExiting means the validator is active but exiting. ValidatorStateActiveExiting // ValidatorStateActiveSlashed means the validator is active but exiting due to being slashed. ValidatorStateActiveSlashed // ValidatorStateExitedUnslashed means the validator has exited without being slashed. ValidatorStateExitedUnslashed // ValidatorStateExitedSlashed means the validator has exited due to being slashed. ValidatorStateExitedSlashed // ValidatorStateWithdrawalPossible means it is possible to withdraw funds from the validator. ValidatorStateWithdrawalPossible // ValidatorStateWithdrawalDone means funds have been withdrawn from the validator. ValidatorStateWithdrawalDone )
func ValidatorToState ¶
func ValidatorToState(validator *phase0.Validator, balance *phase0.Gwei, currentEpoch phase0.Epoch, farFutureEpoch phase0.Epoch, ) ValidatorState
ValidatorToState is a helper that calculates the validator status given a validator struct.
func (ValidatorState) HasActivated ¶
func (v ValidatorState) HasActivated() bool
HasActivated returns true if the validator has activated.
func (ValidatorState) HasBalance ¶
func (v ValidatorState) HasBalance() bool
HasBalance returns true if the validator has a balance.
func (ValidatorState) HasExited ¶
func (v ValidatorState) HasExited() bool
HasExited returns true if the validator has exited.
func (ValidatorState) IsActive ¶
func (v ValidatorState) IsActive() bool
IsActive returns true if the validator is active.
func (ValidatorState) IsAttesting ¶
func (v ValidatorState) IsAttesting() bool
IsAttesting returns true if the validator should be attesting.
func (ValidatorState) IsExited ¶
func (v ValidatorState) IsExited() bool
IsExited returns true if the validator is exited.
func (ValidatorState) IsPending ¶
func (v ValidatorState) IsPending() bool
IsPending returns true if the validator is pending.
func (*ValidatorState) MarshalJSON ¶
func (v *ValidatorState) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (ValidatorState) String ¶
func (v ValidatorState) String() string
func (*ValidatorState) UnmarshalJSON ¶
func (v *ValidatorState) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
Source Files
¶
- attestationrewards.go
- attesterduty.go
- beaconblockheader.go
- beaconcommittee.go
- beaconcommitteeselection.go
- beaconcommitteesubscription.go
- blobs.go
- blobs_ssz.go
- blobsidecarevent.go
- blockevent.go
- blockgossipevent.go
- blockrewards.go
- chainreorgevent.go
- consts.go
- datacolumnsidecarevent.go
- depositcontract.go
- event.go
- executionpayloadavailableevent.go
- executionpayloadevent.go
- fastconfirmationevent.go
- finality.go
- finalizedcheckpointevent.go
- forkchoice.go
- forkchoicev2.go
- generate.go
- genesis.go
- headevent.go
- headeventv2.go
- inclusionlistevent.go
- nodeidentity.go
- payloadattributesevent.go
- peers.go
- proposalpreparation.go
- proposerduty.go
- signedvalidatorregistration.go
- signedvalidatorregistration_ssz.go
- synccommittee.go
- synccommitteeduty.go
- synccommitteereward.go
- synccommitteesubscription.go
- syncstate.go
- validator.go
- validatorbalance.go
- validatorliveness.go
- validatorregistration.go
- validatorregistration_ssz.go
- validatorstate.go