Documentation
¶
Index ¶
- Variables
- func IndexCollection(collection *flow.Collection, collections storage.Collections, ...) error
- type CollectionExecutedMetricImpl
- func (c *CollectionExecutedMetricImpl) BlockFinalized(block *flow.Block)
- func (c *CollectionExecutedMetricImpl) CollectionExecuted(light flow.LightCollection)
- func (c *CollectionExecutedMetricImpl) CollectionFinalized(light flow.LightCollection)
- func (c *CollectionExecutedMetricImpl) ExecutionReceiptReceived(r *flow.ExecutionReceipt)
- func (c *CollectionExecutedMetricImpl) UpdateLastFullBlockHeight(height uint64)
- type InMemoryIndexer
- type Indexer
- type IndexerCore
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 ¶
func IndexCollection ¶ added in v0.43.0
func IndexCollection( collection *flow.Collection, collections storage.Collections, transactions storage.Transactions, logger zerolog.Logger, collectionExecutedMetric module.CollectionExecutedMetric, ) error
IndexCollection handles the response of the collection request made earlier when a block was received. No errors expected during normal operations.
Types ¶
type CollectionExecutedMetricImpl ¶ added in v0.33.15
type CollectionExecutedMetricImpl struct {
// contains filtered or unexported fields
}
CollectionExecutedMetricImpl tracks metrics to measure how long it takes for tx to reach each step in their lifecycle
func NewCollectionExecutedMetricImpl ¶ added in v0.33.15
func NewCollectionExecutedMetricImpl( log zerolog.Logger, accessMetrics module.AccessMetrics, collectionsToMarkFinalized *stdmap.Times, collectionsToMarkExecuted *stdmap.Times, blocksToMarkExecuted *stdmap.Times, collections storage.Collections, blocks storage.Blocks, blockTransactions *stdmap.IdentifierMap, ) (*CollectionExecutedMetricImpl, error)
func (*CollectionExecutedMetricImpl) BlockFinalized ¶ added in v0.33.15
func (c *CollectionExecutedMetricImpl) BlockFinalized(block *flow.Block)
BlockFinalized tracks finalized metric for block
func (*CollectionExecutedMetricImpl) CollectionExecuted ¶ added in v0.33.15
func (c *CollectionExecutedMetricImpl) CollectionExecuted(light flow.LightCollection)
CollectionExecuted tracks collections to mark executed
func (*CollectionExecutedMetricImpl) CollectionFinalized ¶ added in v0.33.15
func (c *CollectionExecutedMetricImpl) CollectionFinalized(light flow.LightCollection)
CollectionFinalized tracks collections to mark finalized
func (*CollectionExecutedMetricImpl) ExecutionReceiptReceived ¶ added in v0.33.15
func (c *CollectionExecutedMetricImpl) ExecutionReceiptReceived(r *flow.ExecutionReceipt)
ExecutionReceiptReceived tracks execution receipt metrics
func (*CollectionExecutedMetricImpl) UpdateLastFullBlockHeight ¶ added in v0.33.15
func (c *CollectionExecutedMetricImpl) UpdateLastFullBlockHeight(height uint64)
type InMemoryIndexer ¶ added in v0.43.0
type InMemoryIndexer struct {
// contains filtered or unexported fields
}
InMemoryIndexer handles indexing of block execution data in memory. It stores data in unsynchronized in-memory caches that are designed to be populated once before being read.
func NewInMemoryIndexer ¶ added in v0.43.0
func NewInMemoryIndexer( log zerolog.Logger, registers *unsynchronized.Registers, events *unsynchronized.Events, collections *unsynchronized.Collections, transactions *unsynchronized.Transactions, results *unsynchronized.LightTransactionResults, txResultErrMsgs *unsynchronized.TransactionResultErrorMessages, executionResult *flow.ExecutionResult, header *flow.Header, ) *InMemoryIndexer
NewInMemoryIndexer creates a new indexer that uses in-memory storage implementations. This is designed for processing unsealed blocks in the optimistic syncing pipeline. The caches are created externally and passed to the indexer, as they will also be used by the persister to save data permanently when a block is sealed.
func (*InMemoryIndexer) IndexBlockData ¶ added in v0.43.0
func (i *InMemoryIndexer) IndexBlockData(data *execution_data.BlockExecutionDataEntity) error
IndexBlockData indexes all execution block data. No errors are expected during normal operation.
func (*InMemoryIndexer) IndexTxResultErrorMessagesData ¶ added in v0.43.0
func (i *InMemoryIndexer) IndexTxResultErrorMessagesData(txResultErrMsgs []flow.TransactionResultErrorMessage) error
IndexTxResultErrorMessagesData index transaction result error messages No errors are expected during normal operation.
type Indexer ¶
type Indexer struct { component.Component execution_data.ProcessedHeightRecorder // 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), processedHeightInitializer storage.ConsumerProgressInitializer, ) (*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, protocolDB storage.DB, registers storage.RegisterIndex, headers storage.Headers, events storage.Events, collections storage.Collections, transactions storage.Transactions, results storage.LightTransactionResults, chain flow.Chain, derivedChainData *derived.DerivedChainData, collectionExecutedMetric module.CollectionExecutedMetric, ) (*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.