modules

package
v0.0.0-...-a4145b4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package modules provides standard interfaces for extending the Client and Bundler packages with middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AiOpHandlerCtx

type AiOpHandlerCtx struct {
	AiOp         *aiop.AiOperation
	AiMiddleware common.Address
	ChainID      *big.Int
	// contains filtered or unexported fields
}

AiOpHandlerCtx is the object passed to AiOpHandler functions during the Client's SendAiOperation process.

func NewAiOpHandlerContext

func NewAiOpHandlerContext(
	op *aiop.AiOperation,
	aiMiddleware common.Address,
	chainID *big.Int,
	mem *mempool.Mempool,
	gs stake.GetStakeFunc,
) (*AiOpHandlerCtx, error)

NewAiOpHandlerContext creates a new AiOpHandlerCtx using a given op.

func (*AiOpHandlerCtx) GetFactoryDepositInfo

func (c *AiOpHandlerCtx) GetFactoryDepositInfo() *aimiddleware.IDepositManagerDepositInfo

GetFactoryDepositInfo returns the current AiMiddleware deposit for the factory.

func (*AiOpHandlerCtx) GetPaymasterDepositInfo

func (c *AiOpHandlerCtx) GetPaymasterDepositInfo() *aimiddleware.IDepositManagerDepositInfo

GetPaymasterDepositInfo returns the current AiMiddleware deposit for the paymaster.

func (*AiOpHandlerCtx) GetPendingFactoryOps

func (c *AiOpHandlerCtx) GetPendingFactoryOps() []*aiop.AiOperation

GetPendingFactoryOps returns all pending AiOperations in the mempool by the same factory.

func (*AiOpHandlerCtx) GetPendingPaymasterOps

func (c *AiOpHandlerCtx) GetPendingPaymasterOps() []*aiop.AiOperation

GetPendingPaymasterOps returns all pending AiOperations in the mempool by the same paymaster.

func (*AiOpHandlerCtx) GetPendingSenderOps

func (c *AiOpHandlerCtx) GetPendingSenderOps() []*aiop.AiOperation

GetPendingSenderOps returns all pending AiOperations in the mempool by the same sender.

func (*AiOpHandlerCtx) GetSenderDepositInfo

func (c *AiOpHandlerCtx) GetSenderDepositInfo() *aimiddleware.IDepositManagerDepositInfo

GetSenderDepositInfo returns the current AiMiddleware deposit for the sender.

type AiOpHandlerFunc

type AiOpHandlerFunc func(ctx *AiOpHandlerCtx) error

OpHandlerFunc is an interface to support modular processing of single AiOperations by the Client.

func ComposeAiOpHandlerFunc

func ComposeAiOpHandlerFunc(fns ...AiOpHandlerFunc) AiOpHandlerFunc

ComposeAiOpHandlerFunc combines many AiOpHandlers into one.

type BatchHandlerCtx

type BatchHandlerCtx struct {
	Batch          []*aiop.AiOperation
	PendingRemoval []*PendingRemovalItem
	AiMiddleware   common.Address
	ChainID        *big.Int
	BaseFee        *big.Int
	Tip            *big.Int
	GasPrice       *big.Int
	Data           map[string]any
}

BatchHandlerCtx is the object passed to BatchHandler functions during the Bundler's Run process. It also contains a Data field for adding arbitrary key-value pairs to the context. These values will be logged by the Bundler at the end of each run.

func NewBatchHandlerContext

func NewBatchHandlerContext(
	batch []*aiop.AiOperation,
	aiMiddleware common.Address,
	chainID *big.Int,
	baseFee *big.Int,
	tip *big.Int,
	gasPrice *big.Int,
) *BatchHandlerCtx

NewBatchHandlerContext creates a new BatchHandlerCtx using a copy of the given batch.

func (*BatchHandlerCtx) MarkOpIndexForRemoval

func (c *BatchHandlerCtx) MarkOpIndexForRemoval(index int, reason string)

MarkOpIndexForRemoval will remove the op by index from the batch and add it to the pending removal array. This should be used for ops that are not to be included on-chain and dropped from the mempool.

type BatchHandlerFunc

type BatchHandlerFunc func(ctx *BatchHandlerCtx) error

BatchHandlerFunc is an interface to support modular processing of AiOperation batches by the Bundler.

func ComposeBatchHandlerFunc

func ComposeBatchHandlerFunc(fns ...BatchHandlerFunc) BatchHandlerFunc

ComposeBatchHandlerFunc combines many BatchHandlers into one.

type PendingRemovalItem

type PendingRemovalItem struct {
	Op     *aiop.AiOperation
	Reason string
}

Directories

Path Synopsis
Package builder implements a module for bundlers to act as MEV searchers and send batches to the AiMiddleware via a Block Builder API that supports eth_sendBundle.
Package builder implements a module for bundlers to act as MEV searchers and send batches to the AiMiddleware via a Block Builder API that supports eth_sendBundle.
Package checks implements modules for running an array of standard validations for both the Client and Bundler.
Package checks implements modules for running an array of standard validations for both the Client and Bundler.
Package entities implements modules for reputation scoring and throttling/banning of entities as specified in EIP-4337.
Package entities implements modules for reputation scoring and throttling/banning of entities as specified in EIP-4337.
Package noop implements basic no-operation modules which are used by default for both Client and Bundler.
Package noop implements basic no-operation modules which are used by default for both Client and Bundler.
Package relay implements a module for private bundlers to send batches to the AiMiddleware through regular EOA transactions.
Package relay implements a module for private bundlers to send batches to the AiMiddleware through regular EOA transactions.

Jump to

Keyboard shortcuts

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