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
Click to show internal directories.
Click to hide internal directories.