mempool

package
v0.6.47 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mempool provides a local representation of all the UserOperations that are known to the bundler which have passed all Client checks and pending action by the Bundler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mempool

type Mempool struct {
	// contains filtered or unexported fields
}

Mempool provides read and write access to a pool of pending UserOperations which have passed all Client checks.

func New

func New(db *badger.DB) (*Mempool, error)

New creates an instance of a mempool that uses an embedded DB to persist and load UserOperations from disk incase of a reset.

func (*Mempool) AddOp

func (m *Mempool) AddOp(entryPoint common.Address, op *userop.UserOperation) error

AddOp adds a UserOperation to the mempool or replace an existing one with the same EntryPoint, Sender, and Nonce values.

func (*Mempool) Clear added in v0.2.0

func (m *Mempool) Clear() error

Clear will clear the entire embedded db and reset it to a clean state.

func (*Mempool) Dump added in v0.2.0

func (m *Mempool) Dump(entryPoint common.Address) ([]*userop.UserOperation, error)

Dump will return a list of UserOperations from the mempool by EntryPoint in the order it arrived.

func (*Mempool) GetOps added in v0.1.1

func (m *Mempool) GetOps(entryPoint common.Address, sender common.Address) ([]*userop.UserOperation, error)

GetOps returns all the UserOperations associated with an EntryPoint and Sender address.

func (*Mempool) RemoveOps

func (m *Mempool) RemoveOps(entryPoint common.Address, ops ...*userop.UserOperation) error

RemoveOps removes a list of UserOperations from the mempool by EntryPoint, Sender, and Nonce values.

Jump to

Keyboard shortcuts

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