Version: v0.6.21 Latest Latest

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

Go to latest
Published: Sep 21, 2023 License: GPL-3.0 Imports: 13 Imported by: 0



Package bundler provides the mediator for processing outgoing UserOperation batches to the EntryPoint.



This section is empty.


This section is empty.


This section is empty.


type Bundler

type Bundler struct {
	// contains filtered or unexported fields

Bundler controls the end to end process of creating a batch of UserOperations from the mempool and sending it to the EntryPoint.

func New

func New(mempool *mempool.Mempool, chainID *big.Int, supportedEntryPoints []common.Address) *Bundler

New initializes a new EIP-4337 bundler which can be extended with modules for validating batches and excluding UserOperations that should not be sent to the EntryPoint and/or dropped from the mempool.

func (*Bundler) Process added in v0.4.0

func (i *Bundler) Process(ep common.Address) (*modules.BatchHandlerCtx, error)

Process will create a batch from the mempool and send it through to the EntryPoint.

func (*Bundler) Run

func (i *Bundler) Run() error

Run starts a goroutine that will continuously process batches from the mempool.

func (*Bundler) SetGetBaseFeeFunc added in v0.6.5

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 added in v0.6.6

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 added in v0.6.5

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 added in v0.4.0

func (i *Bundler) SetMaxBatch(max int)

SetMaxBatch defines the max number of UserOperations per bundle. The default value is 0 (i.e. unlimited).

func (*Bundler) Stop added in v0.2.0

func (i *Bundler) Stop()

Stop signals the bundler to stop continuously processing batches from the mempool.

func (*Bundler) UseLogger

func (i *Bundler) UseLogger(logger logr.Logger)

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.

func (*Bundler) UserMeter added in v0.6.9

func (i *Bundler) UserMeter(meter metric.Meter) error

UserMeter defines an opentelemetry meter object used by the Bundler instance to capture metrics during each run.

Jump to

Keyboard shortcuts

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