tx_error_messages

package
v0.38.0-preview.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

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.ConsumerProgress,
	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

func (e *Engine) OnFinalizedBlock(*model.Block)

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 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,
	backend *backend.Backend,
	transactionResultErrorMessages storage.TransactionResultErrorMessages,
	execNodeIdentitiesProvider *commonrpc.ExecutionNodeIdentitiesProvider,
) *TxErrorMessagesCore

NewTxErrorMessagesCore creates a new instance of TxErrorMessagesCore.

func (*TxErrorMessagesCore) HandleTransactionResultErrorMessages

func (c *TxErrorMessagesCore) HandleTransactionResultErrorMessages(ctx context.Context, blockID flow.Identifier) error

HandleTransactionResultErrorMessages processes transaction result error messages for a given block ID. It retrieves error messages from the backend 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) HandleTransactionResultErrorMessagesByENs

func (c *TxErrorMessagesCore) HandleTransactionResultErrorMessagesByENs(
	ctx context.Context,
	blockID flow.Identifier,
	execNodes flow.IdentitySkeletonList,
) error

Jump to

Keyboard shortcuts

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