Requirments:
- web3.py
- brownie
- python3.9
Flashbots relayer can simulate bundles in order to construct the most proftible bundles. However, there is a there is a potential difference between the simulation and the execution payoff. Since Flashbots can not predict the special variables of next block, it can not ensure the exactly payoff of each bundle, and so, the payoff of the block.
Motivational example: Let
More generally, Fake bidding is the strategy used by adversarial searchers to fake bids in order to outbid competidors in the FB block simulation. This, would in expectancy increase their revenue. This strategy can be used after boosting their address reputation to increse its impact. Moreover,fake bidding strategy can be generalized with multiple accounts, to ensure wining the bundle and minimizing the payment with high probability.
Asumption: The flashbots relayer does a unique simulation per block/bundle (this can be generalized with more simulations). The adversary have
In this seeting, we have that the expected payoff of playing this strategy is
Oberve that
Fake bidding will clearly decrease the miners' revenue and other searchers' revenue.
Remark: Fake bidding can be generalized, if flashbots do more simulations and
Solution: Avoid block.coinbase payments. Just order by bundle score. However, searchers could fake their gas consumption simialry, boosting their score function.
Goerli/Mainnet experiment:
- Set two address
$add_1$ and$add_2$ . - Deploy contract FlashbotsBug. Flashbots bug has two functions, random and not random:
- Random makes a probabilistic payment using block.coinbase. Paying maxAmount eth or 0 (we generally set the probability to
$1/2$ ). This probability is constructed using block.coinbase and blockHash. - Not random: Makes a direct payment of minAmount.
- To be executed, both transactions check if the boolean changeVariable is true and after execution change the variable to false. This makes both transactions to conflict.
- Random makes a probabilistic payment using block.coinbase. Paying maxAmount eth or 0 (we generally set the probability to
- For each iteration,
$add_1$ and$add_2$ send a random and not random transaction respectively.
To prove the assumption that bundles are simulated once, we made the following. We deployed a smart contract in Goerli network with two functions, \texttt{RandomBid} and NotRandomBid. To execute the functions, both require that a variable
Goerli network: Contract= 0x87D8B355b2a2dc16bD3846063c074Ca3e4378064
Current design of Flashbots is strong against this particular strategy. We make this public for other builders to not fall to this strategies.
More details in Grim brothers report.