New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

‘MEV on eth2’ - Alex Obadia (Flashbots)

ETHGlobalSat, Oct 9, 2021, 12:00 AM

Alex from Flashbots gives a detailed rundown on the MEV problem from L2, as well as the current solution space. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​ Email us at: hello@ethglobal.co

Transcript

let's get started um thank you phil for the the great presentation um and um phil kind of talked about permission of systems in general and i'm gonna talk about muv initia and i'm alex part of part of flashballs um all right so a quick recap first of all um about the merge and eth2 in general so in december 2020 the beacon chain was launched and this this it's essentially this this separate chain that runs on the proof of stake and census already where you have validators voting on beacon blocks and these validators submit their eve on an e4 on the smart contract deposit and then become validators and so what's essentially going to happen at the merge is the shift for ethereum from a proof-of-work consensus mechanism to proof-of-stake consensus mechanism and you could compare it to like a mid-air engine change flight engine change um it's not as dangerous as it sounds just because the beacon chain has already been launched and has been amassing more and more validators but this is essentially like a way to that i found useful to think about it so essentially changing the consensus engine of ethereum but so if you've kind of followed that analogy we have this kind of dual dual chain model right so we have this consensus chain that has already been existing the beacon chain and we have the existing ethereum chain so what's going to happen after the merge and when ethereum is now on a proof-of-stake and sense mechanism is the the ethereum blocks as we know them today and so i've called them eth1 blocks are going to be included in the beacon chain as an element of a beacon block alongside consensus objects such as validator attestations exits and deposits of validators and there's a slight difference in proof-of-stake where the validator is known a validator is chosen in advance to propose a particular beacon block and so that's a slight change that we're going to talk about that's important and so if we go through the standard ethereum transaction execution before and after the merge um before the merge a user would send a transaction the transaction is propagated on eth1 p2p layer transaction shows up in an ethon client mempool a client would be a node software that miner would would run for example with with some transaction ordering interface and mining interface an ethernet client would form a block then the block would be added to the ethernet chain should the miner win the the proof of work lottery and then what's not mentioned here is i guess as as other blocks are built on top of that one there's problem with probabilistic finality that's that's reached um after the merge a user would still send a transaction the transaction would still be propagated on the same uh peer peer network layer the transaction would still show up in ethereum climate mempos the eth1 client would still form the blocks the same software that currently uh assembles block uh and ethereum would still do that after the merge and so in e2 the only difference is that the block is now passed to these e2 client as we showed in the previous slide right as a as an element of a beacon block and then the the finality is slightly different it's probabilistic at first and then deterministic um after uh some some amount of time and when uh an amount of of beacon blocks have passed and have been finalized um and so let's let's focus on on this bit first so this is interesting because this doesn't change that much and so i think when people think about these two they think about a radical change in transactions and that type of stuff and uh that's actually not really uh the case and so more than this we see that the same software is used to order ethereum transactions and that's key because um we can kind of first this is kind of first takeaway that ethereum transaction ordering as we know it today still exists it needs to that's important for the extracted mav that we know of so the the value with respect to transaction ordering from example arbitrages and liquidations uh the the game of ordering transactions would still happen very similarly um and by as we know it today i mean the same pdp layer and the same software that orders transactions as i was mentioning and so now that we know this we can kind of reason about hey what if uh validators would run a a transaction ordering software that looks like a flashball mevgef right and so a slightly modified eth1 client that is able to accept tips from from users for transaction priority um and we can use some of the numbers on on of flash bots to uh reason about this and to kind of map out validator rewards and that's something that we present in the previous talk and we're gonna build on a little bit now the previous talk given last week um so we're we're using a pintails model pintel is a great great article on this that i've put the link here and i'll share more um but so thank you pintail and um we're using his his python code and building on it so um the assumptions as i kind of showed in the previous slide is about 0.18 each per block of mvv and that's from flashbots numbers and so that's actual value that we've seen flow and then 52 percent of blocks that have med in them and so not all blocks have med um and then extra limitations around there's no tx fees added which goes back a little bit to justin's uh point around the definition of mev um and other other other things to mention the i guess one key thing is the 0.18 is definitely a lower bound and there's going to be an update to our infrastructure very soon that would change that number so take the numbers that i talk about as more a way to build intuition around this and maybe to start talking about uh the implications of mev rather than exact figures to build on top of um so mapping out the mev enhanced validator yields this is a graph that we showed last week with tomas the orange the orange curve is mev enhanced validator yields the blue curve are normal uh validarial to vary and the blue dot and line here are the the actual number of validators in the system currently which is about a hundred and twenty thousand for four million eve state um and so we see that mev boosts revenue by about seventy point nine percent uh seventeen seventy point nine percent which is pretty significant especially when you compare that to minor revenue uh and the boost of mev to minor revenue which we we found to be somewhere uh between five and seven percent again as justin mentioned in his questions so this is kind of an order of magnitude higher and it's definitely important and um worth keeping in mind um and so more about it rewards means more validators uh because this is more you know it's more attractive and and that means more security you ultimately finish your network so that's great um yay however uh in reality mev is only earned by the block proposer because they're the ones who are paid this tip and they're the ones who have the ultimate power related to transaction ordering and um over a finite time scale there is actually a range of of uh blocks you can hope to propose um and this this is just governed by like a simple binomial distribution and so in in pintails um article again uh he or they show for a hundred thousand validators uh how many blocks can they hope to propose for the unluckiest one percent the median and the luckiest one percent and you can see that there's a wide range of 15 to 39 right and pintail maps that and you can see the the orange and blue curves there are for the unluckiest one percent in lucky it's one percent you can see there's a slight difference between the two but now if you add any v on to that the the two curves that you see here are now collapsed here and the difference is pretty much uh you know you can't see it but this is the the average mev the unluckiest and luckiest and you can see how wide the gap is and that's something to to think about more more deeply in in my opinion because um a second takeaway that maybe we can see from this is that maybe increases the variance of returns between the luckiest and unluckiest validators um and that brings up a lot of questions that we haven't answered yet and this is something that we're thinking about more but does it exert pressure for pulling dynamics to happen right because you want to smooth out that variance of luck uh does it mean that mev is is prohibitive to being a solo validator um or does it exert additional pressure for oligopoly dynamics to form right um where uh people that have a large validator stake will uh have more blocks that they they propose they will get more mvv rewards from that and then they will have more ethan and they can stake more and that kind of cycle um i'll also add that right now we're assuming an even distribution of muv per block that's 0.18 uh in reality mmv is highly uneven uh unevenly distributed and this was this would exacerbate this this effect um so that's the second takeaway uh about a movie on e2 um going back to this this kind of flow of transaction execution the the second the second bit that's interesting to focus on is actually the difference right and so the difference in how the the the block uh the block of ethereum transactions act actually gets passed on to or gets you know uh validated by the consensus or how do validators or the network comes to consensus on it and this is where the the difference is the blog proposal is different in in in either one the blog proposal or today is a minor and he needs to um that would be a validator and in each one the the the minor knows probabilistically if they're going to propose the block or not depending on their hash rate was needs to the validator is selected in advance and there is a single validator selected to propose a block at a particular slot and so that's that's also different but so thinking about what changes uh consensus voting power is now governed by the amount of eth held and because you you stake security deposits of 32 if and the largest eath holders are exchanges and so if you look at the ether one deposit address addresses uh you can see that a large chunk about 17 percent is kraken there's there's binance there's so we here and there are other players coming online as well and this is interesting because these players are regulated under different regulatory regimes they have no other activities than simply staking and they have other services as well where a staking might have synergies with and where mbv might have synergy with all of this and so um this is going to shape the enemy landscape to some extent and what people are willing to do given the jurisdictions they're in and giving the other services they offer and the reputation they have and it's definitely worth keeping in mind as a mental model i will say what what isn't shown here is that for a lot of these large exchanges and players they don't necessarily run validators in-house rather they redirect a lot of staking flow to other pools partly to avoid correlated slashing risk and um partly to to avoid just the huge overhead of running in-house validators uh and so this is not necessarily correct in the sense where it is possible and i would have double checked that kraken for example direct some of their flow to to stake fish or to state us um and so this is this is a little bit uh something to keep in mind the other thing that's interesting is you have new players coming online not only the the large earth holders but also these meta pools or pool aggregators in a way so lighter is an example of that where they offer staking derivatives and particularly liquid liquid eats uh so you don't have to you're not stuck not being able to withdraw your your ifas as being a validator um and the redirects they can flow to to validator pools right and so these are the ones kind of mentioned here um and so you can think of the dynamics of these metapools with these pool allocators similar to these dex aggregators in a way right where when dex aggregators came what they end up doing is bringing the price of similar assets on different decks is in line together and making things more efficient and so if you kind of port that logic to profit sharing of mev and also the media activity that validators validated pools engage in uh i think these these metapools or pool aggregators however you want to call them are going to exert influence there and are going to be able to potentially uh set some some social norms but also influencing in the split in med profit sharing so that's also important so the third takeaway is the identity of block proposal exchange uh changes uh and that's that's definitely important um and worth considering again in your mental model of mev so there's a lot of things we didn't talk about this is a short presentation uh but we've been doing a lot of things on different funds the first one is this is all assuming that layer twos are not like fully adopted but in reality a lot of the transaction ordering is gonna move to layer twos right and and what's gonna be living at the layer one are these kind of like roller batches and frog proofs and so that might change some some of the thinking that was mentioned in the previous slides uh there's also the the cross layer to ordering that that's interesting uh and how that relates to um for example shard aetherium in the role of centric ethereum um and so there's there's been talks of of staggered shard blocks for example and that might introduce a new sense of ordering um between different l2s um there's also new constraints on imev search the fact that what i mentioned before the the block leader selection is known in advance is very interesting and relevant to mev and predictable block times as well fixed block times 12 seconds is also interesting from a from a simulation time and optimization perspective um and also many other things uh ones that i would note notice future protocol level changes in how they affect me the stateless clients changing in finality gadget from from casper to casper ffg to cbc and other things there that are fascinating to explore so as a quick summary of the presentation transaction ordering as we know it today still exists and still happens on e2 and happens with the same software and transactions are propagated on the same prp network layer our early numbers show that any view awards are a bigger deal in proof proof-of-stake ethereum than in proof-of-work ethereum and so the impact that mbv would have will be accentuated um it looks like any of your awards could help make ethereum more secure by incentivizing a higher amount of individuals to be validators at the same time it looks like mev awards co could accelerate dynamics that were explored by phil as well right in the sense where if mev is not extracted or is extracted uh asymmetrically by one party over the never you might create this this instability that is important to think about and there's a change in the actors that hold consensus voting power in particular who the block proposes are there's a lot more research to do and we look forward to collaborating with a lot of a lot of you and a lot of organizations on this this is the the beginning of us thinking about not only eth2 but also how that interacts with layer two and role of centric ethereum so um consider this as like a an introduction to some of our thinking there and definitely an invitation for you to to participate share your opinion and contribute um and that is it um thank you i wonder if we have time for questions i let um maybe justin i let me check the chat actually but thank you thank you for listening um yeah thank you alex i'm not sure if we have time for questions i don't see any questions in the chat all right if we do have questions i have one but it depends on if we have time or not please i would suggest let's go ahead with your question uh let's keep it short and uh while we uh promote uh uh ali uh sorry eli from uh uh starkware to present next before the panel okay great i guess i just want to highlight question five from the very beginning which is um like in as i see it the the migration from the current design of flashbots from if one to eve two poses a potentially significant centralization risk and the reason is that there's this white listing aspect so it's okay to white list pools it's okay to white list whales but you can't white list 10 000 you know enthusiasts mini stakers so could you highlight the centralization risk and um the efforts are being taken to address it so you're you're you're totally right and part of this this uh centralization that you mentioned is related to preventing preventing spam risk and ddos attacks on on miners right uh and what's interesting about eth2 is this this this fact that i mentioned before right that leader election is done in advance it means that you wouldn't necessarily need such a relay anymore and we've been exploring these kind of alternative architectures there uh where you could for example encrypt your ethereum transaction with the the key of the validator that you know is going to propose the beacon block for the for the slot that you're targeting and then you wouldn't you wouldn't have the same issue the issue that you have with proof of work right now is you don't know who's going to mine and so you have to share uh these these bundles with all the miners at once and there's slightly different simulations you have to do with each of them and so all that complexity is something that is unreasonable to ask miners to do and so that's why we've kind of taken on that role but it's definitely something that you write is not um it's not uh something we we i mean it's not necessarily sustainable nor something that we we aspire to keep in the in the in the system so we're actively exploring it we are also participating in uh east global's hackathon rayonism where we're like prototyping quickly on on what what maybe would look like on e2 so it's definitely top top of our mind um and as we've kind of outlined in our values etc right we want to preserve uh ethereum's core values and one of them is obviously the centralization uh so it's something that uh is close to our hearts and it's very important to us to to do fantastic thank you yeah it's very interesting that this this this public knowledge it can be turned into an advantage like traditionally i think of it as a disadvantage yeah and i will i will even go as far as saying that with layer two then we'll hear more about them today uh leader selection is going to be a key criteria to understand how the the mev mechanics to some extent and i think the the exercise for us to think about our mechanics from uh eth1 to eth2 can then we can reproduce that pretty easily to other layer twos and both their their finality uh um mechanics and also their their leader selection mechanics and that might uh uh that might guide us in what muv would look like in these systems um so it's definitely uh interesting um is is ellie here we're still waiting to uh to get him on board uh just uh having some painless debugging but if there's any other questions from the chat or of the comments we can relay that for the next minute or two i'm reading the chat now i don't know justin if there's anything you want to maybe i'm looking at the wrong chat okay i'm i'm i'm looking at the zoom chat um i i need to open the east global one too yeah looking at the zoom chat i'm not seeing any questions there oh vasily knowing sloths in advance opens up realistic possibilities for multi-block mev um i agree but i also so maybe justin you could talk about single uh secret single leader election and uh i i understand that's like a future improvement but then that would they would limit knowing the slots to i mean you wouldn't have a public list of uh who is going to be the validator for a particular slot i'm also curious about maybe proof of custody and how that interacts with this and key delegation in general wherever pools would have a lot of uh power over for example they would have several contiguous slots or this type of thing and how realistic is that yeah so i actually don't think the secret leader election changes too much on the muv front and the reason is that even though the general public doesn't know who will be the validators um there's still two things one is that you can still potentially encrypt to kind of this unknown uh public key you know it's an interesting cryptography problem to think about um and then the other thing is you as a as a validator or as a pool you still know where you are positioned right even though if the world doesn't you still know and so you'll still know if you have two contiguous slots and yeah i think this is a kind of a worrying potentially worrying centralization risk right because um the probability that you have two or three or whatever contiguous slots gonna be you know a function of of how large you are and so that will incentivize larger pools um yeah interesting i'm curious to i've been i've been writing a little post and i've been trying to uh compute the number for the probability of having two contiguous slots uh i'm not done yet but i'd love for you to check it out right i mean actually um we did quite a bit of research on these contiguous slots idea and the reason is that it affects randall right so in randall you're meant to reveal or not reveal a secret and if you have several contiguous slots at the end of a network then you get to manipulate the randomness so quite a bit of analysis was done and i think italic wrote some uh some if research posts uh that are possibly relevant to calculate probabilities there got it thank you i mean what's what's not clear to me is if you you you're a validator and uh by the way if eli is here please i'm just talking until until he's here what's what's not clear to me is how like the actual mechanics work if i'm like a validator and i uh you know submit my stake to a validator pool how much power do they have over like do they have full control of my of my key uh is is there something there that uh there's like an anti-centralization measure that's baked into the protocol right now or that you guys are thinking about so i was told about proof of custody for example and i'm not sure how that interacts with all of this if at all well as it stands today most pools are fully custodial so for example coinbase you know they just hold your ether and they'll do everything on your behalf um and in terms of incentives for um you know for not having this centralization risk the one of the main ones that we have is basically penalizing correlated failures so um if we have let's say thirty percent of the network or you know fifty percent of the network that goes offline then you know that's more heavily penalized than just one percent going going offline for an extended period of time another thing is if you have you know one validator who gets slashed that one validator will only lose a small amount of of if but if you have 30 of the network that that did something like a slashable offense uh then the the penalties will be very large so that's something that maybe the general public doesn't realize because it hasn't happened yet but my prediction is that at some point in the future one of the exchanges are going to mess up and it's going to be extremely costly and there's going to be a great lesson uh in terms of diversification because you don't want to put all the validators in the same place anecdotally i've been talking to people who might have been looking at this for the exchanges front and it seems they're very aware of this correlated slashing risk and are also diversifying their infrastructure so they don't have this but what i'm what i'm what i've been thinking about is that um infrastructure decentralization is not the same as as power decentralization right even though they decentralize the infrastructure if if they still have some say over the ordering of blocks for example or they have control over the e4 clients that are used to uh for for you know to include the effort and that beacon block then even though the infrastructure is decentralized and they might not suffer from a very harsh correlated slashing risk they might still have power over uh uh that everything and so i don't know if the infrastructure decentralization is a strong implication of power decentralization and in terms of consensus voting power right um and what one thing that comes to mind in this whole pool situation is one of the attacks i'm actually one of the ones i'm most worried about is is basically a an inside job by the pools so you know we've made a lot of effort in the eve to design to separate the online staking key from the um offline um kind of withdrawal key and my guess is that the the exchanges have extremely good cold storage infrastructure and the withdrawal key almost certainly won't get compromised even by some sort of internal employee like a rogue says sys admin and so there's this kind of uh feeling of security where you know because this is this admins can't access this withdrawal key that can't really steal funds but actually that's a false sense of security and the reason is that there's a ransom attack that you can use if you have access to the signing fees and the reason is that you can um you can trustlessly um hold your validators at ransom uh by uh threatening to to to post um via slashing um exactly and so if you if you're coinbase and you have 30 of the validators let's say um then that's effectively maximal slashing you'll lose 100 of your stake and so you're the the power that you have uh to perform this attack uh will will depend on on how large your your pool is so if you want to mitigate yourself against these rogue sysadmins attacks go to a small pool interesting thank you

Automatic transcript — names and jargon may be misspelled.