Versions in this module Expand all Collapse all v1 v1.1.3 Jan 20, 2025 v1.1.2 Jan 20, 2025 Changes in this version + var ErrAlreadyKnown = errors.New("already known") + var ErrBlockedSender = errors.New("blocked sender") + var ErrEffectiveGasPriceGasPriceTooLow = errors.New("effective gas price: gas price too low") + var ErrGasLimit = errors.New("exceeds block gas limit") + var ErrGasPrice = errors.New("gas price too low") + var ErrGasUintOverflow = errors.New("gas uint64 overflow") + var ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value") + var ErrIntrinsicGas = errors.New("intrinsic gas too low") + var ErrInvalidChainID = errors.New("invalid chain id") + var ErrInvalidIP = errors.New("invalid IP address") + var ErrInvalidSender = errors.New("invalid sender") + var ErrNegativeValue = errors.New("negative value") + var ErrNonceTooHigh = errors.New("nonce too high") + var ErrNonceTooLow = errors.New("nonce too low") + var ErrNotFound = errors.New("object not found") + var ErrOutOfCounters = errors.New("out of counters") + var ErrOversizedData = errors.New("oversized data") + var ErrReceivedZeroL1GasPrice = errors.New("received L1 gas price 0") + var ErrReplaceUnderpriced = errors.New("replacement transaction underpriced") + var ErrTxPoolAccountOverflow = errors.New("account has reached the tx limit in the txpool") + var ErrTxPoolOverflow = errors.New("txpool is full") + var ErrTxTypeNotSupported = types.ErrTxTypeNotSupported + var ErrZeroL1GasPrice = errors.New("L1 gas price 0") + func IntrinsicGas(tx types.Transaction) (uint64, error) + func IsValidIP(ip string) bool + type Config struct + AccountQueue uint64 + DB db.Config + DefaultMinGasPriceAllowed uint64 + EffectiveGasPrice EffectiveGasPriceCfg + ForkID uint64 + GlobalQueue uint64 + IntervalToRefreshBlockedAddresses types.Duration + IntervalToRefreshGasPrices types.Duration + MaxTxBytesSize uint64 + MaxTxDataBytesSize int + MinAllowedGasPriceInterval types.Duration + PollMinAllowedGasPriceInterval types.Duration + type EffectiveGasPrice struct + func NewEffectiveGasPrice(cfg EffectiveGasPriceCfg) *EffectiveGasPrice + func (e *EffectiveGasPrice) CalculateBreakEvenGasPrice(rawTx []byte, txGasPrice *big.Int, txGasUsed uint64, l1GasPrice uint64) (*big.Int, error) + func (e *EffectiveGasPrice) CalculateEffectiveGasPrice(rawTx []byte, txGasPrice *big.Int, txGasUsed uint64, l1GasPrice uint64, ...) (*big.Int, error) + func (e *EffectiveGasPrice) GetFinalDeviation() uint64 + func (e *EffectiveGasPrice) GetTxAndL2GasPrice(txGasPrice *big.Int, l1GasPrice uint64, l2GasPrice uint64) (egpTxGasPrice *big.Int, egpL2GasPrice uint64) + func (e *EffectiveGasPrice) IsEnabled() bool + type EffectiveGasPriceCfg struct + BreakEvenFactor float64 + ByteGasCost uint64 + Enabled bool + EthTransferGasPrice uint64 + EthTransferL1GasPriceFactor float64 + FinalDeviationPct uint64 + L1GasPriceFactor float64 + L2GasPriceSuggesterFactor float64 + NetProfit float64 + ZeroByteGasCost uint64 + type GasPrices struct + L1GasPrice uint64 + L2GasPrice uint64 + type Pool struct + func NewPool(cfg Config, batchConstraintsCfg state.BatchConstraintsCfg, s storage, ...) *Pool + func (p *Pool) AddTx(ctx context.Context, tx types.Transaction, ip string) error + func (p *Pool) CalculateEffectiveGasPrice(rawTx []byte, txGasPrice *big.Int, txGasUsed uint64, l1GasPrice uint64, ...) (*big.Int, error) + func (p *Pool) CalculateEffectiveGasPricePercentage(gasPrice *big.Int, effectiveGasPrice *big.Int) (uint8, error) + func (p *Pool) CountPendingTransactions(ctx context.Context) (uint64, error) + func (p *Pool) DeleteGasPricesHistoryOlderThan(ctx context.Context, date time.Time) error + func (p *Pool) DeleteReorgedTransactions(ctx context.Context, transactions []*types.Transaction) error + func (p *Pool) EffectiveGasPriceEnabled() bool + func (p *Pool) GetDefaultMinGasPriceAllowed() uint64 + func (p *Pool) GetGasPrices(ctx context.Context) (GasPrices, error) + func (p *Pool) GetL1AndL2GasPrice() (uint64, uint64) + func (p *Pool) GetNonWIPPendingTxs(ctx context.Context) ([]Transaction, error) + func (p *Pool) GetPendingTxHashesSince(ctx context.Context, since time.Time) ([]common.Hash, error) + func (p *Pool) GetPendingTxs(ctx context.Context, limit uint64) ([]Transaction, error) + func (p *Pool) GetSelectedTxs(ctx context.Context, limit uint64) ([]Transaction, error) + func (p *Pool) IsTxPending(ctx context.Context, hash common.Hash) (bool, error) + func (p *Pool) SetGasPrices(ctx context.Context, l2GasPrice uint64, l1GasPrice uint64) error + func (p *Pool) StartPollingMinSuggestedGasPrice(ctx context.Context) + func (p *Pool) StartRefreshingBlockedAddressesPeriodically() + func (p *Pool) StoreTx(ctx context.Context, tx types.Transaction, ip string, isWIP bool) error + func (p *Pool) UpdateTxStatus(ctx context.Context, hash common.Hash, newStatus TxStatus, isWIP bool, ...) error + func (p *Pool) UpdateTxWIPStatus(ctx context.Context, hash common.Hash, isWIP bool) error + func (p *Pool) ValidateBreakEvenGasPrice(ctx context.Context, tx types.Transaction, preExecutionGasUsed uint64, ...) error + type Transaction struct + FailedReason *string + IP string + IsWIP bool + PreprocessedStateRoot common.Hash + ReceivedAt time.Time + ReservedZKCounters state.ZKCounters + Status TxStatus + func NewTransaction(tx types.Transaction, ip string, isWIP bool) *Transaction + type TxStatus string + const TxStatusFailed + const TxStatusInvalid + const TxStatusPending + const TxStatusSelected + func (s TxStatus) String() string + type TxStatusUpdateInfo struct + FailedReason *string + Hash common.Hash + IsWIP bool + NewStatus TxStatus