Skip to content

Txpool Policy

This document summarizes the mempool policy, eviction rules, and the knobs that control pool behavior. Defaults are in code; there is no runtime config surface yet, so changing these requires code edits.

  • Ordering: lowest (max_fee, priority_tip) evicted first, with (inserted_at_ms, tx_hash) as tie-breakers.
  • Trigger: when txpool.len() > max_txs.
  • Location: src/txpool.rs (fee-ordered by_fee index).

Eviction Policy (Sealed / Private Mempool)

Section titled “Eviction Policy (Sealed / Private Mempool)”
  • Ordering: FIFO by arrival time.
  • Trigger: when sealed_len() > max_sealed_txs.
  • Location: src/txpool.rs (sealed BTreeMap by arrival).

These are enforced before the tx enters the pool:

LimitDescription
TX_MAX_SIZE_BYTESMax serialized tx size
TX_MAX_CALLDATA_BYTESMax calldata size
TX_MAX_DEPLOY_BUNDLE_BYTESMax deploy payload
TX_MIN_FEE_FLOORMinimum fee threshold
TX_MAX_PENDING_PER_SENDERPer-sender queue cap

Location: src/bin/node.rs.

These live in txpool::Config (src/txpool.rs) and are wired into the application config via AppConfig (src/application/config.rs).

KnobDescription
max_txsPool size cap
max_txs_per_blockMax txs selected per block
max_age_msTTL for stale tx pruning
max_txs_per_senderPer-sender limit
max_txs_per_lanePer-lane limit
max_lanes_per_senderLanes per sender
max_tx_bytesEstimated size limit
max_sealed_txsSealed pool size cap
max_sealed_per_blockMax sealed txs per block
  • Minimum fee: TX_MIN_FEE_FLOOR (currently 1).
  • Eviction comparator: (max_fee, priority_tip) from FeeIntent::V1.

Until a runtime config file is added, changes require editing the constants in src/bin/node.rs and/or defaults in src/txpool.rs.

ScenarioAdjustment
High throughputIncrease max_txs, max_txs_per_block
Resource constrainedDecrease max_txs, max_tx_bytes
Spam protectionIncrease TX_MIN_FEE_FLOOR, decrease max_txs_per_sender
Sealed tx heavyIncrease max_sealed_txs, max_sealed_per_block