mempool

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0, BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Overview

mempool implements a buffer of requests sent to the ISC chain, essentially a backlog of requests It contains both on-ledger and off-ledger requests. The mempool consists of 2 parts: the in-buffer and the pool All incoming requests are stored into the in-buffer first. Then they are asynchronously validated and moved to the pool itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mempool

type Mempool interface {
	ReceiveRequests(reqs ...isc.Request)
	ReceiveRequest(req isc.Request) bool
	RemoveRequests(reqs ...isc.RequestID)
	ReadyNow(currentTime time.Time) []isc.Request
	ReadyFromIDs(currentTime time.Time, reqIDs ...isc.RequestID) ([]isc.Request, []int, bool)
	HasRequest(id isc.RequestID) bool
	GetRequest(id isc.RequestID) isc.Request
	Info(currentTime time.Time) MempoolInfo
	WaitRequestInPool(reqid isc.RequestID, timeout ...time.Duration) bool // for testing
	WaitInBufferEmpty(timeout ...time.Duration) bool                      // for testing
	WaitPoolEmpty(timeout ...time.Duration) bool                          // for testing
	Close()
}

func New

func New(
	chainAddress iotago.Address,
	stateReader state.OptimisticStateReader,
	log *logger.Logger,
	mempoolMetrics metrics.MempoolMetrics,
) Mempool

type MempoolInfo added in v0.3.0

type MempoolInfo struct {
	TotalPool      int
	ReadyCounter   int
	InBufCounter   int
	OutBufCounter  int
	InPoolCounter  int
	OutPoolCounter int
}

Jump to

Keyboard shortcuts

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