iterator

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocationUpToDate = errors.New("location up to date")
)

Functions

This section is empty.

Types

type BackFillingBlockNextResponse added in v1.18.0

type BackFillingBlockNextResponse struct {
	From      uint64
	To        uint64
	Direction BackfillingBlockDirection
}

BackFillingBlockNextResponse is an inclusive block range to process.

type BackFillingCheckpointNextResponse added in v0.0.179

type BackFillingCheckpointNextResponse struct {
	Next       phase0.Epoch
	LookAheads []phase0.Epoch
	Direction  BackfillingCheckpointDirection
}

type BackfillingBlock added in v1.18.0

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

BackfillingBlock walks execution-block-number space, gated on the consensus layer: the head frontier never runs past the execution block embedded in the CL-finalized beacon block. Backfill walks immutable history down to a floor.

func NewBackfillingBlock added in v1.18.0

func NewBackfillingBlock(
	log observability.ContextualLogger, networkName, networkID string,
	cannonType xatu.CannonType,
	coordinatorClient *coordinator.Client,
	wallclock *ethwallclock.EthereumBeaconChain,
	metrics *BackfillingBlockMetrics,
	beacon *ethereum.BeaconNode,
	config *BackfillingBlockConfig,
) *BackfillingBlock

NewBackfillingBlock creates an EL cannon block iterator.

func (*BackfillingBlock) GetMarker added in v1.18.0

GetMarker extracts the block marker from a location.

func (*BackfillingBlock) Next added in v1.18.0

Next returns the next inclusive block range to process. It blocks (sleeping until the next epoch) when caught up to the CL-finalized ceiling and backfill is complete.

func (*BackfillingBlock) Start added in v1.18.0

func (b *BackfillingBlock) Start(ctx context.Context) error

Start logs the iterator configuration.

func (*BackfillingBlock) UpdateLocation added in v1.18.0

func (b *BackfillingBlock) UpdateLocation(ctx context.Context, from, to uint64, direction BackfillingBlockDirection) error

UpdateLocation advances the cursor after a range has been processed. Head advances finalized_block to the top of the range; backfill lowers backfill_block to the bottom of the range.

type BackfillingBlockConfig added in v1.18.0

type BackfillingBlockConfig struct {
	// MaxRangeSize is the maximum number of blocks returned by a single Next().
	MaxRangeSize uint64 `yaml:"maxRangeSize" default:"50"`
	Backfill     struct {
		Enabled bool   `yaml:"enabled" default:"false"`
		ToBlock uint64 `yaml:"toBlock" default:"0"`
	} `yaml:"backfill"`
}

BackfillingBlockConfig configures an EL cannon block iterator.

type BackfillingBlockDirection added in v1.18.0

type BackfillingBlockDirection string

BackfillingBlockDirection is the direction an EL cannon iterator is moving.

const (
	BackfillingBlockDirectionHead     BackfillingBlockDirection = "head"
	BackfillingBlockDirectionBackfill BackfillingBlockDirection = "backfill"
)

type BackfillingBlockMetrics added in v1.18.0

type BackfillingBlockMetrics struct {
	BackfillBlock  *prometheus.GaugeVec
	FinalizedBlock *prometheus.GaugeVec
	CeilingBlock   *prometheus.GaugeVec
	Lag            *prometheus.GaugeVec
}

BackfillingBlockMetrics exposes the position of an EL cannon block iterator.

func NewBackfillingBlockMetrics added in v1.18.0

func NewBackfillingBlockMetrics(namespace string) BackfillingBlockMetrics

NewBackfillingBlockMetrics registers and returns the block iterator metrics.

func (*BackfillingBlockMetrics) SetBackfillBlock added in v1.18.0

func (s *BackfillingBlockMetrics) SetBackfillBlock(cannonType, network string, block float64)

SetBackfillBlock records the backfill position.

func (*BackfillingBlockMetrics) SetCeilingBlock added in v1.18.0

func (s *BackfillingBlockMetrics) SetCeilingBlock(network string, block float64)

SetCeilingBlock records the CL-finalized execution block ceiling.

func (*BackfillingBlockMetrics) SetFinalizedBlock added in v1.18.0

func (s *BackfillingBlockMetrics) SetFinalizedBlock(cannonType, network string, block float64)

SetFinalizedBlock records the head position.

func (*BackfillingBlockMetrics) SetLag added in v1.18.0

func (s *BackfillingBlockMetrics) SetLag(cannonType, network string, direction BackfillingBlockDirection, lag float64)

SetLag records the iterator lag in blocks for a direction.

type BackfillingCheckpoint added in v0.0.136

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

func NewBackfillingCheckpoint added in v0.0.136

func NewBackfillingCheckpoint(
	log observability.ContextualLogger, networkName, networkID string,
	cannonType xatu.CannonType,
	coordinatorClient *coordinator.Client,
	wallclock *ethwallclock.EthereumBeaconChain,
	metrics *BackfillingCheckpointMetrics,
	beacon *ethereum.BeaconNode,
	checkpoint string,
	lookAheadDistance int,
	config *BackfillingCheckpointConfig,
) *BackfillingCheckpoint

func (*BackfillingCheckpoint) GetMarker added in v0.0.179

func (*BackfillingCheckpoint) Next added in v0.0.136

func (*BackfillingCheckpoint) Start added in v0.0.179

func (c *BackfillingCheckpoint) Start(ctx context.Context, activationFork spec.DataVersion) error

func (*BackfillingCheckpoint) UpdateLocation added in v0.0.136

func (c *BackfillingCheckpoint) UpdateLocation(ctx context.Context, epoch phase0.Epoch, direction BackfillingCheckpointDirection) error

type BackfillingCheckpointConfig added in v1.0.8

type BackfillingCheckpointConfig struct {
	Backfill struct {
		Enabled bool         `yaml:"enabled" default:"false"`
		ToEpoch phase0.Epoch `yaml:"toEpoch" default:"0"`
	} `yaml:"backfill"`
}

type BackfillingCheckpointDirection added in v0.0.179

type BackfillingCheckpointDirection string
const (
	BackfillingCheckpointDirectionBackfill BackfillingCheckpointDirection = "backfill"
	BackfillingCheckpointDirectionHead     BackfillingCheckpointDirection = "head"
)

type BackfillingCheckpointMetrics added in v0.0.136

type BackfillingCheckpointMetrics struct {
	BackfillEpoch            *prometheus.GaugeVec
	FinalizedEpoch           *prometheus.GaugeVec
	FinalizedCheckpointEpoch *prometheus.GaugeVec
	Lag                      *prometheus.GaugeVec
}

func NewBackfillingCheckpointMetrics added in v0.0.136

func NewBackfillingCheckpointMetrics(namespace string) BackfillingCheckpointMetrics

func (*BackfillingCheckpointMetrics) SetBackfillEpoch added in v0.0.136

func (s *BackfillingCheckpointMetrics) SetBackfillEpoch(cannonType, network, checkpoint string, epoch float64)

func (*BackfillingCheckpointMetrics) SetFinalizedCheckpointEpoch added in v0.0.179

func (s *BackfillingCheckpointMetrics) SetFinalizedCheckpointEpoch(network string, epoch float64)

func (*BackfillingCheckpointMetrics) SetFinalizedEpoch added in v0.0.136

func (s *BackfillingCheckpointMetrics) SetFinalizedEpoch(cannonType, network, checkpoint string, epoch float64)

func (*BackfillingCheckpointMetrics) SetLag added in v0.0.179

func (s *BackfillingCheckpointMetrics) SetLag(cannonType, network string, direction BackfillingCheckpointDirection, lag float64)

type SlotMetrics

type SlotMetrics struct {
	TrailingSlots *prometheus.GaugeVec
	CurrentSlot   *prometheus.GaugeVec
}

func NewSlotMetrics

func NewSlotMetrics(namespace string) SlotMetrics

func (*SlotMetrics) SetCurrentSlot

func (s *SlotMetrics) SetCurrentSlot(cannonType, network string, currentSlot float64)

func (*SlotMetrics) SetTrailingSlots

func (s *SlotMetrics) SetTrailingSlots(cannonType, network string, trailingSlots float64)

Jump to

Keyboard shortcuts

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