txinclude

package
v1.16.7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicBudget added in v1.13.5

type BasicBudget interface {
	Credit(eth.ETH) eth.ETH
	Debit(eth.ETH) (eth.ETH, error)
}

type Budget

type Budget interface {
	// BeforeResubmit is called before the transaction is resubmitted. It allows the cost to be
	// re-estimated in case of any changes (e.g., nonce increments affecting DA cost).
	BeforeResubmit(oldBudgetedCost eth.ETH, tx *types.Transaction) (newBudgetedCost eth.ETH, err error)
	// AfterCancel is called after the transaction is canceled, providing a chance to refund the
	// cost.
	AfterCancel(budgetedCost eth.ETH, tx *types.Transaction)
	// AfterIncluded is called after the transaction is included, giving an opportunity to refund
	// the difference between the budgeted cost and the actual cost.
	AfterIncluded(budgetedCost eth.ETH, tx *IncludedTx)
}

Budget tracks costs throughout a tranaction's lifecycle.

type EL

type EL interface {
	Sender
	ReceiptGetter
}

EL represents an EVM execution layer. It is responsible for handling transport errors, such as HTTP 429s.

func NewReliableEL added in v1.16.7

func NewReliableEL(el EL, blockTime time.Duration) EL

NewReliableEL turns an implementation of the EL interface into one that will retry on intermittent failures.

type IncludedTx

type IncludedTx struct {
	Transaction *types.Transaction
	Receipt     *types.Receipt
}

type Includer

type Includer interface {
	Include(ctx context.Context, tx types.TxData) (*IncludedTx, error)
}

type IsthmusCostOracle added in v1.13.5

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

IsthmusCostOracle implements OPCostOracle only for the Isthmus hard fork.

func NewIsthmusCostOracle added in v1.13.5

func NewIsthmusCostOracle(client RPCClient, blockTime time.Duration) *IsthmusCostOracle

func (*IsthmusCostOracle) OPCost added in v1.13.5

func (i *IsthmusCostOracle) OPCost(tx *types.Transaction) *big.Int

func (*IsthmusCostOracle) SetParams added in v1.13.5

func (i *IsthmusCostOracle) SetParams(ctx context.Context) error

func (*IsthmusCostOracle) Start added in v1.13.5

func (i *IsthmusCostOracle) Start(ctx context.Context)

type Limit added in v1.16.7

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

func NewLimit added in v1.16.7

func NewLimit(inner Includer, limit int) *Limit

func (*Limit) Include added in v1.16.7

func (l *Limit) Include(ctx context.Context, tx types.TxData) (*IncludedTx, error)

type Monitor

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

Monitor is a ReceiptGetter that will continue looking for a receipt even when it doesn't find it right away.

func NewMonitor

func NewMonitor(inner ReceiptGetter, blockTime time.Duration) *Monitor

func (*Monitor) TransactionReceipt

func (m *Monitor) TransactionReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error)

type NoOpResubmitterObserver

type NoOpResubmitterObserver struct{}

func (NoOpResubmitterObserver) SubmissionError

func (NoOpResubmitterObserver) SubmissionError(error)

type OPCostOracle added in v1.13.5

type OPCostOracle interface {
	// OPCost returns the total OP-specific costs for tx, such as the L1 cost and operator cost.
	OPCost(*types.Transaction) *big.Int
}

type Persistent

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

Persistent is an Includer that persists transactions to an execution layer.

func NewPersistent

func NewPersistent(signer Signer, el EL, opts ...PersistentOption) *Persistent

NewPersistent creates a Persistent Includer. It assumes el is reliable:

  • el.SendTransaction guarantees mempool inclusion without the possibility of eviction.
  • el.TransactionReceipt will return a valid receipt if one eventually exists.

func (*Persistent) Include

func (p *Persistent) Include(ctx context.Context, tx types.TxData) (*IncludedTx, error)

Include attempts to persist tx to p's EL, updating its budget in real time throughout the transaction lifecycle. It fails to include a transaction in the event of an error from the context, budget, signer, or EL. It tries to recover from EL nonce and fee errors by adjusting those parameters accordingly.

type PersistentOption

type PersistentOption func(cfg *persistentConfig)

func WithBudget

func WithBudget(budget Budget) PersistentOption

WithBudget adds a budget to the Includer. The default is unlimited.

func WithStartNonce

func WithStartNonce(nonce uint64) PersistentOption

WithStartNonce instructs the Persistent includer to use nonce as a starting nonce. The default is zero.

type PkSigner

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

func NewPkSigner

func NewPkSigner(pk *ecdsa.PrivateKey, chainID *big.Int) *PkSigner

func (*PkSigner) Sign

type RPCClient added in v1.13.5

type RPCClient interface {
	BatchCallContext(context.Context, []rpc.BatchElem) error
}

type ReceiptGetter

type ReceiptGetter interface {
	TransactionReceipt(context.Context, common.Hash) (*types.Receipt, error)
}

type Resubmitter

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

func NewResubmitter

func NewResubmitter(inner Sender, blockTime time.Duration, opts ...ResubmitterOption) *Resubmitter

func (*Resubmitter) SendTransaction

func (r *Resubmitter) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction implements Sender. It will continue resubmitting unless an error is hit that the resubmitter considers unfixable with resubmissions alone (e.g., requiring modifications to tx) See fatalErrs for the list of these errors.

type ResubmitterObserver

type ResubmitterObserver interface {
	SubmissionError(error)
}

type ResubmitterOption

type ResubmitterOption func(*resubmitterConfig)

func WithObserver

func WithObserver(observer ResubmitterObserver) ResubmitterOption

type Sender

type Sender interface {
	SendTransaction(context.Context, *types.Transaction) error
}

type Signer

type Signer interface {
	Sign(context.Context, *types.Transaction) (*types.Transaction, error)
}

type TxBudget added in v1.13.5

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

TxBudget provides budgeting helpers oriented around a transaction's lifecycle.

func NewTxBudget added in v1.13.5

func NewTxBudget(inner BasicBudget, opts ...TxBudgetOption) *TxBudget

func (*TxBudget) AfterCancel added in v1.13.5

func (b *TxBudget) AfterCancel(cost eth.ETH, _ *types.Transaction)

AfterCancel credits cost.

func (*TxBudget) AfterIncluded added in v1.13.5

func (b *TxBudget) AfterIncluded(budgetedCost eth.ETH, tx *IncludedTx)

AfterIncluded credits the difference between the budgeted cost and the actual cost. It is assumed that the budgeted cost is always greater than the actual cost.

func (*TxBudget) BeforeResubmit added in v1.13.5

func (b *TxBudget) BeforeResubmit(oldCost eth.ETH, tx *types.Transaction) (eth.ETH, error)

BeforeResubmit calculates the cost of tx. If the new cost is greather than oldCost, it debits the difference. If the new cost is less than oldCost, it credits the difference.

type TxBudgetOption added in v1.13.5

type TxBudgetOption func(*txBudgetConfig)

func WithOPCostOracle added in v1.13.5

func WithOPCostOracle(oracle OPCostOracle) TxBudgetOption

type UnlimitedBudget added in v1.13.5

type UnlimitedBudget struct{}

func (UnlimitedBudget) AfterCancel added in v1.13.5

func (UnlimitedBudget) AfterCancel(_ eth.ETH, _ *types.Transaction)

func (UnlimitedBudget) AfterIncluded added in v1.13.5

func (UnlimitedBudget) AfterIncluded(_ eth.ETH, _ *IncludedTx)

func (UnlimitedBudget) BeforeResubmit added in v1.13.5

func (n UnlimitedBudget) BeforeResubmit(oldCost eth.ETH, _ *types.Transaction) (eth.ETH, error)

Jump to

Keyboard shortcuts

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