execution_result_query_provider

package
v0.43.1-rc.1.access-me... Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCriteria = optimistic_sync.Criteria{
	AgreeingExecutorsCount: 2,
}

DefaultCriteria is the system default criteria for execution result queries.

Functions

This section is empty.

Types

type ExecutionNodesSelector

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

ExecutionNodesSelector handles the selection of execution nodes based on preferences and requirements. It encapsulates the logic for choosing execution nodes based on operator preferences, operator requirements, and user requirements.

func NewExecutionNodes

func NewExecutionNodes(
	preferredENIdentifiers flow.IdentifierList,
	requiredENIdentifiers flow.IdentifierList,
) *ExecutionNodesSelector

NewExecutionNodes creates a new ExecutionNodesSelector with the provided configuration.

func (*ExecutionNodesSelector) SelectExecutionNodes

func (en *ExecutionNodesSelector) SelectExecutionNodes(
	executors flow.IdentityList,
	userRequiredExecutors flow.IdentifierList,
) (flow.IdentitySkeletonList, error)

SelectExecutionNodes finds the subset of execution nodes defined in the identity table that matches the provided executor IDs and executor criteria.

The following precedence is used to determine the subset of execution nodes:

  1. If the user's RequiredExecutors is not empty, only select executors from their list

  2. If the operator's `requiredENIdentifiers` is set, only select executors from the required ENs list. If the operator's `preferredENIdentifiers` is also set, then the preferred ENs are selected first.

  3. If only the operator's `preferredENIdentifiers` is set, then select any preferred ENs that have executed the result, and fall back to selecting any ENs that have executed the result.

  4. If neither preferred nor required nodes are defined, then all execution nodes matching the executor IDs are returned.

No errors are expected during normal operations

type ExecutionResultQueryProvider

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

ExecutionResultQueryProvider is a container for elements required to retrieve execution results and execution node identities for a given block ID based on specified criteria.

func NewExecutionResultQueryProvider

func NewExecutionResultQueryProvider(
	log zerolog.Logger,
	state protocol.State,
	headers storage.Headers,
	executionReceipts storage.ExecutionReceipts,
	executionNodes *ExecutionNodesSelector,
	operatorCriteria optimistic_sync.Criteria,
) (*ExecutionResultQueryProvider, error)

NewExecutionResultQueryProvider creates and returns a new instance of ExecutionResultQueryProvider.

No errors are expected during normal operations

func (*ExecutionResultQueryProvider) ExecutionResultQuery

func (e *ExecutionResultQueryProvider) ExecutionResultQuery(blockID flow.Identifier, criteria optimistic_sync.Criteria) (*optimistic_sync.Query, error)

ExecutionResultQuery retrieves execution results and associated execution nodes for a given block ID based on the provided criteria.

Expected errors during normal operations:

  • backend.InsufficientExecutionReceipts - found insufficient receipts for given block ID.

Jump to

Keyboard shortcuts

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