retrier

package
v0.42.5-cadence-compil... Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const RetryFrequency uint64 = 120 // Blocks

RetryFrequency has to be less than TransactionExpiry or else this module does nothing

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHeightToTransactions

type BlockHeightToTransactions map[uint64]Transactions

type NoopRetrier

type NoopRetrier struct{}

func NewNoopRetrier

func NewNoopRetrier() *NoopRetrier

func (*NoopRetrier) RegisterTransaction

func (n *NoopRetrier) RegisterTransaction(_ uint64, _ *flow.TransactionBody)

func (*NoopRetrier) Retry

func (n *NoopRetrier) Retry(_ uint64) error

type Retrier

type Retrier interface {
	Retry(height uint64) error
	RegisterTransaction(height uint64, tx *flow.TransactionBody)
}

type RetrierImpl

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

RetrierImpl implements a simple retry mechanism for transaction submission.

func NewRetrier

func NewRetrier(
	log zerolog.Logger,
	blocks storage.Blocks,
	collections storage.Collections,
	txSender TransactionSender,
	txStatusDeriver *status.TxStatusDeriver,
) *RetrierImpl

func (*RetrierImpl) RegisterTransaction

func (r *RetrierImpl) RegisterTransaction(height uint64, tx *flow.TransactionBody)

RegisterTransaction adds a transaction that could possibly be retried

func (*RetrierImpl) Retry

func (r *RetrierImpl) Retry(height uint64) error

Retry attempts to resend transactions for a specified block height. It performs cleanup operations, including pruning old transactions, and retries sending transactions that are still pending. The method takes a block height as input. If the provided height is lower than flow.DefaultTransactionExpiry, no retries are performed, and the method returns nil. No errors expected during normal operations.

type TransactionSender

type TransactionSender interface {
	SendRawTransaction(ctx context.Context, tx *flow.TransactionBody) error
}

type Transactions

type Transactions map[flow.Identifier]*flow.TransactionBody

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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