mempool

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

README

This package implements a very primitve, in-memory mempool.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// FetchMempoolTxs returns all transactions in the mempool
	FetchMempoolTxs() []*common.L2Tx
	// AddMempoolTx adds a transaction to the mempool
	AddMempoolTx(tx *common.L2Tx) error
	// RemoveTxs removes transactions that are considered immune to re-orgs (i.e. over X batches deep).
	RemoveTxs(transactions types.Transactions) error

	// CurrentTxs Returns the transactions that should be included in the current batch
	CurrentTxs(stateDB *state.StateDB, limiter limiters.BatchSizeLimiter) ([]*common.L2Tx, error)
}

func New

func New(chainID int64, logger gethlog.Logger) Manager

type NonceTracker added in v0.14.0

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

NonceTracker - a struct that helps us maintain the nonces for each account. If it gets asked for an account it does not know the nonce for, it will pull it from stateDB. Used when selecting transactions in order to ensure transactions get applied at correct nonces and correct order without any gaps.

func NewNonceTracker added in v0.14.0

func NewNonceTracker(stateDB *state.StateDB) *NonceTracker

func (*NonceTracker) GetNonce added in v0.14.0

func (nt *NonceTracker) GetNonce(address gethcommon.Address) uint64

func (*NonceTracker) IncrementNonce added in v0.14.0

func (nt *NonceTracker) IncrementNonce(address gethcommon.Address)

Jump to

Keyboard shortcuts

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