Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIndexNotInitialized = errors.New("index not initialized")
ErrIndexNotInitialized is returned when the indexer is not initialized
This generally indicates that the index databases are still being initialized, and trying again later may succeed
Functions ¶
This section is empty.
Types ¶
type Indexer ¶
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 ¶
HighestIndexedHeight returns the highest height indexed by the execution indexer.
func (*Indexer) LowestIndexedHeight ¶
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 ¶
func New( log zerolog.Logger, metrics module.ExecutionStateIndexerMetrics, batcher bstorage.BatchBuilder, registers storage.RegisterIndex, headers storage.Headers, events storage.Events, results storage.LightTransactionResults, collectionHandler requester.HandleFunc, ) (*IndexerCore, error)
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.