flashbots / mev-research

Project management for MEV Research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MEV in ETH2

obadiaa opened this issue · comments

Starting this issue to get a conversation going on MEV in an Eth2 world.

Afaik in Eth2 a set of validators is chosen by epoch using some unbiasable source of randomness, where a validator is defined as a holder of a 32 ETH stake. Each validator has the right, not the obligation, to produce a block for their pre-assigned slot. There are about 32 slots per epoch, so ~12s periods where each validator can propose a block. The epoch can be thought of as a meta-block, where finality is only achieved after each epoch has passed (is that true?).

I'm wondering how does block production work in this world. If I'm in slot 25 and I formed a great block but then some of the txs I picked up have already been proposed by slot 31, I need to dynamically adjust the content of the block I propose based on the block proposals that went before me?

  • Is the 6-min epoch a vector of attack where 6mins in advance, everyone knows who will mine which slot and can reach out to them in some way for some bribez?
  • Putting my Flashbots hat on, what do miner tips look like in this world?
  • How does tx replacement work in such a system? If your tx got picked up in slot 20, finality is not achieved yet until next epoch and you want to replace your tx?
  • How does tx replacement interact with the fork choice rule? (h/t @lsankar4033)

While validators are chosen from an ideally unbiasable source of randomness, if someone controls a bunch of 32 ETH stakes they are more likely to have one of their stakes selected as a validator akin to how hashrate works (the randomness of solving PoW is replaced by another source of randomness I guess).

  • Say I am a large validator and I get multiple slots per epoch, what kind of surface for MEV extraction does that imply?

thanks for starting this conversation!

going to leave a more thorough response soon, but a few small nits in the meanwhile:

  • an epoch is 384 secs = 32 slots
  • all of the proposal duties are known for the current epoch and the next epoch (not just the current epoch). in other words, the random seed generated at the end of an epoch determines all block proposers for the next 2 epochs. This is governed by the MIN_SEED_LOOKAHEAD param in the spec (really MIN_SEED_LOOKAHEAD + 1)
  • each slot has a single validator assigned to it to propose a block
  • epochs define the boundaries at which finality is determined
  • Is the 6-min epoch a vector of attack where 6mins in advance, everyone knows who will mine which slot and can reach out to them in some way for some bribez?

yes, reach out based on their bls pubkey. also, it's minimum 6 mins because the random seed derived at the end of epoch N determines all proposer duties for {N+1, N+2}.

  • Putting my Flashbots hat on, what do miner tips look like in this world?
  • How does tx replacement work in such a system? If your tx got picked up in slot #20, finality is not achieved yet until next epoch and you want to replace your tx?
  • How does tx replacement interact with the fork choice rule? (h/t @lsankar4033)

These questions are all related so I'm lumping them together. The big question is: "how can the tip associated with a single tx change the weight of a chain fork relative to the fork-choice rule?" And I think the answer is that it should be able to in the same way as in PoW; if the replace-by-fee tx is constructed s.t. validation rules make it impossible to exist in the same history as the previously submitted tx (i.e. b/c same 'nonce'), then a large enough fee to the block proposer should cause a fork. It might be design space someone already explored, but now I'm wondering if there's a way to also incent eth2 attesters here to more intensively affect the fork-choice rule.

  • Say I am a large validator and I get multiple slots per epoch, what kind of surface for MEV extraction does that imply?

This is an interesting question. As I understand MEV, the surface for extraction only compounds (or at least grows superlinearly) with contiguous lengths of biasable blockspace. The rewards are much smaller for fragmented pieces. And the likelihood of getting a long contiguous chunk of slots in which a single entity is the proposer seems quite low...?

It's a pretty easy-to-state probability problem that I'm sure someone here can give a closed form for: given M% of random slots, what's the probability of getting a contiguous chunk of length k?

https://github.com/flashbots/eth2-research work was done here on this topic :) closing!