iterator

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBatchSize = 200

DefaultBatchSize is the default number of payloads to fetch per batch.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackfillIterator

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

func NewBackfillIterator

func NewBackfillIterator(
	log logrus.FieldLogger,
	networkName, clientName string,
	relayMonitorType xatu.RelayMonitorType,
	relayName string,
	coordinatorClient *coordinator.Client,
	wallclock *ethwallclock.EthereumBeaconChain,
	toSlot phase0.Slot,
	checkInterval time.Duration,
	batchSize int,
) *BackfillIterator

func (*BackfillIterator) Next

func (b *BackfillIterator) Next(ctx context.Context) (*phase0.Slot, error)

func (*BackfillIterator) NextBatch added in v1.7.1

func (b *BackfillIterator) NextBatch(ctx context.Context) (*BatchRequest, error)

NextBatch returns batch parameters for fetching multiple payloads at once. This is more efficient than fetching slot-by-slot for backfilling. Returns nil if backfill is complete or no work available.

func (*BackfillIterator) UpdateLocation

func (b *BackfillIterator) UpdateLocation(ctx context.Context, slot phase0.Slot) error

type BatchRequest added in v1.7.1

type BatchRequest struct {
	// Params are the URL query parameters to pass to the relay API.
	Params url.Values
	// CurrentSlot is the current position of the iterator.
	CurrentSlot uint64
	// TargetSlot is the slot we're trying to reach.
	TargetSlot uint64
	// BatchSize is the number of payloads requested in this batch.
	BatchSize int
}

BatchRequest contains parameters for a batch fetch request.

type ConsistencyMetrics

type ConsistencyMetrics struct {
	// Current slot being processed
	CurrentSlot *prometheus.GaugeVec

	// Lag (slots behind for forward fill, slots to go for backfill)
	Lag *prometheus.GaugeVec
}

func NewConsistencyMetrics

func NewConsistencyMetrics(namespace string) *ConsistencyMetrics

func (*ConsistencyMetrics) SetCurrentSlot

func (m *ConsistencyMetrics) SetCurrentSlot(process, relay, eventType, network string, slot uint64)

func (*ConsistencyMetrics) SetLag

func (m *ConsistencyMetrics) SetLag(process, relay, eventType, network string, lag int64)

type ForwardFillIterator

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

func NewForwardFillIterator

func NewForwardFillIterator(
	log logrus.FieldLogger,
	networkName, clientName string,
	relayMonitorType xatu.RelayMonitorType,
	relayName string,
	coordinatorClient *coordinator.Client,
	wallclock *ethwallclock.EthereumBeaconChain,
	checkInterval time.Duration,
	trailDistance uint64,
	batchSize int,
) *ForwardFillIterator

func (*ForwardFillIterator) Next

func (*ForwardFillIterator) NextBatch added in v1.7.1

func (f *ForwardFillIterator) NextBatch(ctx context.Context) (*BatchRequest, error)

NextBatch returns batch parameters for fetching multiple payloads at once. This is more efficient than fetching slot-by-slot for catching up. Returns nil if already caught up or no work available.

func (*ForwardFillIterator) UpdateLocation

func (f *ForwardFillIterator) UpdateLocation(ctx context.Context, slot phase0.Slot) error

Jump to

Keyboard shortcuts

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