Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModuleConfig ¶
type ModuleConfig struct {
Self t.ModuleID // id of this module
Hasher t.ModuleID
Timer t.ModuleID
}
ModuleConfig sets the module ids. All replicas are expected to use identical module configurations.
type ModuleParams ¶
type ModuleParams struct {
// Maximal number of individual transactions in a single batch.
MaxTransactionsInBatch int
// Maximal total combined payload size of all transactions in a batch (in Bytes)
MaxPayloadInBatch int
// Maximal time between receiving a batch request and emitting a batch.
// On reception of a batch request, the mempool generally waits
// until it contains enough transactions to fill a batch (by number or by payload size)
// and only then emits the new batch.
// If no batch has been filled by BatchTimeout, the mempool emits a non-full (even a completely empty) batch.
BatchTimeout time.Duration
// If this parameter is not nil, the mempool will not receive transactions directly (through NewTransactions) events.
// On reception of such an event, it will report an error (making the system crash).
// Instead, TxFetcher will be called to pull transactions from an external source
// when they are needed to form a batch (upon the RequestBatch event).
// Looking up transactions by ID will also always fail (return no transactions).
TxFetcher func() []*trantorpbtypes.Transaction
}
ModuleParams sets the values for the parameters of an instance of the protocol. All replicas are expected to use identical module parameters.
type State ¶
type State struct {
// All the transactions in the mempool.
// Incoming transactions that have not yet been delivered are added to this list.
// They are removed upon delivery.
Transactions *indexedlist.IndexedList[tt.TxID, *trantorpbtypes.Transaction]
}
State represents the common state accessible to all parts of the module implementation. TODO: Consider moving this definition inside the `internal` subdirectory, as it is only used by the mempool.
Click to show internal directories.
Click to hide internal directories.