L2 sequencing. Where we at? Where we want to be?
ETHCC 6 · July 2023 · 15:39
Terence Tsao surveys centralized, decentralized and shared sequencing services for Layer 2 networks. The speaker examines the complexity introduced by different designs and MEV, and considers possible future directions.
Speakers
Topics
From ETHCC 6, hosted by Ethereum France.
Transcript
thank you [Music] hello hello hey guys I am Terence from option Labs I am a core developer I mostly work on layer one like ethereum layer one I don't spend too much time on there too but here I am talking about their two sequencing I kind of went down this Rabbit Hole over the last few weeks just because I thought sequencing was very interesting and there was just like a
bunch of like Twitter like threads on sequencing blah blah blah so yeah just wanted to share what I have learned over the last few weeks so yeah hopefully it's informative and insightful so agenda right I want to kind of like go over like at the very fundamental at the very base layer like why do we sequence and then like I kind of want to talk about like the second I want to talk about the separation of concern like between sequencing and execution then finally I will dive deeper into sequencing like what does the sequencer do what does the sequencer cannot do what are some design goals for like what we call decentralized sequencing because that seems like a Hot Topic and they want to talk about some landscape and
finally Mev just that's very interesting so why do we sequence right I think like we need to understand that like for layer twos we don't need this sequencing like stuff we can always use layer one right so TX can be ordered from the parent chain you can submit your optitron optimism transaction to layer 1 ethereum and then they can be used right but with sequence because that's gonna be expensive that's not economical so sequencer does something really well which that he Aggregates all the usage transactions of chain compress it batch it and commit it over a single transaction so the wing here is the
compression it minimizes uses cost and then but there's some trade-off right because now you have to batch everything together you have to wait and there's time to finality becomes slightly longer so I think we need to understand at the very least right there is some censorship resistance here because sequencer cannot sense your transaction because you can still submit them onto layer one but then and of course there's like the U ads and the user calls which I would get more into so sequence and execution I have a diagram for the next slide so bear with me right so there is this separation concern you have your layer 2 sequencer then you have your Layer Two proposal or validator right it's important to know that separation of concern is in my mind
it's a future is not a bug and then it's important to know that once the transaction is posted on layer one the parent chain it is final yeah and then why separate because they are separate entity right there is not a circular dependency and then only the proposal develop it requires the sequence so let's quickly look at this diagram this is from like uh this is from an orbit from Doc you have your transactions and then it goes to the sequencer and in the sequencer will emit the soft fit basically the sequence of feed and then so you get self-confirmation there so that is nice because like dabs you can use that you usually can use that users love that you get like 50 milliseconds like
confirmation and then in parallel the sequencer will batch and compress it and then submit it to layer one and then finally on the right side or yeah right side of the picture there's validators which runs the transition function and then compute their two blocks and that's where the execution side happens so on the left side you have sequencing on the right side you have execution so what is sequences main role yes so let's be very clear the sequencer received transactions from the user it emits ordered and timestamp sequence of the user transaction it does to commit either self-commit which is very fast and then it does a hard commit which means it batches it it compresses it it
sends it to the layer one and then therefore once the layer one finalized you know your transaction is finalized right and then proposal finally takes this time to basically submit layer two blocks using the sequence feed so it's important to know that the sequencer can do or cannot do right so there's a lot of there's some that means like like misinformation out there that sequencer cannot change the result of your transactions right so sequencer can only order your transaction that means the sequence can extract moves because they're confirming you blah blah blah but then sequences also cannot censor you forever yeah and the sequence actually in a lot of designs that I've seen sequencer like also doesn't collect
execution fee that's up to the validator to those day which reimburse sequencer after and the sequencer doesn't even decide how much to charge you that's that's based on the layer two chain so protocol only trust sequencer does one thing right and that is just to order transactions that's it so sequencer design goes right so if today you guys were designing sequence so what would you guys like to see right this is some of my opinion what the sequencer should achieve issue achieve likeness if your sequencer goes down your chain does not go down you should have more than one sequencer and then you should minimize the following you should minimize for example the TX latency so meaning that when you submit your transaction the transition should get confirmed as fast as possible just
like using a web 2 app and then you should minimize.c Mev so then there's no front running also it depends of your Meb philosophy of your channel some some chair may decide to auction off the right but something may not but ideally if you don't want to do that then you should avoid from running and of course if you reduce co-location incentive to make it like not a lot of background it happens we have seen that from a lot there to these days there's lots of back running finally we should have censorship resistance so there's a lot of sequencing designs out there right as right now today all the sequences are centralized and then there's lots of thoughts on partial and full centralized design and finally
there's share and Outsource design so I'll go over there one by one so it's important to note that in the Outsource design it just means that your sequencer can be answered to another sequencers for example there's share sequencing there's layer 2 Chain for example like swap from flashpot also like layer one chain so your sequencers can be outsourced to other things here as well so let's break down the problem so when I think of this problem this is probably the most important slide of the whole deck it's just like I like to think I like to bring down the problem into the following right decentralized sequencer is really just a set of computers that Implement some ordering policy through some consensus algorithm so if you really break down a problem like this the problem becomes probably much easier
to solve so let's talk about ordering policy so these are the ordering policy that we have seen um less so we have person first serve which is implemented in most of verity today we have never which is proposed a few years ago which does football auction it options up the right of the of the sequencing of the sequencer row and then this time boost which was proposed earlier this year which allows some back running and then there's two versions of that there's continuous time in this discrete time so first come first serve Why first time for Server right what are the pros and cons it's easy to understand you minimize transaction latency e minimize [Music] um Mev so means that because it's it's first and first serve you trust the
sequencer to now foreign you but then it doesn't resolve um Race by bidding so that sucks because now you have lots of back running happening in the back then there's Mev option so Mev option was proposed a few years ago by car is that anyone can become the sequencer by bidding so essentially if if you want to be a sequencer you beat your right to sequence the Block in at the future time and then the highest and then like in this model right it's important to know that the beat should be as close as the value strategy so say today if you can extract 108 block then you will bid up to 99.999 each because because you can still make profit right there's a few
unknowns that I haven't quite figured out with any of the uh option feel free to add me is that in terms of timing and censorship in terms of just for that efficiency alone that to me that's a question mark and there is time boost so time boost was proposed earlier um this year by option Labs so it basically option of back running so it allows the bidder the users to buy time and then there is like this G boundary meaning that you cannot buy more than like 500 milliseconds of time so that means that if your user your worst time is 500 milliseconds so if you don't want to buy time if you send a transaction you only
have to wait up to 500 milliseconds so that's nice and this result raised by bidding so there's no front running if the sequence is honest and there's the two models of that which I won't get more into but yeah we're under analyzing which one is more efficient so let's do a comparison right so we have this first come first serve Mev auction time boost so first come first serve wins at the latency game of course because it's for example served there's not much to do with it and then and then he reduced towards the Mev but then if you look at it right it's like you always have to trust a sequencer not to reorder because that's not the problem of ordering policy which I would get
more into and then you have time boost which kind of like soft a little bit everything but you have to make a sacrifice on latency because now if we don't want to use time boost you you don't want to buy time you have to wait 500 milliseconds basically and then there's Mev option which which is like if you want to reduce cost to Mev I'm not sure Mev option is the way to go but it also does resolve Risk by bidding and that is nice so uh as as for sequencer consensus policy right there's like how do you um decide like who is a sequencer there is a few consistency algorithm out there you can use data auction you can use random data option you can use economic competition you can use threshold
cryptography so I want to start going over like what does it mean when you add consensus into the order policy right just like I say the order policy I mentioned earlier can be applied to any design and then like as long as the committee reaches consensus by ordering then we are good right so there is a safety assumption and there's this trade-off between latency and size so let's start with the first design right you just decentralized via committee this is like the poor man version everything through social consensus you have a dial and then Dao can vote who is the sequencer and then the older policy is even voted through the protocol and then front run could be slash although can be detected out of band and slash right so then you have
this Reserve sequencer for likeness and this also requires some I mean this is like decentralized but it requires some manual intervention because if someone um if someone goes bad you need to do this manual intervention and it's maybe slow maybe not ideal then you have this um bft so you apply BF consensus on the sequences like this this is another approach yeah and then this this so the only difference is here is just everything's gossip to the PVP Network and then you have very good likeness but it's very slow it is what we know like gossiping through network is not fast so but with that you have this advantage that manual intervention is now required so there's another approach that I'm add
on to the previous one decentralized view committee but any use on threshold encryption decryption so in this approach that is Daedalus anyone can batch posts and then the encryption session goes to all the party and party to work together to trip all the transactions and then the party which is consensus and then this requires autonomic broadcast protocol and then there's still non-trivial latency but it is slightly better than just just the committee itself and let's do some comparison here so I mean this is probably a lot to digest sorry but then like if as you can see right the committee just by itself has faster latency it hits all the goals but then the committee plus the threshold is probably better in terms of censorship
resistance and reduce co-location incentive so last but not least I want to touch base on shared sequencing because that's been pretty hot topic lady right I think sure frequency wins in two area the first area is the share sequencing can achieve very efficient data packing meaning that you have your smaller drops you can essentially um share blob of data spaces and that's quite nice right because for every blob it's about 128 kilobytes in the 4844 world and then smaller roll up by taking a long time to fill the space but you have more ropes you can feel the space faster and then that's where sheer sequence comes in and the share sequencer also does cross domain
value each fraction better than just a single sequencer that's no yeah and that's a no-brainer but then there's a few unknowns that like still wait to be resolved right sphere sequencer does automatic inclusion it doesn't do execution right so then unless your share sequencer runs every stage transition function on every robbed which may not scale and how do you achieve that maybe there's a zero knowledge solution out there but yeah so this space moves really fast so maybe we'll see a solution to that and then and finally how do you distribute the value the economic value back to the individual robot right suppose today you have a cross domain Mev transaction that wrote A B and C or participate together and there is like a hundred if being
extracted then how the like like and like one number of if does Egypt begins again so that is slightly unknownished so I would love to see more research on that so finally my last slide what is next so I I have no doubt the sequencer will be decentralized sooner than you think and then an order policy will be adopted right and then it's also to know that like everything we do here is technical but this is also will become political as well right proposal proposals will go through the double votes and then like there may be multiple proposals and that will the dial itself will eventually decide which um like which like which ordering policy or which consensus to
use basically so yeah maybe there's a multiple winner maybe there's one winner that's something that we will see so that's my last slide so I will be here all day I'm going to the I'm going to the orbitron day after that I have a talk there but I will be back after so yeah thank you guys enjoy enjoy the rest of your ECC [Applause] come on