Documentation ¶
Index ¶
- type Config
- type Driver
- func (d *Driver) ClearPendingTx(ctx context.Context, txMgr txmgr.TxManager, l1Client *ethclient.Client) error
- func (d *Driver) CraftBatchTx(ctx context.Context, start, end, nonce *big.Int) (*types.Transaction, error)
- func (d *Driver) GetBatchBlockRange(ctx context.Context) (*big.Int, *big.Int, error)
- func (d *Driver) Metrics() metrics.Metrics
- func (d *Driver) Name() string
- func (d *Driver) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (d *Driver) UpdateGasPrice(ctx context.Context, tx *types.Transaction) (*types.Transaction, error)
- func (d *Driver) WalletAddr() common.Address
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) ClearPendingTx ¶
func (d *Driver) ClearPendingTx( ctx context.Context, txMgr txmgr.TxManager, l1Client *ethclient.Client, ) error
ClearPendingTx a publishes a transaction at the next available nonce in order to clear any transactions in the mempool left over from a prior running instance of the batch submitter.
func (*Driver) CraftBatchTx ¶
func (d *Driver) CraftBatchTx( ctx context.Context, start, end, nonce *big.Int, ) (*types.Transaction, error)
CraftBatchTx transforms the L2 blocks between start and end into a batch transaction using the given nonce. A dummy gas price is used in the resulting transaction to use for size estimation.
NOTE: This method SHOULD NOT publish the resulting transaction.
func (*Driver) GetBatchBlockRange ¶
GetBatchBlockRange returns the start and end L2 block heights that need to be processed. Note that the end value is *exclusive*, therefore if the returned values are identical nothing needs to be processed.
func (*Driver) SendTransaction ¶
SendTransaction injects a signed transaction into the pending pool for execution.
func (*Driver) UpdateGasPrice ¶
func (d *Driver) UpdateGasPrice( ctx context.Context, tx *types.Transaction, ) (*types.Transaction, error)
UpdateGasPrice signs an otherwise identical txn to the one provided but with updated gas prices sampled from the existing network conditions.
NOTE: Thie method SHOULD NOT publish the resulting transaction.
func (*Driver) WalletAddr ¶
WalletAddr is the wallet address used to pay for batch transaction fees.