cache

package
v0.0.0-...-2eef473 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FinalizedCheckpointsLimit = 50

Variables

View Source
var (
	FinalizedCheckPointNotAvailable = errors.New("finalized checkpoint for block roots proof not available in cache")
	FinalizedCheckPointNotPopulated = errors.New("finalized checkpoint for slot not populated in cache yet")
)

Functions

This section is empty.

Types

type BeaconCache

type BeaconCache struct {
	LastSyncedSyncCommitteePeriod uint64
	Finalized                     Finalized

	LastSyncedExecutionSlot uint64
	InitialCheckpointSlot   uint64
	// contains filtered or unexported fields
}

func New

func New(slotsInEpoch, epochsPerSyncCommitteePeriod uint64) *BeaconCache

func (*BeaconCache) AddCheckPoint

func (b *BeaconCache) AddCheckPoint(finalizedHeaderRoot common.Hash, blockRootsTree *ssz.Node, slot uint64)

func (*BeaconCache) AddCheckPointSlots

func (b *BeaconCache) AddCheckPointSlots(slots []uint64)

func (*BeaconCache) GetClosestCheckpoint

func (b *BeaconCache) GetClosestCheckpoint(slot uint64) (Proof, error)

func (*BeaconCache) LastFinalizedHeader

func (b *BeaconCache) LastFinalizedHeader() common.Hash

func (*BeaconCache) SetInitialCheckpointSlot

func (b *BeaconCache) SetInitialCheckpointSlot(slot uint64)

func (*BeaconCache) SetLastSyncedFinalizedState

func (b *BeaconCache) SetLastSyncedFinalizedState(finalizedHeaderRoot common.Hash, slot uint64)

type CheckPoints

type CheckPoints struct {
	Slots  []uint64
	Proofs map[uint64]Proof
}

type Finalized

type Finalized struct {
	// Stores the last successfully imported hash
	LastSyncedHash common.Hash
	// Stores the last successfully synced slot
	LastSyncedSlot uint64
	// Stores finalized checkpoints
	Checkpoints CheckPoints
}

type Proof

type Proof struct {
	FinalizedBlockRoot common.Hash
	BlockRootsTree     *ssz.Node
	Slot               uint64
}

Jump to

Keyboard shortcuts

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