Documentation ¶
Overview ¶
mempool implements a buffer of requests sent to the ISCP 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
- type Mempool
- func (m *Mempool) Close()
- func (m *Mempool) GetRequest(id iscp.RequestID) iscp.Request
- func (m *Mempool) HasRequest(id iscp.RequestID) bool
- func (m *Mempool) Info() chain.MempoolInfo
- func (m *Mempool) ReadyFromIDs(nowis time.Time, reqIDs ...iscp.RequestID) ([]iscp.Request, []int, bool)
- func (m *Mempool) ReadyNow(now ...time.Time) []iscp.Request
- func (m *Mempool) ReceiveRequest(req iscp.Request) bool
- func (m *Mempool) ReceiveRequests(reqs ...iscp.Request)
- func (m *Mempool) RemoveRequests(reqs ...iscp.RequestID)
- func (m *Mempool) WaitInBufferEmpty(timeout ...time.Duration) bool
- func (m *Mempool) WaitRequestInPool(reqid iscp.RequestID, timeout ...time.Duration) bool
Constants ¶
const FallbackDeadlineMinAllowedInterval = time.Minute * 10
don't process any request which deadline will expire within 10 minutes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mempool ¶
type Mempool struct {
// contains filtered or unexported fields
}
func (*Mempool) HasRequest ¶
HasRequest checks if the request is in the pool
func (*Mempool) ReadyFromIDs ¶
func (m *Mempool) ReadyFromIDs(nowis time.Time, reqIDs ...iscp.RequestID) ([]iscp.Request, []int, bool)
ReadyFromIDs if successful, function returns a deterministic list of requests for running on the VM - (a list of missing requests), false if some requests not arrived to the mempool yet. For retry later - (a list of processable requests), true if the list can be deterministically calculated Note that (a list of processable requests) can be empty if none satisfies nowis time constraint (timelock, fallback) For requests which are known and solidified, the result is deterministic
func (*Mempool) ReadyNow ¶
ReadyNow returns preliminary batch of requests for consensus. Note that later status of request may change due to the time change and time constraints If there's at least one committee rotation request in the mempool, the ReadyNow returns batch with only one request, the oldest committee rotation request
func (*Mempool) ReceiveRequest ¶
ReceiveRequest used to receive off-ledger request
func (*Mempool) ReceiveRequests ¶
ReceiveRequests places requests into the inBuffer. InBuffer is unordered and non-deterministic
func (*Mempool) RemoveRequests ¶
RemoveRequests removes requests from the pool
func (*Mempool) WaitInBufferEmpty ¶
WaitAllRequestsIn waits until in buffer becomes empty. Used in synchronous situations when the caller want to be sure all requests were fed into the pool. May create nondeterminism when used from goroutines