mempool

package
v0.0.0-...-7be72bc Latest Latest
Warning

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

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

Documentation

Overview

Package mempool provides a local representation of all the AiOperations 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 AiOperations 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 AiOperations from disk incase of a reset.

func (*Mempool) AddOp

func (m *Mempool) AddOp(aiMiddleware common.Address, op *aiop.AiOperation) error

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

func (*Mempool) Clear

func (m *Mempool) Clear() error

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

func (*Mempool) Dump

func (m *Mempool) Dump(aiMiddleware common.Address) ([]*aiop.AiOperation, error)

Dump will return a list of AiOperations from the mempool by AiMiddleware in the order it arrived.

func (*Mempool) GetOps

func (m *Mempool) GetOps(aiMiddleware common.Address, sender common.Address) ([]*aiop.AiOperation, error)

GetOps returns all the AiOperations associated with an AiMiddleware and Sender address.

func (*Mempool) RemoveOps

func (m *Mempool) RemoveOps(aiMiddleware common.Address, ops ...*aiop.AiOperation) error

RemoveOps removes a list of AiOperations from the mempool by AiMiddleware, Sender, and Nonce values.

Jump to

Keyboard shortcuts

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