Crypto Training

Ethereum Is a Dark Forest: MEV Threat Models for Protocol Engineers

Assume searchers and builders can see, simulate and reorder any transaction that reaches the public mempool. This post follows that threat from the 2020 dark forest essays to today's builder market and shows where it turns into a protocol bug.

Crypto Training•2026-01-29•10 min read

Ethereum dark forest illustration

In August 2020 Dan Robinson and Georgios Konstantopoulos tried to rescue about $12,000 of Uniswap v2 liquidity tokens that had been sent to the pair contract by mistake, where anyone could claim them by calling burn. They hid the call behind two purpose-built contracts and still lost the funds within seconds of their transaction reaching the mempool, to a bot of the kind their essay calls a generalized front-runner. That essay, Ethereum is a Dark Forest, gave the public mempool the name it still carries.

A month later samczsun described the rescue of 25,000 ETH, then about $9.6 million, from a bug in Lien Finance (Escaping the Dark Forest). That rescue worked because the signed transactions went straight to the SparkPool mining pool and never touched the public mempool.

The two essays together state the threat model that still holds. A transaction that is profitable to copy or to reorder will be copied or reordered if adversaries can see it before it is included, and the defence that worked was a private path to the block producer. What has changed since 2020 is who the block producer is and how much of that private path you can trust.

What changed after the essays#

The academic groundwork predates both essays. Flash Boys 2.0, published in April 2019, documented bots bidding against each other in priority gas auctions and introduced the term miner extractable value.

After the Merge on 15 September 2022, validators took over block proposal, and most of them outsource the building of the block. With MEV-Boost a proposer accepts the highest-paying block header offered by a relay and signs it before seeing the contents, while specialised builders assemble the block. When we checked on 24 November 2026, mevboost.pics put the share of blocks delivered this way at about 91%.

sequenceDiagram participant U as User participant S as Searcher participant B as Builder participant R as Relay participant V as Proposer U->>B: transaction, through the public mempool or a private RPC S->>B: bundle placed around or after the user transaction B->>R: full block and bid R->>V: header and bid only V->>R: signed header R->>V: block body, then publication

Block building is concentrated. Over the 24 hours to 24 November 2026, relayscan.io showed one builder, Titan, producing about 52% of MEV-Boost blocks and the top two producing about 75%. Ordering on Ethereum is therefore decided by a handful of builders in a sealed-bid auction, and the gas-price bidding wars of 2019 have largely moved into that auction.

Private submission became an ordinary product. Flashbots Protect sends transactions to a private Flashbots mempool instead of the public one and, per its documentation, has them included only when they do not revert. Using it takes a change of RPC URL, which makes the public mempool the worst available place to send a transaction that carries value.

Privacy of this kind is a promise by the parties that see the transaction, and a proposer broke it in the incident Flashbots dates to 3 April 2023 (slot 6137846, late on 2 April in UTC). According to the Flashbots post-mortem, the proposer signed a deliberately invalid header, and the relay returned the block body anyway, since it had not validated the header and did not wait for its beacon nodes to accept the block. The proposer then rebuilt the block around the sandwich bots' exposed transactions and took roughly $20 million from them.

Relays remain trusted parties on mainnet as of November 2026. Enshrined proposer-builder separation, EIP-7732, is scheduled for the Glamsterdam upgrade, whose meta EIP lists a Sepolia activation on 6 October 2026 and no mainnet date yet.

On most rollups a single sequencer orders transactions and there is no public mempool, so outsiders usually cannot copy a pending transaction. The party to model there is the sequencer and its ordering policy.

The attacker model today#

For a contract on Ethereum mainnet we would assume all of the following.

  • Any transaction in the public mempool is visible before inclusion and can be simulated against the current state by anyone.
  • A searcher can place its own transactions directly before and after a victim's by paying a builder, and can make the whole sequence atomic so that it only lands if it is profitable.
  • Builders see everything sent to them, including private order flow, and the proposer selects the block that pays the most.
  • Whoever calls a permissionless function first collects its reward, and a bot can copy the calldata of a pending call and outbid it.
  • Inclusion can be delayed for a few blocks, and a proposer that holds consecutive slots controls ordering across them.

None of these requires breaking your contract. They become vulnerabilities when the contract's safety depends on a particular ordering.

Where ordering becomes a protocol bug#

FeatureAssumption that failsWhat it looks like in a finding
Swaps made by the protocolThe pool price at execution is the fair priceamountOutMin hardcoded to zero on a harvest, rebalance or reserve sale
DeadlinesThe transaction executes soon after signingdeadline: block.timestamp, which is always satisfied
LiquidationsAn honest keeper gets there firstA fixed bonus that searchers bid away to builders, or a liquidation triggered by back-running the oracle update
Permissionless maintenanceThe caller is the party who did the workRewards paid to msg.sender for a call whose calldata can be copied
Signed approvalsOnly the user submits their signatureA permit used by a front-runner so that the user's own call reverts

The first row is the one we would check before anything else, because protocols that sell rewards or rebalance get it wrong often. A Cantina competition on Cork in December 2024 found a reserve sale that called its swap with a minimum output of zero and estimated that sandwiching it would cut the profit by about 36% (finding with PoC). Halborn reported the same pattern in Entangle's swap wrappers in 2023 (finding with PoC).

SOLIDITY
// VULNERABLE: no price bound, and the deadline is whatever block includes the call
function harvest() external {
    uint256 amountIn = rewardToken.balanceOf(address(this));
    router.swapExactTokensForTokens(amountIn, 0, path, address(this), block.timestamp);
}

// Bounded: a trusted keeper supplies the limit and the expiry, computed off-chain
function harvest(uint256 minOut, uint256 deadline) external onlyKeeper {
    uint256 amountIn = rewardToken.balanceOf(address(this));
    router.swapExactTokensForTokens(amountIn, minOut, path, address(this), deadline);
}

A caller-supplied minOut protects only when the caller is trusted. If harvest has to stay permissionless, the bound must come from somewhere the caller cannot move within the transaction, such as an oracle price with a tolerance, and the post on oracles and TWAPs covers what qualifies.

Deadlines fail in both directions. block.timestamp as a deadline is evaluated in the block that includes the transaction, so it permits a builder to hold the transaction for as long as it stays valid. Leaving the field unset can be worse, since a Uniswap v3 router treats a zero deadline as already expired and the call always reverts (DaosLive finding).

Liquidations leak value through the oracle. A price update that makes a position liquidatable creates a profit for whoever lands the next transaction, and searchers pay builders for that slot. Chainlink's SVR feeds are one response, in which the update is sent through a private auction so that part of the bid returns to the lending protocol. The trade-off, per the same documentation, is a small configurable delay before the price is usable. Our post on liquidation as a security property goes further into incentive design.

The signed-approval row has its own write-up in the EIP-712 and permit post.

Defences and what each one trusts#

DefenceStopsAdds
Slippage bound and real deadlineUnbounded sandwich loss, stale executionNothing, provided the bound comes from a trusted source
Private RPCCopying and sandwiching from the public mempoolTrust in the RPC operator, the builders and the relays
Commit and revealCopying of bids, guesses and claimsA second transaction and a liveness requirement on the user
Batch auction with one clearing priceOrdering advantage inside the batchTrust in the solver competition and its operator
Declining-bonus (Dutch) liquidationOverpaying keepers through a fixed bonusA longer time to liquidation in fast markets

The contract-level rows are the ones a protocol can guarantee for every user. A private RPC is a choice each sender makes, so a protocol that is only safe when users route privately is unsafe for everyone who uses a default wallet configuration. Batch auctions go further, and CoW Protocol's auction documentation explains how settling a pair at one price per auction removes the value of ordering within it.

Searchers are targets too#

If you write keeper or arbitrage contracts, the same threat model applies to you with more force, because bots hold funds and execute whatever looks profitable. In September 2022 a bot with the vanity address 0xbaDc0dE lost 1,101 WETH because its dYdX flash-loan callback did not check who had initiated the call (replay). In June 2026 the sandwich bot known as jaredfromsubway.eth was drained through token approvals it had granted to bait contracts, a loss CertiK put near 4,424 ETH (replay).

Both were ordinary access-control and approval bugs, and both attackers could study the victim's behaviour on chain for as long as they liked before acting.

A full day of MEV research#

The recording below is the livestream of MEV-SBC '24, the workshop Flashbots ran on 6 August 2024, the day before the Science of Blockchain Conference. It runs for the whole day, and the agenda with per-talk links is the practical way in. The sessions on block-building auctions and on proposer-builder separation are the closest to this post.

Questions for every entry point#

For each state-changing function, write down the answers before the audit does it for you.

  • If a stranger copies this call with their own address, do they receive something the original caller earned?
  • If the price moves just before this call and back just after, what is the largest loss, and is it bounded by a parameter the user or a trusted keeper set?
  • Can a third party make this call revert cheaply, for example by using a signature or filling an order first, and what does the user lose when it does?
  • If the call is delayed by ten minutes or by a day, is it still safe to execute?
  • Does the function pay out more to whoever arrives first, and if so, who ends up receiving that payment once searchers compete for it?

Reading real traces helps with all five, and the post on transaction forensics shows how to spot a sandwich or a back-run in a receipt.

Sources#