The Sequencer of Tomorrow
ETHCC 7 · 10 Jul 2024 · 16:52
Jan Gorzny, co-founder and technical lead at Zircuit, gives a tour of what the rollup sequencer does and how its role is changing. After a short rollup refresher covering ordering, soft commitments and posting to L1, he explains shared sequencers, based sequencing where the L1 provides the ordering, and decentralized sequencers with their liveness benefits and performance trade-offs. He also describes Zircuit's idea of sequencer-level security, quarantining risky transactions in the mempool, and argues sequencers should not be neglected while zero-knowledge parts get the research attention.
Speakers
Topics
From ETHCC 7, hosted by Ethereum France.
Transcript
Oh, just a second. Sorry. That's good. That's it. Thank you. All right, so I guess I can just get started. Hello, everyone. My name is Jan Gorsny. I'm uh co-founder and technical lead and researcher at Zirkit. And Zirk. Zirkit's a layer two that's uh in testnet right now, and it's going to mainnet soon. And um I'm here giving this talk uh after Vitalic, so I guess that's a hard talk to follow. But I think um, you know, it might not be as sort of innovative or controversial. But uh the idea of the talk is basically to get people caught up on something that you probably think you know, uh, and I thought I knew for a long time, and then sort of things changed. Um that thing is the sequencer of a rollup.
So you just heard Vitalik talk at least a little bit about roll-ups. Um roll-ups are obviously pretty hot right now. There's a lot of them being built, a lot being developed. Uh as part of that um development process, you know, they need to build a sequencer. And a sequencer is a very critical component, but as time's gone on, what the sequencer does, what it could do has changed, and we're gonna talk about that. So that's exactly what this talk's about. So over time, the last you know, three years, we've seen roll-ups come from you know a nice dream following things like plasma to actual reality. Um we're seeing roll-ups being used every day by people.
There's a lot of people out there pioneering good work with open source frameworks and building roll-ups that are functional and mostly feature complete. Obviously, we still have a lot of ways to go. There's gonna be new roll-ups with cool stuff, there's features missing from existing roll-ups. There's probably a whole bunch of UX concerns, and there's always a drive to make them even cheaper. But as they get popular, um, they evolve and they've become so popular that some some of them have evolved in different ways. They've taken sort of steps off the beaten path, or they've tried different things, Zirkit included. And I think that's really cool and really exciting.
Because when you start doing that, I think we can start talking about roll-ups that aren't just EVM compatible or you know, something pretty standard and and hard to differentiate, but actually things that do stuff interestingly and and take bold changes. A lot of those changes will come from the sequencer. Not all of them. I'm sure the proof systems on some of the ZK rollups will matter quite a bit. The optimistic rollups will certainly need to have good front fraud proofs or fault proofs or whatever we're calling them these days. But this talk we're gonna talk about the sequencer. So the goal for this talk is after 20 minutes, you at least have a rough idea of what all the sort of keywords are around sequencing on a roll-up that have been popular over the last two years. Um of them are in practice, so some of them are being used and deployed, others are up and coming, others still are just ideas.
So we'll talk about what a sequencer is, and then I'll give you some examples of some very particular keywords that are sort of popular or out there right now, and then we'll talk about a little bit of ideas for where they could go next, and we'll wrap it up. Hopefully we have time for that. So if you've been lost so far on what a rollup is, I have to give you the obligatory this is what a roll-up is so that you're not lost, and this is it. Um roll-ups are essentially a layer two solution. So they take transactions on something that looks like a layer one blockchain, but they take it off the chain, they put it into a different area, they call this a layer two, they separate the execution of these transactions from things like consensus in some ways that that may or may not make a lot of sense.
Um they do this by by ordering these transactions. So, as an L2, you collect transactions from people. You have a component called a sequencer, produce a sequence of the transactions so that you can execute them in that order. Um the result is blocks that look a lot like layer one blocks. Usually, not always, you can do other things. It's a different network, you can do whatever you want. But usually it's pretty close to Ethereum, especially in this ecosystem. So they look like blocks. The sequencer will then do two things with the blocks. First, it'll uh generally give a soft commitment to the L1 chain saying this is the order of transactions, and the transactions you know themselves, then I'm gonna execute the next couple of blocks. Um I'm gonna post them on L1 so everyone can verify that actually I'm gonna do this and everything's gonna work and we can be sort of on the same page.
And then with those blocks in hand, um their state updates to the L2 blockchain. So the tip of the chain has some state recorded, and uh it gives it to a system that we call a state proposer. And and various roll-ups and projects have different names for these components, but essentially something that writes the output that says this is the final current state, the current final state rather, of the L2. Give me one second here. So once that hits the chain and it's considered final for whatever finality mechanism you have, you can then do things like withdraw from the roll-up. Depositing is pretty easy.
You just send a message to the smart contracts for the roll-up, move some money around, that's fine. On the other end, withdrawing, you need things to be final so that people like the sequencer or the executor or the roll-up operator in general, or someone else didn't somehow try to cheat you out of that system. So you're probably familiar with the two biggest um finality mechanisms, zero knowledge proofs, which say, yeah, we executed this faithfully, and here's a proof that we did that. Couldn't have cheated, everything went well. Or optimistic ones where we say, this is what we think we got. If you you know don't find any issues with this over the next couple of days, we're gonna take it as final. Um but today we're gonna talk just about that first part, that sequencer bit.
So none of the finality where a lot of the zero knowledge magic happens, or um the withdrawal delays or anything like that. Just what can the sequencer do and what should it do, or what do you want it to do? And what could it? Yes, lots of questions. So the sequencer, as I said, takes the transactions of the L2 mempool, it orders it, produces a sequence. What a surprise. Uh, that's the name. And these transactions can come from the L1 if it's a deposit transaction. So if I'm putting um ETH, for example, onto the layer two, it's a deposit transaction, but this term has become overloaded to say any transaction that originates on L1. So it could be an L2 smart contract call that starts on L1 in some systems.
It's possible. It could also be from other roll-up nodes, or you know, your meta math's connected to an L2. That's also an option. So those are the two major things it does. And then are two major sources of inputs for it. Then the two things it does is it gives a soft commitment. This is an arrow down to the L1 saying I'm gonna process these transactions in the next couple of minutes or hours or whatever the time frame is, usually seconds. Uh, and then it produces blocks. And the L2 blocks sort of look and feel like L1 blocks, usually, as I've said, and you can do things with them. So you've seen your smart contracts get updated, you see your L2 transactions.
I've changed changed money maybe on my L2. All of that comes. So it seems pretty simple in principle. And it seems like it's not doing a whole lot. It seems sort of obvious. But actually, there's a lot of things it can do and a lot of things it should do or might want to do. And so we'll talk about some of those unique features. First, um, you can have things called shared sequencers. So if you're on the super chain or you've heard about the super chain, this is sort of what they're doing. You can take a sequencer and actually have the same sequencer talk to multiple chains. So multiple layer two chains can be sequenced with the same piece of code, and that's really kind of cool. Um, there's a lot of benefits to that.
Uh one thing is on those two layered, on those layer two networks of which there might be more than two, at least two if it's shared, uh, you can get some really nice um cross-chain sort of composability or interoperability because the same sequencer can decide if a transaction is gonna go through because it knows the state of both of those blockchains very, very quickly. So you can get very fast and very atomic transactions across these networks, which is really, really cool. Um you also have reasonably good liveness guarantees, so the system's always gonna be on because uh you know, two chains depend on it, and there's good incentives to engineer it in this way. I won't talk too much about that.
And what's really nice is you get shared infrastructure. So from an engineering point of view, from a practical point of view, if you want to have your own network, but you don't want to operate, you know, all parts of it, you can join a shared sequencing network, and now you don't have to build this component, so you have a little bit of a nice thing to maintain because a lot of people will be contributing. So the shared infrastructure is really nice. You can implement standards once and you know have it affect multiple chains. That's really cool. Some downsides might be a lack of um MEV. If you're a roll-up operator, maybe you want to extract that. Maybe it's harder because if you're only one of the chains on on that shared sequencer, you don't necessarily have all of the say, you can't get all those funds.
Maybe you can, but you know, it's a little bit more difficult. The downside of shared infrastructure is if you are a blockchain on a shared sequencing network and you want to sequence things now uh differently, maybe you can't, because again, you have to talk to everyone. But still pretty cool, it's got some benefits. Uh so kudos to network's trying this. Other things you can do, which are kind of related, um, you can change who gives you the ordering of this network. So you see a sequencer and you say it produces an ordering. Generally, it does that according to some algorithm inside of its component, and I haven't I won't actually talk too much about that. Usually it's highest priority fees, just like on Ethereum itself.
And that's pretty helpful, it's pretty useful, it's pretty familiar. But maybe you don't want to do that. Maybe you want someone else to come up with an ordering. And one person that can do that, or one actor, uh, is the layer one itself. So somehow on the layer one, you can have a system that generates orders, and um you can use that so that everyone else can sort of see where the ordering in the sequencer came from, and that's kind of cool. This is really, really nice because you have really strong liveness guarantees because essentially you always have an ordering as long as the L1 is up, and we're all here assuming L1's gonna be up all the time because if it goes down, I'll just run a node or something like this. This is also potentially you know reasonably good for cost and alignment with the ecosystem.
Certainly the alignment's easy to see because you you know are using the entire ecosystem, the L1 itself, right? You're not sort of deviating from that. Uh and you can do things like sovereignty where you settle on other chains. You can use um one network to give you an order, another network to actually settle the transactions. Um you could possibly do that with other systems, but this is one of the benefits of based sequencing. Sorry. The downside is here, depending on how that's implemented. MEV is really hard to extract because if you're using sort of an L1 system that populates some seed to use for ordering, uh well, in advance, it's probably not going to be able to predict complex um you know interactions where you could profit off of it. Maybe that's not a bad thing, maybe you do care about this, but again, you also have uh constrained sequencing.
So there's a lot of work going on this. Some people are trying this. This is also a really nice replacement for things like um failures of the sequencer because if your sequencer goes down, someone on the L1 is paying attention or could be paying attention and could take up that role really easily. But in addition to things like that, we can do more. Um in many cases sequencers are centralized roles when they're not based and when they're not shared, uh, well, when they are shared sometimes too, but when they're not decentralized, which I haven't talked about, um, or when they are, you can do more. Uh the sequencers can do uh things that aren't just providing orders, they can actually start to look at the transactions inside of that um block or thing that they're building, the blockchain itself. And you can you know really explore around with that and do some interesting design spaces.
In fact, this is one of the things we're doing at Circuit. At Zircuit, one of the things we're really interested in is trying to make the uh L2 ecosystem that we're building a lot safer than the one on Ethereum or somewhere else. And we're gonna try to do that by reducing or removing all of the um types of hacks that can occur on our network. That's a really big, big ask, but we're gonna try it through this concept called sequencer level security, where we'll have an Oracle in the computer science sense, not the price oracle sense, uh, that looks at transactions as they hit the L2 mempool. And if it looks like it's gonna do more harm than good, we're gonna put it into quarantine until someone can say actually it's pretty good, or some other conditions possibly exist. And this means everyone on the network gets some level of security for free that they wouldn't have got by using another chain.
Um so this is really kind of cool. Um for now, this does require a little bit of centralization until we do some advanced engineering, but it's not prohibitive. But the point is you can do more with sequencers than just determining you know where the ordering comes from or where you're posting data. Um if you want to hear more about this, we've given other talks on this, and I think some of my colleagues are giving talks on this particular topic in the next couple of days or at this conference. So we have that awkward. Okay, so we're almost through the through the list, probably a little early, but that's fine.
Uh one other thing you can do that's possibly aligned with things like base sequencing, but not strictly so uh is to decentralize the sequencer. So um Web3 is obviously all about um decentralization, and we would love to do that for a bunch of reasons, one of which is strong liveness guarantees. One of the big problems with centralized sequencers is if they go offline, who's gonna produce the blocks of the L2 network? Um obviously, this is not something that's ideal, and you have to either deal with this with things like um escape patches, which are complicated or annoying to implement, or you have to allow anyone to um implement or pick up the role of sequencing. So this might be a base sequencer.
Base sequencers probably can do this very well. But it might be another way, right? Just because you have multiple users producing orders or potentially multiple users producing orders for it, doesn't mean that order is coming from the L1 itself. There are going to be some challenges to make sure you probably don't produce conflicting blocks or things like this. So some level of consensus is going to be important. But people are working on this and it's getting a lot of traction, and I think it's going to be really exciting to see how this works. This is not mutually incompatible with all the other things, but for now, it seems like it's gonna come at the cost of some of the quick performance and the quick uh or the low costs for using these networks. So while I'm excited to do this, I don't think we should uh necessarily lose track of the current benefits of roll-ups that they are cheap and fast.
So almost done. All of that are the buzzwords you probably heard. Um but there's a whole lot more we could do. I think this is where the research gets really, really interesting because what I want to see is sequencers not fall into sort of the background and and you know not be a useful feature. I think every part of the Ethereum ecosystem is being scrutinized and improved all the time. Um, you know, whether that's changing the hash function to make it more quantum resistant, as Vitalik was sort of just mentioning, or you know, adding new features entirely. I think sequencers should be no exception.
I think we're really excited to see what else you could do. Some things I'd like to really see that are maybe low hanging fruit, and I bet some teams are working on them either in public or in private, uh are things like MEV strategies, right? So if you do have the centralized role, maybe you can give back to the economy by you know extracting it in a nice way. Maybe there's some downsides for that. Maybe some people won't like that opinion. But I would bet it's very interesting to see how that works. Other things are to sort of do the opposite and say, I'm gonna be totally fair as fair as I can be, and to do that in a zero knowledge way. So to put a zero knowledge proof into the sequencer that says it computed the block correctly and fairly.
Um doing that in a high performance setting seems very challenging. I don't know if that'll be feasible anytime soon, but boy, would it be cool. I think it'd be something you know of interest to a lot of people, and I'd love to see some research on that. Um, other ways to integrate with other networks. Uh I don't know if you can do better than shared sequencing uh or base sequencing in this regard, but maybe you can, right? Maybe you could have chains sort of rotate which super chain they're on at dirt at different times. I don't know if there's benefits to that. Maybe there is, maybe there's threats. But uh I bet there's more we can do with interoperability by involving the sequencer directly in some privileged role or equipping it with additional functionality. And just safety mechanisms to get it uh online.
So if you're not doing decentralized or base sequencing, if it goes offline, you definitely have to have a mechanism to overcome that system's failure. So that is definitely very, very important. But there's more you can do. I didn't really talk about you know, sort of proposer builder separation or intense or you know, account abstraction. All these things will probably have an impact on the sequencer. But I wanted to at least use this time to um you know get the community caught up a little bit on these features because I think as we go on, we're gonna see more and more of them. Sequencers are gonna be a nice way for roll ups to differentiate themselves.
I think rightfully so. And I think it'll be very interesting. But they'll also be confusing. People like to use their own words and keywords. Uh and it's important we understand what they are so that when we have conversations or we use these systems, we know what they're doing and what we expect them to be doing. So, to end, because I think I'll have some time for questions. Um, sequencers are evolving and they should be. Let's keep working on them. They're not over. The zero knowledge parts of a ZK rollup aren't necessarily you know the only parts that need further research. Um, arguably, you know, they've done a good enough job. Let's look at other things that improve the user experience or add some value to the ecosystem.
And let's make sure that sequencers are actually, you know, not neglected and they perform the way they should. Thank you. If you want to learn more about Zircuit, come by the booth, ask me questions or we don't have time for questions. Okay, I'm told we have no time for questions. So welcome to the other thing.
Related talks
- Zircuit: A Security-Focused ZK Rollup Built on the OP Stack | Jan Gorzny - Zircuit
- Zircuit: Challenges of Building an EVM Equivalent ZK Rollup on the OP-Stack | Jan Gorzny - Zircuit
- L2’s Centralized or Censorship Resistant - Zachary Williamson
- The Semantics of Rollup Finality
- Challenges of Bringing a zkTrie to the OP Stack | Jan Gorzny - Zircuit
- Jordi Baylina | Scaling Ethereum Token Transfers with Hermez zkRollup
- The Rollup Fragmentation Problem: Unifying Ethereum via Real-Time Proofs
- Escape Hatches: Urgent anti-censorship solutions
- Defying Gravity: Levitation Lifts Off with ZK-Rollups