Sjors Provoost
· 3d
> Flashbots bundles are all-or-nothing with protection against reverts, but that is the relay's and builder's promise, not a protocol rule.
The smart contract calls that executed the sandwich didn't ...
No. A contract can't enforce that. Each transaction runs on its own, and while the front-run executes, the EVM can't see which transactions come after it in the block. There is no opcode that says "revert unless my back-run follows". In a sandwich the middle transaction belongs to someone else, so you can't fold all three legs into one transaction either. That's why bots rely on the builder's promise that a bundle runs whole or not at all.
The checks a bot can do inside its contract only look at the present:
- Slippage or reserve checks. The front-run ran first, on exactly the pool state the bot expected, so they passed.
- A check on block.coinbase, block.number or similar. These are meant to make sure only the intended builder can include the transaction. But here the proposer built the block itself and could set those fields however it wanted, so such a check stops nothing.
- A minimum output on the back-run. That probably worked as designed: it reverted instead of selling at a loss. But by then the front-run's money was already gone, so all it saved was the bot's remaining tokens.
So the bots' real exposure was the front-run. It moved their own capital into a pool and depended on a later transaction to get it back. Once someone outside the trusted builder/relay path controls the order, that transaction can't protect itself. After the incident, the fix went into the relay rather than into the bots' contracts: the relay now checks the signed header and only reveals the payload once it has published the block itself (Flashbots' post-mortem, already linked above). I haven't read the bots' contract code, so I can't say exactly which checks they had.