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

Loading player…

MEVeconomics in L2 - A Closer Look at the Sequencer's Role and MEV - Patrick McCorry

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Patrick McCorry from Infura for a talk titled "MEVeconomics in L2 - A Closer Look at the Sequencer's Role and MEV". We will be celebrating and highlighting the economics of MEV⎯ join us for our MEVconomic.wtf summit! By bringing together thought leaders and contributors from various fields of research and development, we will explore the most recent advancements in the sphere. You will gain an understanding of macro patterns in MEV and how distribution processes interact, for example, mechanisms of the L1 and L2s, data availability layer, restaking and liquid staking protocols. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Applause] [Music] coming on um and he's going to be talking about a closer look at the sequencer's role in mbb so I'm just trying to all mute myself I was enjoying that by the way I was happy to be the lady that was great uh okay I'll just get started then so today what I'm going to talk about is layers and layers of layers you know hopefully take an inspiration from layer one on a plan of the layer two and what we're mostly going to look at is the sequencer and how we have we can think about Mev around the sequence suppose we know you know it's just a bit of background in Mev land there's typically three agents that we care about one is the honest user all the honest user wants to do is Ban sell their boom cap we have a proposer on the proposer's job is to take a list of pending transactions and decide the final ordering of those transactions and third we have the searcher you know those Mev Bots those people living in their bedrooms for their look of these Mev opportunities they bundle it up and they pay the proposer to include this bundle in the list of transactions in the order that's a travel actions so that's Mev land in a nutshell so let's begin with ethereum in that and let's look at the life cycle of a transaction and let's see what we can extract from this scenario so we have a user Alice again who wants to ban so mooncats and we have the proposers so the question is how does the user get their transaction I communicated to the proposer so we have to consider the communication Channel by default we will use a gossip protocol or the peer-to-peer Network you know olives will send a transaction to appear they'll take the transaction and pass it onto their peers and eventually within one to two seconds every appear in the network will get a copy of this transaction including the proposer they'll take this transaction and hopefully include it in their block now the issue is that as a peer-to-peer Network so anyone could be on it including a Searcher so they could listen out for the user's transaction inspect it find an up you know Mev opportunity and then front run the user and steal the profit so it's a bit like a dark forest in a way and there could be you not just one Searcher for many Searchers that are all competing for exactly the same you know me the opportunity the same problem and this leads to something called priority gas auctions which I'm sure people spoke about already where the Searchers would bid each other up you know transaction fee one two three four five six and is up to the proposer to pick the transaction of the largest fee that pays them the most money and decide who wins the auction now I stole this from a blog post by togla soda.e I probably you know didn't butcher that name a little bit but you can see here in the in the graph within a 10 second period there's basically like hundreds of transactions being sent then eventually Mr Blue wins and he wins the option and gets uh gets the mov opportunity now there's two problems of this approach one is wasteful of gas you have one transaction that's successful followed by a list of failed transactions and that's the waste of block space and two it's unrestricted Mev you know you're taking the user's transaction throwing it to the wolves I'm just hoping it gets to the other side okay because it's completely unrestricted what these Bots can do so a few years ago like wonderful company called flashbot you know I wondered who they are uh they came along and tried to solve the problem for a theory give the transaction directly to the flashbots and they'll give it directly on to the block purpose send the mvv Bots or the Searchers they can't find the opportunity and they can't you know extract value from the user's transaction so stepping back a bit you know what can we extract from this scenario well we have to consider the proposers ordering policy and this key is they're picking the transactions based on the feet highest fee first Louis V at the bottom and then around 12 seconds to do this you know as we saw with the priority gas auction what we need to consider as well is the communication Sean how does the block proposal learn about the transaction and how did the Searchers find it as well um finally you know sometimes we forget about the poor little user but we have to think about the user experience so how long does it take for a user to be informed that their transaction is confirmed on how it was executed because at the end of the day they want to execute and you know participate on this network so at the theorem you know ethereum you're not in a nutshell we took some cool ideas from so now let's move on to Layer Two and roll up left and in rule of land there's typically three actors The Honest user the sequencer and the executor now for once we're not going to talk about the executor they have very little to do of Mev we care about the sequencer who's basically the proposer I guess to decide those listed transactions and they're ordering they have everything to do of mnb and the the life cycle is pretty similar Alice gives their transaction to the sequencer the sequencer will have a list of pending transactions they'll run some ordering policy they'll decide The Ordering of the transactions then they'll post that onto ethereum into an inbox and then pick out by the page now in this scenario we have this direct communication Channel there's no gossip protocol all is can communicate directly with the sequencer and what we need to be concerned about is you know when does the out when does Alice get a response from the sequencer on what type of response do they get and that's really going to depend on how the sequencer decides the order of these transactions then of course what we care about is the sequences ordering policy you know they can keep the transactions private for you know as long as they want decide the ordering and then eventually make that public once they be at their decision so what ordering policies could the sequencer Implement so we're going to go through three the first is has extraction first the second is has fee first and the third is first come first serve so let's just Dive Right In and see what we come up with has extraction first um basically when you talk about sequenced surgeon Mev a layer two this is the first ordering policy that everyone talks about you know and the reason is the sequencer has ample time to extract the volume they could weigh it you know a minute or hours before they have to publish that transaction of it so a practice of arbitrary and optimism they typically probably see transactions in about 20 or 30 seconds but according to the smart contracts you know arbitrim can build it up to something like 24 hours on the optimism I couldn't actually find the value someone could probably drop in the chat but I'm pretty sure it's like 24 hours they could keep these transactions private forward so if you can hold a transaction you know handy transactions for three hours let's say well you know you have to you have this big basket of transactions you have your Mev extraction algorithm you run it on the batch then you can order your transactions according to you know the ones that you can extract them who swallow now in terms of user experience there is a benefit to this we can have a robin bird style experience the user could transact for free because later on their transactions use the compute some Med reward so from the user's perspective is a free transaction but they really pay for it through MPV now the issue with this approach is really a long delay if we allow the sequencer to extract value for two to three hours well that sucks for the user you know think of Bitcoin you have to wait 10 20 minutes and Bitcoin and everybody gets that it's a terrible user experience so imagine waiting two hours just so someone can go extract value from your transaction now it's not a great user experience now you could solve this problem you know a lot of people think okay sequencers can extract Mev let's solve this and stop that from helping so they can Implement some Fair ordering protocol maybe the sequencer can't see the transaction content maybe you introduce a consensus protocol what does fairy mean in this context I don't really care it's not important for this talk I think turin's going to talk about a leaner it's going to be pretty spicy but for now I'm going to argue differently I'm going to argue we don't need to solve the problem because if you look at prevosting ethereum today you have this open market of Searchers You Know PBS and you have the stickers who are basically competing a lottery you know the Searchers do all the hard work they extract the Mev they pay a bribe to the proposer the proposer gets a transaction fee then they include the bundle and so there's a very good chance that a sequencer can make more money by having an open market of Searchers do the hard work as opposed to trying to extract the med themselves now that's the key defense Financial incentive is not to extract the value but allows someone else to do it so we don't have to worry about the fair ordering problem for now and I've asked the key is well that means the sequencers ordering policy is the order of transactions by transaction fee here repairs the ads fee will get ordered first in the list and so you know this is basically payment for order flow maybe some nav people hit me for saying that but it's basically that anyway you know the sequencer will get the list of pending transactions and give it to the Searchers The Searchers can Crunch and crunch and crunch extract is they want and then eventually send a bundle to the sequencer by the pay and they'll say sequence serve you include my bundle you'll make this amount of money then the sequencer takes that ball mill they take the payment and of course they order it according to according to the payments they receive fire emotes similar to what happens on ethereum today you know you're sharing the Mev between the sequencer and the Searchers on a game user experience stuff very different to the previous Keys you know users could still have free transactions you know because the the transaction fee is actually the nav that's extracted but again this could have a long delay users still want to win and at least I don't want to build a layer to where users are waiting for two to three hours for their transaction to be confirmed so this is why amongst rule Ops Implement first come first serve because they want to prioritize user experience what do I mean by this well the user will send their transaction to the sequencer the sequencer will time stomp this and then simply order the transactions according to the timestamp and this has a wonderful user experience it's a bit like transacting on coinbase you know you send your transaction to the service provider and they return back in response to say it's confirmed this is how it's executed you know under a second typically when people talk about first come first serve they say oh well there's no Mev here you know hiding under the covers well well of course there's Mev there's Mev everywhere uh you'll never get rid of muv um so anyway how do we have Mev so what happens in practice at least with arbitrim and I assume is to see him for optimism when a user gives her transaction to the sequencer the sequencer will create a little block within 250 milliseconds and then publish that off at a feet now the reason how the sequencer feed is because external service providers a heater scan coinbius or a fura they could pick up the block and present it to the user so user could send the transaction to the sequencer then look at ether scan and say oh my transactions are confirmed according to etherscot now what happens when you have a dealer feed that's released in data about transactions in real time Searchers connect to it they listen for the transaction if there's an Mev opportunity they'll back run it and send it immediately to the to the sequencer on this leads to the rise of latency games because you don't end up with one Searcher you end up with 150 000 web socket connections because Uber gets the data first here against that transaction data first is the one who wins the nav opportunity and can background the user and you know this is in theory this happened the arbitrim and I guess it's probably still happening I don't know you know they have this post where they had a hundred thousand to 150 000 connection because the Mev Bots are competing on a latency game to extract Med on these background transactions the short-term solution proposed was to implement House cost so you create 50 dedicated connections The Searchers do you prefer work your arrest the Lewis stunts wins one of those connections and so then you know the Searchers game is to have do proof of work as opposed to creating the thousands and thousands of web connection or websocket connections now that is a solution but I think there's a more interesting solution that comes out of this and sort of motivated by Ed Felton's proposal which we'll talk about in a second what I didn't combine first come first serve with the haspy first what do they mean by this so basically similar to before user gives or transaction to the sequencer the sequencer May collect one or two transactions and then pass it onto the Searchers The Searchers will take this small bundle extract response as they can participate in an auction and then submit their bundle with a payment to the sequencer the sequencer will take whatever bundle pass the most money and then confirm that now the point here is that this bundle auction is configurable the auction menu could be really short it could be 500 milliseconds 2 milliseconds five five seconds whatever in a really short period of time and the sequencer can constrain the Mev the sequencer can say oh I'll only let you front run transactions or background transactions or sandwich transactions are all of the above so what's cool about this is one if you have these short rapid auctions then we got a fast confirmation for users transactions you know I submit my transaction within three seconds I'm told that it's confirmed I may have got front runner background runs sure but my transaction was confirmed two you have this open market for Searchers admittedly as smaller bundles that they're working with so you are constraining you know what extraction they can do but again you still have the supermarket where they can probably find the best extraction finally it's configurable you know the sequencer can decide what moves allowed as opposed to having this crazy Dark Forest that's pretty unconstrained now this is sort of the idea coming out I don't want to say sort is basically the idea coming out of Ed Felton's post about time boost here I basically described it as how many Q you can immediately front-run her background or of course somewhere in this proposal you could convince the sequencer you know with a payment to say well here's a transaction ordered 500 milliseconds in the past and then you could you know depending on the timestamps of the transactions you go front runner backwards so you're paying for time as opposed to possession in the key but my main point is this is a really cool research question a really cool open problem and it's sure to get the best of both worlds fast confirmations will still have in this open market for Searchers and that's my last slide I guess but I just want to present this idea because I've been thinking about it a lot so I think it's a really cool idea so yeah GG or GM I guess GM

Automatic transcript — names and jargon may be misspelled.