beacon

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "0.3.6"
)

Variables

View Source
var (
	DurationPerSlot  = time.Second * 12
	DurationPerEpoch = DurationPerSlot * time.Duration(structs.SlotsPerEpoch)
	ErrUnkownFork    = errors.New("beacon node fork is unknown")
)

Functions

This section is empty.

Types

type AtomicState

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

func (*AtomicState) Duties

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

func (*AtomicState) Fork

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

func (*AtomicState) ForkVersion

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

func (*AtomicState) Genesis

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

func (*AtomicState) HeadSlot

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

func (*AtomicState) KnownValidators

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

func (*AtomicState) KnownValidatorsUpdateTime

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

func (*AtomicState) Randao

func (as *AtomicState) Randao() string

func (*AtomicState) SetDuties

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

func (*AtomicState) SetFork

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

func (*AtomicState) SetGenesis

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

func (*AtomicState) SetHeadSlot

func (as *AtomicState) SetHeadSlot(headSlot structs.Slot)

func (*AtomicState) SetKnownValidators

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

func (*AtomicState) SetRandao

func (as *AtomicState) SetRandao(randao string)

func (*AtomicState) SetWithdrawals

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

func (*AtomicState) Withdrawals

func (as *AtomicState) Withdrawals() 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)
	GetWithdrawals(structs.Slot) (*bcli.GetWithdrawalsResponse, error)
	Randao(structs.Slot) (string, error)
	GetForkSchedule() (*bcli.GetForkScheduleResponse, error)
}

type Config

type Config struct {
	AltairForkVersion    string
	BellatrixForkVersion string
	CapellaForkVersion   string
}

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, cgf 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 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
	SetHeadSlot(structs.Slot)

	Withdrawals() structs.WithdrawalsState
	SetWithdrawals(structs.WithdrawalsState)

	SetRandao(string)
	Randao() string

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

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