Documentation ¶
Overview ¶
Package relay implements a module for private bundlers to send batches to the AiMiddleware through regular EOA transactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DefaultWaitTimeout = 72 * time.Second
)
Functions ¶
This section is empty.
Types ¶
type Relayer ¶
type Relayer struct {
// contains filtered or unexported fields
}
Relayer provides a module that can relay batches with a regular EOA. Relaying batches to the AiMiddleware through a regular transaction comes with several important notes:
- The bundler will NOT be operating as a block builder.
- This opens the bundler up to frontrunning.
This module only works in the case of a private mempool and will not work in the P2P case where ops are propagated through the network and it is impossible to prevent collisions from multiple bundlers trying to relay the same ops.
func New ¶
func New( eoa *signer.EOA, eth *ethclient.Client, chainID *big.Int, beneficiary common.Address, l logr.Logger, ) *Relayer
New initializes a new EOA relayer for sending batches to the AiMiddleware.
func (*Relayer) SendAiOperation ¶
func (r *Relayer) SendAiOperation() modules.BatchHandlerFunc
SendAiOperation returns a BatchHandler that is used by the Bundler to send batches in a regular EOA transaction.
func (*Relayer) SetWaitTimeout ¶
SetWaitTimeout sets the total time to wait for a transaction to be included. When a timeout is reached, the BatchHandler will throw an error if the transaction has not been included or has been included but with a failed status.
The default value is 30 seconds. Setting the value to 0 will skip waiting for a transaction to be included.