Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { *component.ComponentManager // contains filtered or unexported fields }
Engine represents the component responsible for managing and processing transaction result error messages. It retrieves, stores, and retries fetching of error messages from execution nodes, ensuring that they are processed and stored for sealed blocks.
No errors are expected during normal operation.
func New ¶
func New( log zerolog.Logger, state protocol.State, headers storage.Headers, txErrorMessagesProcessedHeight storage.ConsumerProgressInitializer, txErrorMessagesCore *TxErrorMessagesCore, ) (*Engine, error)
New creates a new Engine instance, initializing all necessary components for processing transaction result error messages. This includes setting up the job queue and the notifier for handling finalized blocks.
No errors are expected during normal operation.
func (*Engine) OnFinalizedBlock ¶
OnFinalizedBlock is called by the follower engine after a block has been finalized and the state has been updated. Receives block finalized events from the finalization distributor and forwards them to the txErrorMessagesConsumer.
type Requester ¶ added in v0.43.0
type Requester interface { // Request fetches transaction results error messages. // Expected errors: // - context.Canceled: if the provided context was canceled before completion // // No other errors are expected during normal operations Request(ctx context.Context) ([]flow.TransactionResultErrorMessage, error) }
Requester defines the interface for requesting transaction result error messages.
type RequesterConfig ¶ added in v0.43.0
type RequesterConfig struct { // the initial delay used in the exponential backoff for failed tx error messages download // retries. RetryDelay time.Duration // the max delay used in the exponential backoff for failed tx error messages download. MaxRetryDelay time.Duration }
RequesterConfig contains the retry settings for the tx error messages fetch.
type RequesterImpl ¶ added in v0.43.0
type RequesterImpl struct {
// contains filtered or unexported fields
}
func NewRequester ¶ added in v0.43.0
func NewRequester( logger zerolog.Logger, config *RequesterConfig, txErrorMessageProvider error_messages.Provider, execNodeIdentitiesProvider *rpc.ExecutionNodeIdentitiesProvider, executionResult *flow.ExecutionResult, ) *RequesterImpl
func (*RequesterImpl) Request ¶ added in v0.43.0
func (r *RequesterImpl) Request(ctx context.Context) ([]flow.TransactionResultErrorMessage, error)
Request fetches transaction error messages for the specific execution result this requester was configured with.
Expected errors expected during normal operations: - context.DeadlineExceeded - if context timeouts - context.Canceled - if context was canceled
type TxErrorMessagesCore ¶
type TxErrorMessagesCore struct {
// contains filtered or unexported fields
}
TxErrorMessagesCore is responsible for managing transaction result error messages It handles both storage and retrieval of error messages from execution nodes.
func NewTxErrorMessagesCore ¶
func NewTxErrorMessagesCore( log zerolog.Logger, txErrorMessageProvider error_messages.Provider, transactionResultErrorMessages storage.TransactionResultErrorMessages, execNodeIdentitiesProvider *commonrpc.ExecutionNodeIdentitiesProvider, ) *TxErrorMessagesCore
NewTxErrorMessagesCore creates a new instance of TxErrorMessagesCore.
func (*TxErrorMessagesCore) FetchErrorMessages ¶ added in v0.43.0
func (c *TxErrorMessagesCore) FetchErrorMessages(ctx context.Context, blockID flow.Identifier) error
FetchErrorMessages processes transaction result error messages for a given block ID. It retrieves error messages from the txErrorMessageProvider if they do not already exist in storage.
The function first checks if error messages for the given block ID are already present in storage. If they are not, it fetches the messages from execution nodes and stores them.
Parameters: - ctx: The context for managing cancellation and deadlines during the operation. - blockID: The identifier of the block for which transaction result error messages need to be processed.
No errors are expected during normal operation.
func (*TxErrorMessagesCore) FetchErrorMessagesByENs ¶ added in v0.43.0
func (c *TxErrorMessagesCore) FetchErrorMessagesByENs( ctx context.Context, blockID flow.Identifier, execNodes flow.IdentitySkeletonList, ) error