Documentation ¶
Overview ¶
Package bundler provides the mediator for processing outgoing AiOperation batches to the AiMiddleware.
Index ¶
- type Bundler
- func (i *Bundler) AiMeter(meter metric.Meter) error
- func (i *Bundler) Process(ep common.Address) (*modules.BatchHandlerCtx, error)
- func (i *Bundler) Run() error
- func (i *Bundler) SetGetBaseFeeFunc(gbf gasprice.GetBaseFeeFunc)
- func (i *Bundler) SetGetGasTipFunc(ggt gasprice.GetGasTipFunc)
- func (i *Bundler) SetGetLegacyGasPriceFunc(ggp gasprice.GetLegacyGasPriceFunc)
- func (i *Bundler) SetMaxBatch(max int)
- func (i *Bundler) Stop()
- func (i *Bundler) UseLogger(logger logr.Logger)
- func (i *Bundler) UseModules(handlers ...modules.BatchHandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundler ¶
type Bundler struct {
// contains filtered or unexported fields
}
Bundler controls the end to end process of creating a batch of AiOperations from the mempool and sending it to the AiMiddleware.
func New ¶
func New(mempool *mempool.Mempool, chainID *big.Int, supportedAiMiddlewares []common.Address) *Bundler
New initializes a new EIP-4337 bundler which can be extended with modules for validating batches and excluding AiOperations that should not be sent to the AiMiddleware and/or dropped from the mempool.
func (*Bundler) AiMeter ¶
AiMeter defines an opentelemetry meter object used by the Bundler instance to capture metrics during each run.
func (*Bundler) Process ¶
Process will create a batch from the mempool and send it through to the AiMiddleware.
func (*Bundler) Run ¶
Run starts a goroutine that will continuously process batches from the mempool.
func (*Bundler) SetGetBaseFeeFunc ¶
func (i *Bundler) SetGetBaseFeeFunc(gbf gasprice.GetBaseFeeFunc)
SetGetBaseFeeFunc defines the function used to retrieve an estimate for basefee during each bundler run.
func (*Bundler) SetGetGasTipFunc ¶
func (i *Bundler) SetGetGasTipFunc(ggt gasprice.GetGasTipFunc)
SetGetGasTipFunc defines the function used to retrieve an estimate for gas tip during each bundler run.
func (*Bundler) SetGetLegacyGasPriceFunc ¶
func (i *Bundler) SetGetLegacyGasPriceFunc(ggp gasprice.GetLegacyGasPriceFunc)
SetGetLegacyGasPriceFunc defines the function used to retrieve an estimate for gas price during each bundler run.
func (*Bundler) SetMaxBatch ¶
SetMaxBatch defines the max number of AiOperations per bundle. The default value is 0 (i.e. unlimited).
func (*Bundler) Stop ¶
func (i *Bundler) Stop()
Stop signals the bundler to stop continuously processing batches from the mempool.
func (*Bundler) UseLogger ¶
UseLogger defines the logger object used by the Bundler instance based on the go-logr/logr interface.
func (*Bundler) UseModules ¶
func (i *Bundler) UseModules(handlers ...modules.BatchHandlerFunc)
UseModules defines the BatchHandlers to process batches after it has gone through the standard checks.