engine

package
v0.0.0-...-c846bbc Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBundlesSelectionLimit         = 8
	IndeterminateResponsesToleranceLimit = 10
	MinutesInWindow                      = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SubmitterEngine

type SubmitterEngine struct {
	HorizonClient horizonclient.ClientInterface
	preconditions.LedgerNumberTracker
	signing.SignatureService
	MaxBaseFee int
}

SubmitterEngine aggregates the dependencies that are shared between all Submitter instances, such as the Ledger number tracker.

func (*SubmitterEngine) Validate

func (se *SubmitterEngine) Validate() error

type TransactionProcessingLimiter

type TransactionProcessingLimiter interface {
	// AdjustLimitIfNeeded is used to temporarily adjust the limitValue variable, returned by the LimitValue() getter,
	// if it starts seeing a high number of indeterminate responses from Horizon, which are indicative of network
	// congestion. The following error codes are considered indeterminate responses:
	//   - 504: Timeout
	//   - 429: Too Many Requests
	//   - 400 - tx_insufficient_fee: Bad Request
	AdjustLimitIfNeeded(hErr *utils.HorizonErrorWrapper)
	// LimitValue returns the current value of the limitValue variable, which is used to determine the number of channel
	// accounts to process transactions for in a single iteration. If the value being returned was downsized due to
	// indeterminate responses, the method will restore it to the original value after a fixed window of time has
	// passed.
	LimitValue() int
}

TransactionProcessingLimiter is an interface that defines the methods that the manager and transaction worker use to share metadata about and adjust the rate at which transactions are processed based on responses from Horizon.

type TransactionProcessingLimiterImpl

type TransactionProcessingLimiterImpl struct {
	CurrNumChannelAccounts        int
	IndeterminateResponsesCounter int
	CounterLastUpdated            time.Time
	// contains filtered or unexported fields
}

TransactionProcessingLimiter is an interface that defines the methods that the manager and transaction worker use to share metadata about and adjust the rate at which transactions are processed based on responses from Horizon.

func NewTransactionProcessingLimiter

func NewTransactionProcessingLimiter(limit int) *TransactionProcessingLimiterImpl

func (*TransactionProcessingLimiterImpl) AdjustLimitIfNeeded

func (tpl *TransactionProcessingLimiterImpl) AdjustLimitIfNeeded(hErr *utils.HorizonErrorWrapper)

func (*TransactionProcessingLimiterImpl) LimitValue

func (tpl *TransactionProcessingLimiterImpl) LimitValue() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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