beacon

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnkownFork = errors.New("beacon node fork is unknown")
)

Functions

This section is empty.

Types

type AtomicState

type AtomicState struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

func (*AtomicState) Randao

func (as *AtomicState) Randao(parentHash types.Hash) structs.RandaoState

func (*AtomicState) SetRandao

func (as *AtomicState) SetRandao(randao structs.RandaoState)

func (*AtomicState) SetWithdrawals

func (as *AtomicState) SetWithdrawals(withdrawals structs.WithdrawalsState)

func (*AtomicState) Withdrawals

func (as *AtomicState) Withdrawals(parentHash types.Hash) structs.WithdrawalsState

type BeaconClient

type BeaconClient interface {
	SubscribeToHeadEvents(ctx context.Context, slotC chan bcli.HeadEvent)
	GetProposerDuties(structs.Epoch) (*bcli.RegisteredProposersResponse, error)
	SyncStatus() (*bcli.SyncStatusPayloadData, error)
	KnownValidators(structs.Slot) (bcli.AllValidatorsResponse, error)
	Genesis() (structs.GenesisInfo, error)
	GetForkSchedule() (*bcli.GetForkScheduleResponse, error)
	SubscribeToPayloadAttributesEvents(payloadAttrC chan bcli.PayloadAttributesEvent)
}

type Config

type Config struct {
	AltairForkVersion    string
	BellatrixForkVersion string
	CapellaForkVersion   string

	RunPayloadAttributesSubscription bool
}

type Datastore

type Datastore interface {
	GetRegistration(context.Context, types.PublicKey) (types.SignedValidatorRegistration, error)
}

type Manager

type Manager struct {
	Log    log.Logger
	Config Config
}

func NewManager

func NewManager(l log.Logger, cfg Config) *Manager

func (*Manager) Init

func (s *Manager) Init(ctx context.Context, state State, client BeaconClient, d Datastore, vCache ValidatorCache) error

func (*Manager) Run

func (s *Manager) Run(ctx context.Context, state State, client BeaconClient, d Datastore, vCache ValidatorCache) error

type MultiSlotState added in v0.4.2

type MultiSlotState struct {
	// contains filtered or unexported fields
}

func (*MultiSlotState) Duties added in v0.4.2

func (as *MultiSlotState) Duties() structs.DutiesState

func (*MultiSlotState) Fork added in v0.4.2

func (as *MultiSlotState) Fork() structs.ForkState

func (*MultiSlotState) ForkVersion added in v0.4.2

func (as *MultiSlotState) ForkVersion(slot structs.Slot) structs.ForkVersion

func (*MultiSlotState) Genesis added in v0.4.2

func (as *MultiSlotState) Genesis() structs.GenesisInfo

func (*MultiSlotState) HeadSlot added in v0.4.2

func (as *MultiSlotState) HeadSlot() structs.Slot

func (*MultiSlotState) KnownValidators added in v0.4.2

func (as *MultiSlotState) KnownValidators() structs.ValidatorsState

func (*MultiSlotState) KnownValidatorsUpdateTime added in v0.4.2

func (as *MultiSlotState) KnownValidatorsUpdateTime() time.Time

func (*MultiSlotState) ParentBlockHash added in v0.4.14

func (as *MultiSlotState) ParentBlockHash() types.Hash

func (*MultiSlotState) Randao added in v0.4.2

func (as *MultiSlotState) Randao(slot uint64, parentHash types.Hash) structs.RandaoState

func (*MultiSlotState) SetDuties added in v0.4.2

func (as *MultiSlotState) SetDuties(duties structs.DutiesState)

func (*MultiSlotState) SetFork added in v0.4.2

func (as *MultiSlotState) SetFork(fork structs.ForkState)

func (*MultiSlotState) SetGenesis added in v0.4.2

func (as *MultiSlotState) SetGenesis(genesis structs.GenesisInfo)

func (*MultiSlotState) SetHeadSlotIfHigher added in v0.5.0

func (as *MultiSlotState) SetHeadSlotIfHigher(slot structs.Slot) (structs.Slot, bool)

func (*MultiSlotState) SetKnownValidators added in v0.4.2

func (as *MultiSlotState) SetKnownValidators(validators structs.ValidatorsState)

func (*MultiSlotState) SetParentBlockHash added in v0.4.14

func (as *MultiSlotState) SetParentBlockHash(blockHash types.Hash)

func (*MultiSlotState) SetRandao added in v0.4.2

func (as *MultiSlotState) SetRandao(randao structs.RandaoState)

func (*MultiSlotState) SetWithdrawals added in v0.4.2

func (as *MultiSlotState) SetWithdrawals(withdrawals structs.WithdrawalsState)

func (*MultiSlotState) Withdrawals added in v0.4.2

func (as *MultiSlotState) Withdrawals(slot uint64, parentHash types.Hash) structs.WithdrawalsState

type State

type State interface {
	SetGenesis(structs.GenesisInfo)

	Duties() structs.DutiesState
	SetDuties(structs.DutiesState)

	KnownValidators() structs.ValidatorsState
	KnownValidatorsUpdateTime() time.Time
	SetKnownValidators(structs.ValidatorsState)

	HeadSlot() structs.Slot
	SetHeadSlotIfHigher(structs.Slot) (structs.Slot, bool)

	Withdrawals(uint64, types.Hash) structs.WithdrawalsState
	SetWithdrawals(structs.WithdrawalsState)

	SetRandao(structs.RandaoState)
	Randao(uint64, types.Hash) structs.RandaoState

	Fork() structs.ForkState
	SetFork(structs.ForkState)

	ParentBlockHash() types.Hash
	SetParentBlockHash(types.Hash)
}

type ValidatorCache

type ValidatorCache interface {
	Get(types.PublicKey) (structs.ValidatorCacheEntry, bool)
}

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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