indexer

package
v0.32.9 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer

type Indexer struct {
	component.Component
	// contains filtered or unexported fields
}

Indexer handles ingestion of new execution data available and uses the execution data indexer module to index the data. The processing of new available data is done by creating a jobqueue that uses the execution data reader to obtain new jobs. The worker also implements the `highestConsecutiveHeight` method which is used by the execution data reader, so it doesn't surpass the highest sealed block height when fetching the data. The execution state worker has a callback that is used by the upstream queues which download new execution data to notify new data is available and kick off indexing.

func NewIndexer

func NewIndexer(
	log zerolog.Logger,
	initHeight uint64,
	registers storage.RegisterIndex,
	indexer *IndexerCore,
	executionCache *cache.ExecutionDataCache,
	executionDataLatestHeight func() (uint64, error),
	processedHeight storage.ConsumerProgress,
) (*Indexer, error)

NewIndexer creates a new execution worker.

func (*Indexer) HighestIndexedHeight

func (i *Indexer) HighestIndexedHeight() uint64

HighestIndexedHeight returns the highest height indexed by the execution indexer.

func (*Indexer) LowestIndexedHeight

func (i *Indexer) LowestIndexedHeight() uint64

LowestIndexedHeight returns the lowest height indexed by the execution indexer.

func (*Indexer) OnExecutionData

func (i *Indexer) OnExecutionData(_ *execution_data.BlockExecutionDataEntity)

OnExecutionData is used to notify when new execution data is downloaded by the execution data requester jobqueue.

func (*Indexer) Start

func (i *Indexer) Start(ctx irrecoverable.SignalerContext)

Start the worker jobqueue to consume the available data.

type IndexerCore

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

IndexerCore indexes the execution state.

func New

New execution state indexer used to ingest block execution data and index it by height. The passed RegisterIndex storage must be populated to include the first and last height otherwise the indexer won't be initialized to ensure we have bootstrapped the storage first.

func (*IndexerCore) IndexBlockData

func (c *IndexerCore) IndexBlockData(data *execution_data.BlockExecutionDataEntity) error

IndexBlockData indexes all execution block data by height. This method shouldn't be used concurrently. Expected errors: - storage.ErrNotFound if the block for execution data was not found

func (*IndexerCore) RegisterValue added in v0.32.7

func (c *IndexerCore) RegisterValue(ID flow.RegisterID, height uint64) (flow.RegisterValue, error)

RegisterValue retrieves register values by the register IDs at the provided block height. Even if the register wasn't indexed at the provided height, returns the highest height the register was indexed at. If a register is not found it will return a nil value and not an error. Expected errors: - storage.ErrHeightNotIndexed if the given height was not indexed yet or lower than the first indexed height.

Jump to

Keyboard shortcuts

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