Transaction pool eviction is a critical node-level mechanism for managing the mempool (memory pool), the temporary storage area for unconfirmed transactions. When a node's mempool reaches capacity—due to size limits, memory constraints, or age thresholds—it must selectively remove transactions to accept new ones. This process is distinct from transaction validation and is a purely local policy decision, meaning eviction rules can vary between different node implementations like Bitcoin Core or Geth.
Transaction Pool Eviction
What is Transaction Pool Eviction?
The process by which nodes remove pending transactions from their memory pool to manage finite system resources and prevent resource exhaustion attacks.
Common eviction strategies are designed to prioritize network health and node stability. These include fee-based eviction, where transactions with the lowest fee-per-byte (sat/vB or gwei) are dropped first, and time-based eviction, where the oldest transactions are removed after a set duration (e.g., 336 hours in Bitcoin). Nodes may also evict transactions that become invalid due to a double-spend by a newer, higher-fee transaction or because a dependent parent transaction was removed, a scenario known as orphaning or chained eviction.
Eviction policies directly influence network dynamics and user experience. A strict, fee-prioritized eviction creates a competitive fee market, incentivizing users to pay higher fees for faster inclusion. However, aggressive eviction can lead to transaction starvation, where low-fee transactions are repeatedly broadcast but never persist long enough to be mined. To mitigate this, some protocols implement replace-by-fee (RBF) or package relay policies, allowing users to proactively update a transaction before it gets evicted.
From a security perspective, eviction is a primary defense against Denial-of-Service (DoS) attacks that flood the network with low-value transactions. Without eviction, an attacker could fill every node's mempool, preventing legitimate users from broadcasting transactions. The design of eviction logic must therefore balance resource protection with transaction censorship resistance, ensuring the network remains open and functional even under load.
How Transaction Pool Eviction Works
A technical overview of the policies and algorithms that manage memory usage in a node's pending transaction queue.
Transaction pool eviction is the process by which a blockchain node removes pending transactions from its mempool to manage finite memory and prevent resource exhaustion. When the pool reaches a configured size or age limit, the node's eviction policy selects the lowest-priority transactions for removal, typically based on metrics like fee-per-byte, absolute fee, or time spent in the pool. This ensures the node can continue to accept new, potentially higher-value transactions without crashing.
The most common eviction strategy is fee-based replacement, where incoming transactions with a higher fee rate can displace older, lower-fee ones. For example, Bitcoin Core uses a minimum relay fee and will evict the lowest-feerate transactions first when the pool is full. Other networks may implement time-to-live (TTL) eviction, automatically dropping transactions after a set period, or logical size limits that cap the total virtual bytes of transactions in the pool. These mechanisms are crucial for network health, preventing denial-of-service attacks via spam transactions.
Eviction logic must balance efficiency with fairness. A poorly designed policy could lead to transaction starvation, where legitimate low-fee transactions are never confirmed. Sophisticated implementations, like Ethereum's, may consider sender nonce gaps—if a transaction from an account is evicted, all subsequent transactions from that account with higher nonces are also removed, as they cannot be executed out of order. Developers tuning node software must carefully configure eviction parameters (-maxmempool, -mempoolexpiry) to align with their operational needs and the network's typical load.
Key Features of Transaction Pool Eviction
Transaction pool eviction is the process by which nodes remove pending transactions from their local memory pool to manage finite resources and maintain network stability. These mechanisms are critical for preventing denial-of-service attacks and ensuring efficient block production.
Priority-Based Eviction
The most common eviction strategy, where transactions are ranked and removed based on a priority score. This typically combines:
- Transaction fee per unit of gas (e.g., Gwei)
- Transaction age (time in pool)
- Resource consumption (e.g., gas limit, calldata size) Low-fee, old, or resource-intensive transactions are evicted first to make room for higher-value ones.
Resource-Limiting Eviction
Nodes enforce hard limits on pool capacity, triggering eviction when thresholds are exceeded. Key limits include:
- Total pool size in bytes (to constrain memory)
- Maximum number of transactions (e.g., 10,000 pending TXs)
- Per-account transaction caps (to prevent spam from single addresses) When a limit is hit, the lowest-priority transactions are purged until the pool is under capacity.
Time-To-Live (TTL) Expiry
Transactions are automatically evicted after a predefined duration in the pool, known as their Time-To-Live. This prevents stale transactions from occupying space indefinitely. For example, a default TTL might be 3 hours. If a transaction isn't mined within that window, it is dropped and must be re-broadcast by the wallet, often with a higher fee.
Replacement-By-Fee (RBF) & Its Impact
The Replace-By-Fee (RBF) protocol allows a sender to broadcast a new transaction that replaces a prior unconfirmed one, typically with a higher fee. This can directly cause eviction:
- The original, lower-fee transaction is evicted from the pool.
- The new, higher-fee transaction takes its place. RBF is a user-initiated form of eviction that optimizes for fee market dynamics.
DoS Protection Mechanisms
Eviction policies are a primary defense against Denial-of-Service (DoS) attacks that flood the pool. Key protections include:
- Banning accounts that send invalid or spam transactions.
- Rate-limiting incoming connections.
- Evicting transactions that fail initial validation checks (e.g., invalid nonce, insufficient gas). These rules ensure the node remains responsive for legitimate users.
Node Implementation Variance
Eviction logic is not standardized and varies significantly between node client software (e.g., Geth, Erigon, Besu). This leads to network-wide effects:
- A transaction evicted from one node's pool may persist in another's.
- Differences in pool sizing and priority algorithms can cause inconsistent transaction propagation.
- Miners/validators often run customized, more aggressive eviction policies to maximize fee revenue.
Common Eviction Criteria & Triggers
Transaction pool eviction is the process of removing pending transactions from a node's mempool based on specific rules to manage memory and prevent spam.
Time-to-Live (TTL) Expiry
Transactions are evicted after exceeding a predefined Time-to-Live (TTL). This prevents stale transactions from occupying pool space indefinitely. For example, Ethereum nodes often drop transactions older than a set number of blocks or a specific timestamp. This is a primary defense against memory exhaustion from old, non-executable transactions.
Nonce Gap Eviction
Transactions from a specific sender are evicted if there is a nonce gap. Blockchain state transitions require sequential nonces. If a transaction with a nonce N is missing, all subsequent transactions from that sender with nonces >N are considered invalid for inclusion and are removed to free up pool capacity.
Gas Price Floor Eviction
Nodes enforce a minimum acceptable gas price or priority fee. Transactions offering a fee below this dynamic floor are evicted. This floor often rises with network congestion, automatically clearing out low-fee transactions that are unlikely to be mined, ensuring the pool contains economically viable candidates.
Pool Capacity Limits
Eviction is triggered when the total number of transactions or the pool's memory usage exceeds a hard cap. To make room for new transactions, the node removes the lowest-priority transactions, typically those with the lowest fee-per-gas. This is a critical mechanism for preventing resource exhaustion attacks.
Account-Based Eviction
To prevent a single account from spamming the pool, nodes may implement per-account limits. If an account submits transactions beyond its allotted slots, the oldest or lowest-fee transactions from that account are evicted. This ensures fair access to the transaction pool across many users.
Invalid State Transition
Transactions that become invalid due to on-chain state changes are evicted. Common triggers include:
- Insufficient balance for the transaction's value + gas.
- Invalidated smart contract logic (e.g., a condition in the contract code that no longer passes). The node continuously validates pool transactions against the latest state.
Eviction Policies: A Network Comparison
A comparison of transaction pool eviction mechanisms across major blockchain networks.
| Eviction Trigger / Policy | Ethereum (Geth) | Bitcoin (Bitcoin Core) | Solana |
|---|---|---|---|
Primary Eviction Trigger | Memory pressure (default 5GB) | Memory pressure (default 300 MB) | Slot-based expiration |
Fee-Based Eviction | |||
Time-Based Eviction | |||
Dynamic Fee Threshold | Base Fee * multiplier | Minimum relay fee | |
Replacement Policy (Replace-by-Fee) | |||
Stake-Weighted Priority | |||
Default Max Pool Size | ~5,000-10,000 txs | ~3,000 txs | ~128,000 txs |
Local vs. Global Limits | Per-sender, per-nonce | Per-sender, chunk-based | Per-validator, leader-specific |
Impact on the Broader Ecosystem
Transaction pool eviction is not an isolated mechanism; its design and implementation have significant, cascading effects on network health, user experience, and the competitive landscape of block building.
Network Stability & Spam Resistance
Eviction policies are a primary defense against Denial-of-Service (DoS) attacks and spam. By removing low-fee or invalid transactions, they prevent the mempool from becoming a permanent storage for malicious traffic, ensuring the network can process legitimate transactions. This protects full nodes from resource exhaustion and maintains baseline network liveness.
User Experience & Fee Estimation
The eviction logic directly shapes transaction lifecycle predictability. Aggressive eviction can lead to transactions being dropped, forcing users to re-submit. This uncertainty complicates fee estimation services, which must model not just inclusion probability but also the risk of eviction before confirmation, especially during periods of high congestion.
MEV & Builder/Relay Dynamics
Eviction rules create a competitive arena for Maximal Extractable Value (MEV). Builders and searchers must strategize around the mempool's volatility:
- Transaction replacement: Strategies like Replace-By-Fee (RBF) can be used to prevent eviction.
- Private order flows: To avoid front-running and eviction risks, searchers send bundles directly to builders via private mempools or relays.
Wallet & DApp Design Considerations
Application developers must build for eviction scenarios. Wallets implement features like:
- Automatic re-broadcasting of stuck transactions.
- Fee bumping interfaces (e.g., RBF, CPFP).
- Stale nonce handling to manage the chain of pending transactions if an earlier one is evicted.
Interoperability & Cross-Chain Bridges
For cross-chain bridges and atomic arbitrage bots, eviction introduces settlement risk. A transaction on one chain (e.g., initiating a bridge withdrawal) must be matched by a transaction on another. If one leg is evicted, the entire arbitrage or bridge operation can fail, potentially leading to funds being locked or lost opportunities.
Governance & Protocol Upgrades
Changes to eviction policy (e.g., size limits, fee thresholds) are non-trivial consensus parameters or client implementation details. Debates around these rules, such as increasing the mempool size, involve trade-offs between decentralization (node resource requirements) and usability, often requiring broad community coordination via Ethereum Improvement Proposals (EIPs) or similar governance processes.
Security & Attack Vector Considerations
Transaction pool eviction policies are critical security mechanisms that protect blockchain nodes from resource exhaustion and denial-of-service attacks by managing the size and content of their pending transaction queues.
Denial-of-Service (DoS) Protection
The primary security function of eviction is to prevent Denial-of-Service (DoS) attacks where an attacker floods the network with low-fee or invalid transactions. Without eviction, a node's mempool would fill up, consuming all available memory and CPU, causing the node to crash or become unresponsive. Policies like fee-based eviction ensure that only the most economically meaningful transactions are retained, making spam attacks costly.
Fee-Based Eviction (Most Common)
This is the dominant eviction strategy. When the pool reaches capacity, the node removes transactions with the lowest fee per unit of gas (gas price) or fee per virtual byte. This creates a fee market within the pool and forces attackers to pay substantial fees to occupy space, turning a spam attack into a costly economic attack. For example, Bitcoin Core and Geth both implement variations of this Least-Fee-First-Removed policy.
Time-Based Eviction
Nodes may evict transactions that have been in the pool for an excessive duration (e.g., 2 weeks). This prevents stale transactions from clogging the pool indefinitely. However, this can be exploited in time-bandit attacks or fee sniping, where miners might attempt to resurrect and mine old, high-fee transactions. Robust implementations often combine time limits with other heuristics to mitigate these risks.
Resource Exhaustion Attacks
Attackers can craft transactions designed to maximize memory or CPU usage before eviction kicks in. Examples include:
- Large-byte spam: Transactions with massive calldata or many inputs/outputs.
- CPU-intensive scripts: Transactions with complex smart contract logic that takes long to validate. Defenses include limiting transaction size, measuring gas consumption during pre-check, and implementing DoS score systems that track resource cost per peer.
Mempool Isolation & Topology Attacks
Inconsistent eviction policies across nodes can lead to mempool fragmentation. An attacker might spam a subset of nodes to evict a specific transaction, preventing its propagation—a form of eclipse attack on a transaction. This can enable frontrunning or transaction censorship. Networks mitigate this through peer scoring, requiring transaction rebroadcast, and using Gossip protocols designed for resilience.
Implementation & Configuration Risks
Improper eviction logic is a direct vulnerability. Risks include:
- Eviction loops: Poor logic causing continuous adding/removing of the same transactions.
- O(n) eviction algorithms: That become too slow under load, creating a DoS vector.
- Incorrect fee estimation: Causing legitimate user transactions to be unfairly evicted.
Node operators must ensure their client software is up-to-date and configured with appropriate pool size limits (
txpool.globalslotsin Geth,maxmempoolin Bitcoin Core).
Common Misconceptions About Eviction
Clarifying widespread misunderstandings about how and why transactions are removed from a node's mempool, focusing on the technical mechanisms rather than user errors.
No, eviction from a node's mempool is not a network-wide rejection; it is a local resource management action. A transaction is evicted when a node's mempool reaches capacity and must remove lower-priority transactions to make room for new, higher-priority ones. The evicted transaction may still be valid and can be rebroadcast to other nodes or re-submitted later. Network-wide rejection occurs due to an invalid signature, insufficient funds, or a consensus rule violation, which prevents inclusion in any block.
Frequently Asked Questions (FAQ)
Common questions about how and why transactions are removed from a node's pending transaction pool, a critical process for network health and security.
Transaction pool eviction is the process by which a node removes pending transactions from its mempool to manage memory and prevent resource exhaustion. It is necessary because the pool is a finite, in-memory data structure; without eviction, a node could be overwhelmed by a spam attack or simply run out of memory during periods of high network activity. Eviction policies ensure the node remains operational, prioritizing transactions that are most likely to be included in the next block, typically those with the highest gas price or priority fee. This maintains network liveness and protects against denial-of-service (DoS) attacks.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.