L8 - Deconstructing Sequencers | by Prabhat | BlocSoc Lecture Series
BlocSoc Lecture Series · 24:34
Prabhat examines centralized sequencing risks, including downtime, censorship and MEV. He distinguishes decentralized from shared sequencers and discusses force inclusion, rotating sequencing rights and staking incentives.
Speakers
Topics
From BlocSoc Lecture Series, published by BlockChain Society IIT Roorkee; community: Blockchain Society IIT Roorkee.
Transcript
uh so hello everyone for this session we will be talking about what sequences are what are their roles in rollups and l2s why are they needed and some variations of sequences being used in the current state of the art and uh what are the proposed sequencer designs for uh better designs I would say for the ethereum and and other lay infrastructures so starting with what sequences are so yeah so what the are sequences
uh uh we we can say that sequencers are some special nodes that are given some special permissions by rollups or l2s and uh what are these special permissions they can like bad bad some trans they can see the mle where the transactions are being held and they can execute these transactions they can change the state of the l2s and they are given the permission to also batch and like post it on a rollup contract or L2 contract which would be on L1 and the transaction ordering and
inclusion of transactions is is also being handled by the sequencers and these are some permissions which the sequences have compared to other nodes and this is what makes them special so this is kind of like how a sequencer works so starting with what these are this this is a transaction mempool where the transactions are which are be sent which are being sent to a rollup or L2 and what what happens is sequencers then Cherry picks some of the transactions from this transaction
mle which it finds favorable uh because of its ability to like select transactions and order the transac transactions and batch them it can collect me which is a major source of income for the sequencer handlers or sequencer operators so after cherry picking the transactions what it does is uh it batches and compresses the transactions and then sends it sends it to a lay when chain where in the lay chain there is a special rule of contract or a layer to contract where the transactions are being sent as a
call data not transactions the entire batch is being is being sent as a call data and uh but uh the use of uh there is a special benefit of using a sequences it can give us a soft commitment before even the transaction is being accepted on layer one uh that is because it has the permission to include transactions and execute it on the lay two not on L1 uh it is can confirm that this transaction will be included in the uh batch that it will create but it may not
be sure of it if it will be executed on the layer one or it will be included in the layer one to so it can't give a hard commitment or like proper commitment uh that it will be included but like it can give a soft commitment because of its special permission that it can uh like uh include the transaction in its patch and whenever the uh batch is submitted on the Lan contract and it is settled on the Lan chain uh the uh confirmation that the set the transaction has been settled is
given to the validators what the validators do is now assert the state change which the sequenc made so what sequencer does this when the uh batch has been confirmed on the lay one change on the lay chain it also does a change on the layer two blockchain so there's a St State change that happens the list of transaction is the accepted transactions that it included in its patch and after the state chain the validators asserts assert the state route on the lay to blockchain and then now the sequencers now now can create like another badge
and then send it to and the process repeats again so it has a security because even the L1 validators that uh are not directly part of it but since it's the batch is being sent to the Le blockchain the L1 validators like can uh validate that transaction so L1 the security of layer one is maintained and also the layer two validators also State rot on uh this layer to so the Securities on L2 is also maintained and for the current scenario of sequencers being used most of them
are centralized seoad sequencers meaning every rollup runs its own special note for its purpose which only serves this chain or its chain uh so this is currently a big red flag because like centralized anything that is Central centralized is in retrospect bad uh not favorable because it has a lot of disadvantages so what issues does it bring so there's a single point of failure because of the centralization there was a case when arbitrum sequencers sequencer was down for 70 minutes and there was nothing nothing
that could happen in that scenario so they brought a change to the design of how the transactions can be included which we I will discuss later so and also there's a risk of M exploitation since the sequencer has the right to like uh order the transaction in any way that it feel feels uh the sequencer can FR or sandwich the transactions that are in the mol currently and can favorably include transactions that it can benefit from so that is a major like point of exploit that the sequencer can
bring so there is also weak sensorship resistance uh sequencer can like block the transaction so it cannot like indefinitely block the transactions some sometime in the future it will have to include the transaction it can't like block it permanently but yeah it can like delay the transaction for a really long time which is uh issue in itself and so weak liess guarant uh likeness guarantee like uh so we know that for the ux of a l2s the benefit that it bring is instant finality right
so uh Whenever I send a transaction on L2 almost instantly it gets confirmed so this livess guarantee is not not here there is no also no Atomic composability and uh no security or pulled security because on like it is the first step that the transaction has to go through and now I can't like extract the L1 L2 security uh which was the point of uh like creating L2 with hyr put high like instant finality but also like having the security of the L
chain uh what benefits does the centralized sequences bring is now centralized sequences like have lot of compute power to the uh like the lot lot of compute power in itself uh brings uh high high throughput uh Advantage so a lot of transaction can go through uh and we don't have to like in a decentralized scenario we have we like there can be an issue where a low throughput or L low computational sequencer gets the right to like sequence the uh transactions but
uh uh so that can slow down the chain so slow down the transaction penalties of all the transaction that go through but like that is a separate issue and we'll like talk about it later so the arbitrum had a way of solving it after the sequencer went down for like 70 minutes in like 2022 so what they brought is like AIT now provides a way to force a transaction on layer one so now like if the sequencer is malicious or like not responding what I can do is I'll force a transaction with the force inclusion
method which arbitrum provides so with this I can directly put my transaction on the layer one chain without it having to uh go through the sequencer so it is a like uh not it not forces the sequence quencer it like bypasses the sequencer to accept the transaction on layer one and the issue with with this is that uh the layer one I'll have to now pay the pce of layer one and like also now there is no instant finality and I'll have to wait for 15 seconds which is the block time for ethereum transaction so that is a like
disadvantage with this so what is the uh what is the solution for this so we have decentralized share sequencers uh in in produ in not in production I guess in production also so espresso has it asria has it radius and M madra stocket has some decentralized sh shared sequences which they have uh currently so yeah first of all when I'm talking about decentralized sequencer and shared sequencer they are not the exact same thing uh they the sequence architecture can be broken down into two
stages so first of all is if it is centralized or decentralized so and the other one is if it is sh SED or shared so what the centralized architecture is like what we disc discussed earlier so every rollup runs runs its own sequence and for its own chain that is a centralized sequencer but a de centralized sequencer would be uh like now there is no single sequences that will be running they can be multiple sequencers and uh I'll discuss the architecture of decentralized sequences later but in like in general way we can
consider it like it's kind of like proof of stake where there is a group and one of them will be like selected for sequencing the for for Epoch of time uh so this is how decentralized sequencer uh like operates the other breakdown or the other stages if it is SED or if the sequencer is shared so s means that the sequencer that is running is only for a specific rollup or specific L2 for like for a pair like for a specific rollups only whereas the shared sequencer is like there are there
are many rollups that have their own sequencer sequencers but they're running in a shared kind of way uh that is what a sh shared sequencer is they are sharing the sequences so it is not like uh Every Chain will have its own sequencer running one of the sequencers from any of the chain can be selected and it will sequence for all the rollups or al2s that will be like giving transactions to its own mol so the sequencer will be like that sequencer will be getting transactions for all the mols of all the rups or L tools and then we'll be batching it and
giving it to the like L1 chain so how are we decentralizing a sequencer so what I discussed it's very simple PS like system where the a group of sequencers will have like will they will stake or they will have bonds they can stake their eats or they can stake they can stake the bonds which they will be having and for any malicious activity uh the stake and bond will be slashed and any reward that they would be getting can be snatched away from them so and there is a constant rotation of sequencing rights so no
no no single point sequencer will be having the right to sequence the data and sequence the transactions that they will be they will be in the mol and this maintains the decentralization aspect of like the sequences and then what is a shared sequencer that is also like sequencer can can be used for multiple rups and not specific once or a particular group set of rups that I discussed earlier so this is a nice diagram I found on Twitter like this uh can give an you can give get an overview from this lups with an independent centralized sequencer so a user is like a user any specific vop is
like sharing the transaction or like giving the transaction on the ROP and and then they roll up the sequences then the sequencers then post the dases on the data availability layer which is like what a normal wave would be and data availability layer can be like AA Celestia and now in a decentralized Shar sequencer for the as like this is the Astera design of the shared sequencer users post the transaction on the the rups own manool but share like the Shar sequencer will be the one that will be
selecting the transactions from all the transaction mols and uh then it will post on every rollup it can give a soft confirmation that this transaction that I have included in this patch will be included and uh it will be given to the data availability layer I'm not sure if this will be ex executed on L one but I have included this so this is a soft confirmation and then Shar sequencer posts it on data availability layer and then from that uh on data avilability layer on each rollups rollup contract the batch will be given and then the rups can like extract the data
uh for the for the uh State update that they want to make on their uh R of design or2 so there are some downsides of shared sequencers and first of all like even with the decentralization and shared sequences there the shared sequences were uh like introduced because since uh even with the decentralized decentralized sequences there was a problem of that the inter there was no interoperability in the like the chains so if I want to like for example let's say if I want to
uh like I'm a Arbitrage Trader and I want to like utilize the liquidity on like say chain B but I have I have all my funds on chain a so what I would have to do currently is Bridge the assets from chain a to ethereum and then from ethereum to chain B and then I can do anything with the liquidity in chain B so that is a big hassle that and a big design flaw that is currently in uh the rule of designs and uh the the use of shared
sequences uh like brings the interop interoperability thing in it but there is also disadvantage ages that it brings so what are the downsides of share sequences by sharing a sequencing with other rollups L2 or a rollup gives up its control or sequencing its L2 to attain interoperability so now we can't run a centralized sequencer for better performance though so the use of centralized sequencer was in fact first of all to provide better ux for the uh consumer but now but it it can also be provided from a decentralized sense but
uh now since uh even with the if I even if I have a decentralized sequencer by sharing the sequencing rights I'm not sure if my my my rollup or my l2's transaction will be prioritized and like even if I am a el2 and I want to like uh be uh sequencing in a shared way I want to provide my customers for the people on my chain with like better user experience and with this uh way of using the central like a shared sequencer it
has now less performance than a then a SEO sequencer and that is a big problem in itself and the l2s now can't collect me which they could collect before so me only goes to the single sequencer that has now for for now the rights and it has given up control of sensorship resistance uh so because there is a chance that the sequencer that got the uh transac that GS the guard the sequencing rights can be a sort of
malicious so it can be like malicious in an way like it is not like letting uh letting any transaction from chain B go through so and only from chain a it is like accepting transactions so it will not be slashed on chain B chain a and but chain B can't can't do anything about it that is a problem or an issue and now we can't modify or upgrade the operator that we have also that is an issue so but so now polygon came up with an idea of this aggregated layer so what
aggregated layer does is uh solve this problem keeping in mind this problem of control sequencing polygon aggregation layer gives the benefit of atomic transaction so Atomic transaction ISS uh when in a shared shared sequencing scenario uh what happens is if I am executing transactions on Two Chains like if I am executing a swap transaction from chain L2 a to l2b uh there can be scenario that the first transaction goes through and the second transaction doesn't so either I'm
getting a free mint from a chain or I'm losing all my assets on another chain if both of these transactions either have to go through in a like in the same block or like want should not be accepted at all but it should happen for both of them so this is the atomic transaction scenario either both of them will be accepted or both of them will be rejected uh and with interoperability without the rollup giving the control of the sequencer so uh interoperability is there and the control of sequencer uh of how I if even if even I want to decentralize centralize
sequencer the control is now given to the chain in itself so this is the design of how poly polygons aggregated layer works so all the sequencers first like generate a batch and then for the these batches they generate a ZK proof of the updated state of the l2s and then they all give it on the polygon's aggregated layer and what now this polygon's aggregated layer does is it generates a single proof single aggregated proof of all the proofs that it got from the sequences for all the rollups and after generating a single
aggregated proof it then then posts it on a ethereum's L1 chain and uh in this way uh all the rups can uh have interop operability the sequencers uh they have the right of sequencers uh what sequences they want to run so ideally it would be like all them all of them would be running decentralized sequencers but they don't have to run a shared sequencer now and and with this uh now interoperability is achieved and their uh sequences uh control they don't have to
now give the sequences control for their rups so this is very beneficial in in its own way and a very like Innovative solution for this yeah and this is all about the lecture for today these are the references that I used you can go through them yeah and this is all about it