mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 03:35:19 +00:00
* Updated mocks * add reactor tests * add v1 reactor tests * Fix fuzz test for priority mempool * e2e adapted to mempool v1; prio pool is default now * Reverted default mempool to be fifo * Changed buf version * Added priority mempool to ci testnet * Fixed linter * Updated makefile * Aligned makefile changes to v0.34.x * Added go install for proto * Add log message to warn about prioritized mempool bug Signed-off-by: Thane Thomson <connect@thanethomson.com> * Changelog message Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com> Co-authored-by: Callum Waters <cmwaters19@gmail.com> Co-authored-by: Sam Kleinman <garen@tychoish.com> Co-authored-by: Thane Thomson <connect@thanethomson.com>
24 lines
1.1 KiB
Go
24 lines
1.1 KiB
Go
// The mempool pushes new txs onto the proxyAppConn.
|
|
// It gets a stream of (req, res) tuples from the proxy.
|
|
// The mempool stores good txs in a concurrent linked-list.
|
|
|
|
// Multiple concurrent go-routines can traverse this linked-list
|
|
// safely by calling .NextWait() on each element.
|
|
|
|
// So we have several go-routines:
|
|
// 1. Consensus calling Update() and ReapMaxBytesMaxGas() synchronously
|
|
// 2. Many mempool reactor's peer routines calling CheckTx()
|
|
// 3. Many mempool reactor's peer routines traversing the txs linked list
|
|
|
|
// To manage these goroutines, there are three methods of locking.
|
|
// 1. Mutations to the linked-list is protected by an internal mtx (CList is goroutine-safe)
|
|
// 2. Mutations to the linked-list elements are atomic
|
|
// 3. CheckTx() and/or ReapMaxBytesMaxGas() calls can be paused upon Update(), protected by .updateMtx
|
|
|
|
// Garbage collection of old elements from mempool.txs is handlde via the
|
|
// DetachPrev() call, which makes old elements not reachable by peer
|
|
// broadcastTxRoutine().
|
|
|
|
// TODO: Better handle abci client errors. (make it automatically handle connection errors)
|
|
package v0
|