beacon

package
v0.0.0-...-fa633b5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	AttestingIndices []uint64
	Signature        string
	Slot             uint64
	Index            uint64
	BeaconBlockRoot  string
	SourceEpoch      uint64
	SourceRoot       string
	TargetEpoch      uint64
	TargetRoot       string
}

type AttestationInfo

type AttestationInfo struct {
	AggregationBits bitfield.Bitlist
	SlotIndex       uint64
	CommitteeIndex  uint64
}

type AttesterSlashing

type AttesterSlashing struct {
	Attestation1 Attestation
	Attestation2 Attestation
}

type BeaconBlock

type BeaconBlock struct {
	Slot uint64

	// consensus
	ProposerIndex     uint64
	Attestations      []AttestationInfo
	ProposerSlashings []ProposerSlashing
	AttesterSlashing  []AttesterSlashing
	Withdrawals       []Withdrawal
	SyncAggregate     SyncAggregate

	// execute layer
	HasExecutionPayload  bool
	FeeRecipient         common.Address
	ExecutionBlockNumber uint64
}

type BeaconClientType

type BeaconClientType int

Beacon client type

const (
	// This client is a traditional "split process" design, where the beacon
	// client and validator process are separate and run in different
	// containers
	SplitProcess BeaconClientType = iota

	// This client is a "single process" where the beacon client and
	// validator run in the same process (or run as separate processes
	// within the same docker container)
	SingleProcess

	// Unknown / missing client type
	Unknown
)

type BeaconHead

type BeaconHead struct {
	Epoch                  uint64
	Slot                   uint64
	FinalizedEpoch         uint64
	FinalizedSlot          uint64
	JustifiedEpoch         uint64
	PreviousJustifiedEpoch uint64
}

type Client

type Client interface {
	GetClientType() (BeaconClientType, error)
	GetSyncStatus() (SyncStatus, error)
	GetEth2Config() (Eth2Config, error)
	GetEth2DepositContract() (Eth2DepositContract, error)
	GetAttestations(blockId string) ([]AttestationInfo, bool, error)
	GetBeaconBlock(blockId string) (BeaconBlock, bool, error)
	GetBeaconHead() (BeaconHead, error)
	GetValidatorStatusByIndex(index string, opts *ValidatorStatusOptions) (ValidatorStatus, error)
	GetValidatorStatus(pubkey types.ValidatorPubkey, opts *ValidatorStatusOptions) (ValidatorStatus, error)
	GetValidatorStatuses(pubkeys []types.ValidatorPubkey, opts *ValidatorStatusOptions) (map[types.ValidatorPubkey]ValidatorStatus, error)
	GetValidatorIndex(pubkey types.ValidatorPubkey) (uint64, error)
	GetValidatorSyncDuties(indices []uint64, epoch uint64) (map[uint64]bool, error)
	GetValidatorProposerDuties(epoch uint64) (map[uint64]uint64, error)
	GetDomainData(domainType []byte, epoch uint64) ([]byte, error)
	ExitValidator(validatorIndex, epoch uint64, signature types.ValidatorSignature) error
	Close() error
	GetEth1DataForEth2Block(blockId string) (Eth1Data, bool, error)
	GetCommitteesForEpoch(epoch uint64) ([]Committee, error)
	GetSyncCommitteesForEpoch(epoch uint64) ([]SyncCommittee, error)
}

Beacon client interface

type Committee

type Committee struct {
	Index      uint64
	Slot       uint64
	Validators []uint64
}

type Eth1Data

type Eth1Data struct {
	DepositRoot  common.Hash
	DepositCount uint64
	BlockHash    common.Hash
}

type Eth2Config

type Eth2Config struct {
	GenesisForkVersion           []byte
	GenesisValidatorsRoot        []byte
	GenesisEpoch                 uint64
	GenesisTime                  uint64
	SecondsPerSlot               uint64
	SlotsPerEpoch                uint64
	SecondsPerEpoch              uint64
	EpochsPerSyncCommitteePeriod uint64
	CapellaForkVersion           []byte
	CapellaForkEpoch             uint64
}

type Eth2DepositContract

type Eth2DepositContract struct {
	ChainID uint64
	Address common.Address
}

type ProposerSlashing

type ProposerSlashing struct {
	SignedHeader1 SignedHeader
	SignedHeader2 SignedHeader
}

type SignedHeader

type SignedHeader struct {
	Slot          uint64
	ProposerIndex uint64
	ParentRoot    string
	StateRoot     string
	BodyRoot      string
	Signature     string
}

type SyncAggregate

type SyncAggregate struct {
	SyncCommitteeBits      bitfield.Bitlist
	SyncCommitteeSignature string
}

type SyncCommittee

type SyncCommittee struct {
	ValIndex uint64
}

type SyncStatus

type SyncStatus struct {
	Syncing  bool
	Progress float64
}

API response types

type ValidatorStatus

type ValidatorStatus struct {
	Pubkey                     types.ValidatorPubkey
	Index                      uint64
	WithdrawalCredentials      common.Hash
	Balance                    uint64
	EffectiveBalance           uint64
	Slashed                    bool
	ActivationEligibilityEpoch uint64
	ActivationEpoch            uint64
	ExitEpoch                  uint64
	WithdrawableEpoch          uint64
	Exists                     bool
	Status                     ethpb.ValidatorStatus
}

type ValidatorStatusOptions

type ValidatorStatusOptions struct {
	Epoch *uint64
	Slot  *uint64
}

API request options

type Withdrawal

type Withdrawal struct {
	WithdrawIndex  uint64
	ValidatorIndex uint64
	Address        common.Address
	Amount         uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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