transactions

package
v0.43.0-dev-evm-fees.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTransactionNotInBlock = errors.New("transaction not in block")

ErrTransactionNotInBlock represents an error indicating that the transaction is not found in the block.

Functions

This section is empty.

Types

type Params

type Params struct {
	Log                         zerolog.Logger
	Metrics                     module.TransactionMetrics
	State                       protocol.State
	ChainID                     flow.ChainID
	SystemTxID                  flow.Identifier
	SystemTx                    *flow.TransactionBody
	StaticCollectionRPCClient   accessproto.AccessAPIClient
	HistoricalAccessNodeClients []accessproto.AccessAPIClient
	NodeCommunicator            node_communicator.Communicator
	ConnFactory                 connection.ConnectionFactory
	EnableRetries               bool
	NodeProvider                *commonrpc.ExecutionNodeIdentitiesProvider
	Blocks                      storage.Blocks
	Collections                 storage.Collections
	Transactions                storage.Transactions
	TxErrorMessageProvider      error_messages.Provider
	TxResultCache               *lru.Cache[flow.Identifier, *accessmodel.TransactionResult]
	TxProvider                  provider.TransactionProvider
	TxValidator                 *validator.TransactionValidator
	TxStatusDeriver             *txstatus.TxStatusDeriver
	EventsIndex                 *index.EventsIndex
	TxResultsIndex              *index.TransactionResultsIndex
}

type Transactions

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

func NewTransactionsBackend

func NewTransactionsBackend(params Params) (*Transactions, error)

func (*Transactions) GetSystemTransaction

func (t *Transactions) GetSystemTransaction(_ context.Context, _ flow.Identifier) (*flow.TransactionBody, error)

GetSystemTransaction returns system transaction

func (*Transactions) GetSystemTransactionResult

func (t *Transactions) GetSystemTransactionResult(ctx context.Context, blockID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)

GetSystemTransactionResult returns system transaction result

func (*Transactions) GetTransaction

func (t *Transactions) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.TransactionBody, error)

func (*Transactions) GetTransactionResult

func (t *Transactions) GetTransactionResult(
	ctx context.Context,
	txID flow.Identifier,
	blockID flow.Identifier,
	collectionID flow.Identifier,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) (*accessmodel.TransactionResult, error)

func (*Transactions) GetTransactionResultByIndex

func (t *Transactions) GetTransactionResultByIndex(
	ctx context.Context,
	blockID flow.Identifier,
	index uint32,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) (*accessmodel.TransactionResult, error)

GetTransactionResultByIndex returns transactions Results for an index in a block that is executed, pending or finalized transactions return errors

func (*Transactions) GetTransactionResultsByBlockID

func (t *Transactions) GetTransactionResultsByBlockID(
	ctx context.Context,
	blockID flow.Identifier,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) ([]*accessmodel.TransactionResult, error)

func (*Transactions) GetTransactionsByBlockID

func (t *Transactions) GetTransactionsByBlockID(
	_ context.Context,
	blockID flow.Identifier,
) ([]*flow.TransactionBody, error)

func (*Transactions) ProcessFinalizedBlockHeight

func (t *Transactions) ProcessFinalizedBlockHeight(height uint64) error

ATTENTION: might be a source of problems in future. We run this code on finalization gorotuine, potentially lagging finalization events if operations take long time. We might need to move this logic on dedicated goroutine and provide a way to skip finalization events if they are delivered too often for this engine. An example of similar approach - https://github.com/onflow/flow-go/blob/10b0fcbf7e2031674c00f3cdd280f27bd1b16c47/engine/common/follower/compliance_engine.go#L201.. No errors expected during normal operations.

func (*Transactions) SendRawTransaction

func (t *Transactions) SendRawTransaction(
	ctx context.Context,
	tx *flow.TransactionBody,
) error

SendRawTransaction sends a raw transaction to the collection node

func (*Transactions) SendTransaction

func (t *Transactions) SendTransaction(ctx context.Context, tx *flow.TransactionBody) error

SendTransaction forwards the transaction to the collection node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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