edit 10/05/21: update timeline, remove megabundle
edit 04/05/21: update timeline, remove proxy contract, add release plan
edit 21/04/21: incorporate feedback and finalize proposal
edit 14/04/21: update timeline and incorporate feedback
Flashbots Core consists of MEV-geth together with the Flashbots Relay. The current live version is v0.1, this document describes the proposed improvements to roll out in the next version, v0.2. The tentative timeline for this version is:
The release plan for v0.2 is outlined in the Flashbots Auction documentation.
The upgrade process for flashbots core infrastructure is detailed in Flashbots Core - Upgrade Process.
The WIP mev-geth v0.2 formal specification is detailed on github
Community members highlighted a number of criteria for a good scoring function:
These criteria can be used to evaluate how the current bundle scoring function compares to alternatives. Apart from these, we require that the scoring approximately compensates for the opportunity cost that the miner incurs by including the bundle, which limits the choice of function.
criterion | option 1 | option 2 | option 3 | option 4 | option 5 |
---|---|---|---|---|---|
bundle stuffing | ❌ | ✅ | ✅ | ✅ | ✅ |
large bundles | ❌ | ❌ | ❌ | ✅ | ✅ |
compatibility | ✅ | ❌ | ✅ | ✅ | ✅ |
efficient | ✅ | ✅ | ✅ | ❌ | ✅ |
risk-minimized | ✅ | ✅ | ✅ | ✅ | ❌ |
Option 2: Ignoring gas price solves our bundle stuffing issues, but it breaks compatibility with frontrunning protection use case where users can send regular transactions through flashbots.
Option 3: Achieves the same objectives as option 2 while maintaining compatibility for gasprice payments.
Option 4: Scoring based on revenue of full blocks would provide a perfect score which does not penalize large bundles, but our initial benchmarks found it would limit throughput to approx 15 bundles per second. We estimate it would be possible to increase the throughput up to 100 bundles per second with geth optimizations. This is a promising future direction, but out of scope for this release. Please reach out if you are interested in working on geth performance optimizations and benchmarking.
Option 5: This proposal made by community member @shane attempts to overcome the computational requirements of full block simulation by instead estimating the opportunity cost using a function which estimates the marginal gas price at a given depth in a block. If is correctly configured, this method would provide an accurate and efficient score. Unfortunately, if is miss-configured, it may produce unreliable results, undershooting causes unprofitable blocks and overshooting prevents the inclusion of any bundle. Additional simulation work is required to increase the level of confidence in the reliability of . Please reach out if you are interested in working on this simulation work.
All of these approximately account for the miners' opportunity cost, either via normalizing by total gas used, or by explicitly computing it. Note that some hybrids like option 3 without normalization no longer account for this, and might thus prioritize bundles that are less profitable for the miner.
We've decided to include option 3 in the v0.2 release as it solves the immediate issue of bundle stuffing without impacting risk or performance. We are looking at including option 4 or option 5 in a future release once their limitations are better understood.
Discussion: https://github.com/flashbots/pm/discussions/53
In v0.1, at most a single bundle could be included in a block. In v0.2 we implement bundle merging whereby many bundles can be included in a block. The merging of bundles is done at the MEV-geth level, using the following algorithm and configurable parameters.
Note: bundle merging at the mev-geth level should be considered a temporary feature as it will be obsoleted once a scoring function which solves for 'large bundles' criteria is implemented and enables searchers to do merging themselves.
For each target number of bundles from 1 to , MEV-geth spawns a worker that builds a template block . These blocks are built in parallel, and are later compared with each other and with the vanilla (0 bundles) block for profitability. Each worker runs the following algorithm:
This algorithm introduces two configurable parameters ( and ) which are set by the miner. Miners will be able to experiment with how to set these parameters according to the hardware they are using and their risk tolerance.
The parameter determines the number of bundles the miner will attempt to merge together into a 'Mega Bundle'. Setting would yield blocks with a single bundle (like in v0.1). Increasing the value will increase the miner's revenue, but will also significantly increase the computational load as it requires spinning up a parallel process for each additional bundle depth.
The parameter determines the maximum blockspace which can be used by flashbots bundles. A low value means only few highly profitable bundles will be included, whereas a high value means many lower profitability bundles will have the chance to be merged into a mega bundle. A high value also increases the node's computational requirements and risk of discarding valuable transactions from the tx pool.
As in v0.1, the candidate Flashbots blocks are compared with the vanilla geth block to maximize miner profitability.
Discussion: https://github.com/flashbots/pm/discussions/27
In v0.2, bundles with reverting transactions will no longer be included in blocks, unless explicitly allowed. This change will help avoid unintended transactions from landing on chain leading to less chain bloating.
A new txsAllowingRevert
RPC parameter will be included in eth_sendBundle
, consisting in an array of transaction hashes. Any reverting transaction not included in this array will lead to the rejection of the entire bundle containing it.
Discussion: https://github.com/flashbots/pm/discussions/41
We considered introducing a proxy contract for handling miner payments.
This payment contract aimed to achieve the following objectives:
The proposed contract introduced ~11k gas overhead to all flashbots bundles. While this is a trivial amount compared to the cost savings of using flashbots, the searcher community felt the objectives listed above did not justify such a cost and off-chain methods should be explored to achieve goals 1 and 2.
Based on this feedback, the introduction of a proxy payment contract will be delayed in order to provide more time to explore alternatives.
Improving the security of the chain by smoothing MEV revenue variance / reducing incentive for time-bandit attacks / providing finality protection remains a core objective of flashbots and will be introduced in a future release.
We encourage the community to help us in solving these challenges.
Discussion: https://github.com/flashbots/pm/discussions/45
We considered introducing a new method to mev-geth for accepting 'Mega Bundles'. However, this feature introduced changes to the block formation code which is considered high risk and did not meet the quality standards set by our review process. As such, it is excluded from the v0.2 release.
This mega bundle is pulled from the relay and inserted in a LIFO queue of length 1, a parallel worker pulls the latest mega bundle and produces a full block with the requested header parameters, the block is then inserted in the multi-worker in charge of profit-switching. Since mega-bundles are not scored before producing a full block, this method should only be used by a single relay. Mega bundles will help experiment with new approaches to bundle scoring and bundle merging.
Discussion: https://github.com/flashbots/pm/discussions/52
The use of RPC endpoints on mev-geth is replaced in v0.2 with a WebSocket connection which pulls bundles from the relay instead or receiving them via HTTP, this aims to reduce latency and improve node security by avoiding the need to open the rpc to the public.
Discussion: https://github.com/flashbots/pm/discussions/51
v0.2 introduces a new geth config miner.strictprofitswitch
which forces the mev-geth multi-worker to wait for the vanilla block to be completed before comparing the flashbots block.
This eliminates the race condition where a flashbots block could be mined before the vanilla block is done being calculated.
Discussion: https://github.com/flashbots/pm/discussions/56
With v0.2, we will have testing infrastructure deployed in the Görli and Ropsten testnets. This infrastructure will allow us to thoroughly test the new code before releasing it to miners. The Görli relay will also allow searchers to test against our Flashbots validator, and the Ropsten one will be useful for miners testing MEV-geth against surrogate bundles.
Discussion: https://github.com/flashbots/pm/discussions/37
In order to improve the guarantees of correct operation of the Flashbots system, we will introduce a set of principles and best practices that miners are expected to follow. Violation of the principles might result in miners being excluded from the Flashbots system until corrected.
Flashbots Fair Market Principles (FFMP)
We kindly ask the community to provide feedback on this proposal by joining the discussions in our pm repository.