To play one game all the way down to the final step call in a single "chain" costs just over 631.2 ETH in total, so about 315.6 ETH per "side".
This shows that there is a lot of incentive for MEV to MEV the step function call.
Consider the following scenario:
Alice vs Bob
Alice is computing the last step & generating witness proof data such that Alice can call the on-chain step function and claim the bond that Bob put in, which is the biggest bond in the game-chain.
Alice calls step()
MEVoors scans mempool, if profitable to frontrun wrt the gas fees they pay, frontruns it and wins the bond.
Run the following PoC inside FaultDisputeGame.t.sol:
Alice balance before: 1000000000000000000000
Bob balance before: 1000000000000000000000
Charlie balance before: 1000000000000000000000
Alice balance after: 967619156200000000000
Bob balance after: 925925142600000000000
Charlie balance after: 1000000000000000000000
Alice balance claim: 1014074857600000000000
Bob balance claim: 925925142600000000000
Charlie balance claim: 1059999999800000000000
This means that calculating the step for honest-challengers is futile, they will not be able to execute it on-chain because they will be frontran. Computer resources will be wasted and the biggest single bond claim will never be able to be claimed by the honest-challenger.
The common reply is to use Flashbots but this is far from a safe-heaven to always land your transaction and should never be relied upon to elevate MEV.
Recommended Mitigation Steps
Reconsider the way a step function can be invoked.
Lines of code
https://github.com/code-423n4/2024-07-optimism/blob/70556044e5e080930f686c4e5acde420104bb2c4/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol#L234-L312
Vulnerability details
Description
People can call
step()
to do a MIPS step on-chain to close a game when it hitsMAX_DEPTH
:The problem is that, unlike the regular
move()
calls, stepping does not require a person to put up a bond.This opens up the following attack.
Proof of Concept
If we take a look at the Optimism Docs:
To play one game all the way down to the final step call in a single "chain" costs just over 631.2 ETH in total, so about 315.6 ETH per "side".
This shows that there is a lot of incentive for MEV to MEV the step function call.
Consider the following scenario:
step()
Run the following PoC inside
FaultDisputeGame.t.sol
:The output:
This means that calculating the step for honest-challengers is futile, they will not be able to execute it on-chain because they will be frontran. Computer resources will be wasted and the biggest single bond claim will never be able to be claimed by the honest-challenger.
The common reply is to use Flashbots but this is far from a safe-heaven to always land your transaction and should never be relied upon to elevate MEV.
Recommended Mitigation Steps
Reconsider the way a step function can be invoked.
Assessed type
Other