synced_data

package
v1.9.7-0...-24da1cd Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSynced                 = errors.New("not synced")
	ErrPreviousStateNotAvailable = errors.New("previous state not available")
)

Functions

func EmptyCancel

func EmptyCancel()

Types

type CancelFn

type CancelFn func()

type SyncedData

type SyncedData interface {
	OnHeadState(newState *state.CachingBeaconState) error
	UnsetHeadState()
	ViewHeadState(fn ViewHeadStateFn) error
	ViewPreviousHeadState(fn ViewHeadStateFn) error
	Syncing() bool
	HeadSlot() uint64
	HeadRoot() common.Hash
	CommitteeCount(epoch uint64) uint64
	ValidatorPublicKeyByIndex(index int) (common.Bytes48, error)
	ValidatorIndexByPublicKey(pubkey common.Bytes48) (uint64, bool, error)
	HistoricalRootElementAtIndex(index int) (common.Hash, error)
	HistoricalSummaryElementAtIndex(index int) (*cltypes.HistoricalSummary, error)
}

type SyncedDataManager

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

func NewSyncedDataManager

func NewSyncedDataManager(cfg *clparams.BeaconChainConfig, enabled bool) *SyncedDataManager

func (*SyncedDataManager) CommitteeCount

func (s *SyncedDataManager) CommitteeCount(epoch uint64) uint64

func (*SyncedDataManager) HeadRoot

func (s *SyncedDataManager) HeadRoot() common.Hash

func (*SyncedDataManager) HeadSlot

func (s *SyncedDataManager) HeadSlot() uint64

func (*SyncedDataManager) HistoricalRootElementAtIndex

func (s *SyncedDataManager) HistoricalRootElementAtIndex(index int) (common.Hash, error)

func (*SyncedDataManager) HistoricalSummaryElementAtIndex

func (s *SyncedDataManager) HistoricalSummaryElementAtIndex(index int) (*cltypes.HistoricalSummary, error)

func (*SyncedDataManager) OnHeadState

func (s *SyncedDataManager) OnHeadState(newState *state.CachingBeaconState) (err error)

OnHeadState updates the current head state and tracks the previous state.

func (*SyncedDataManager) Syncing

func (s *SyncedDataManager) Syncing() bool

func (*SyncedDataManager) UnsetHeadState

func (s *SyncedDataManager) UnsetHeadState()

func (*SyncedDataManager) ValidatorIndexByPublicKey

func (s *SyncedDataManager) ValidatorIndexByPublicKey(pubkey common.Bytes48) (uint64, bool, error)

func (*SyncedDataManager) ValidatorPublicKeyByIndex

func (s *SyncedDataManager) ValidatorPublicKeyByIndex(index int) (common.Bytes48, error)

func (*SyncedDataManager) ViewHeadState

func (s *SyncedDataManager) ViewHeadState(fn ViewHeadStateFn) error

ViewHeadState allows safe, read-only access to the current head state.

func (*SyncedDataManager) ViewPreviousHeadState

func (s *SyncedDataManager) ViewPreviousHeadState(fn ViewHeadStateFn) error

ViewPreviousHeadState allows safe, read-only access to the previous head state.

type ViewHeadStateFn

type ViewHeadStateFn func(headState *state.CachingBeaconState) error

Directories

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

Jump to

Keyboard shortcuts

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