hotmint-mempool
Transaction mempool for the Hotmint BFT consensus framework.
A thread-safe, async transaction pool with FIFO ordering, Blake3-based deduplication, and configurable size limits. Provides length-prefixed payload encoding for block inclusion.
Features
- FIFO ordering — transactions are proposed in the order they were received
- Deduplication — duplicate transactions (by Blake3 hash) are silently rejected
- Size limits — configurable max transaction count and per-transaction byte limit
- Payload encoding — length-prefixed format for embedding transactions in blocks
- Thread-safe — all operations are
asyncand safe for concurrent access
Usage
use Mempool;
// custom limits: max 10,000 txs, 1MB per tx
let mempool = new;
// or use defaults (10k txs, 1MB)
let mempool = default;
Add transactions
// returns true if accepted, false if rejected (duplicate or full)
let accepted = mempool.add_tx.await;
Collect payload for block proposal
// drain up to 1MB of transactions for block inclusion
let payload = mempool.collect_payload.await;
Decode payload from a committed block
let txs: = decode_payload;
for tx in &txs
Integration with Application trait
use Arc;
use Application;
use Mempool;
License
GPL-3.0-only