-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
MP-1: Mempool data structure design
Goal
Design and implement the core mempool data structures used to store and manage transactions before they are included in a block.
This task focuses solely on defining the foundational in-memory structures. Transaction validation, prioritization, and replacement logic are intentionally deferred to later tasks (MP-2 ~ MP-4).
Scope
Included in this task:
- Define the main
Mempool/TxPooldata structure - Store transactions in memory with the following indices:
- Indexed by transaction hash
- Indexed by sender address (nonce-ordered)
- Track mempool size:
- Total transaction count
- Total memory usage (bytes)
- Enforce basic pool limits (count and/or size based)
Out of Scope
Explicitly excluded from this task:
- Transaction validation (nonce, gas, balance checks) — MP-2
- Gas price–based prioritization or selection — MP-3
- Transaction replacement logic — MP-4
- Pending vs queued transaction separation — MP-5
- Transaction removal after block execution
Design Notes
- The data structures should be designed with future extensions in mind:
- Gas-based priority queues
- Transaction replacement and eviction policies
- Pending/queued transaction separation
- No consensus (CL) or execution (EL) logic should be included at this stage.
Dependencies
- None
This task provides the foundation required by all subsequent mempool tasks.
Acceptance Criteria
- Core mempool (
Mempool/TxPool) data structure is implemented - Transactions are indexed by transaction hash
- Transactions are indexed by sender address (nonce-ordered)
- Mempool size limits (count and/or bytes) are enforced
- Unit tests exist for the core mempool data structure
References
- Reth Transaction Pool
https://github.com/paradigmxyz/reth/tree/main/crates/transaction-pool - Go-Ethereum Legacy TxPool
https://github.com/ethereum/go-ethereum/tree/master/core/txpool
Metadata
Metadata
Assignees
Labels
No labels