Thoughts on Layer 2 Scaling - Nick Dodson - [Toronto Ethereum Developers Meetup]
ETH Toronto Talks · 27 May 2021 · 26:55
Fuel Labs developer Nick Dodson shares his general thoughts and notes on layer 2 scaling in Ethereum. He surveys the solutions available at the time, explains why scaling became such an important topic of discussion, and outlines some of the key problems still to solve. Fuel is a UTXO-based optimistic rollup, and the talk was given at the Toronto Ethereum Developers Meetup.
Speakers
Topics
From ETH Toronto Talks, hosted by ETH Toronto.
Transcript
so uh yeah today i'm just gonna do um sort of a brief overview of some layer two uh thoughts that i have um and uh i'm not gonna give an overview too much of fuel or what we've been working on um for what it's worth uh we launched an mvp of our utxo based optimistic roll-up um in december of 2019-2020 and uh 2020 just like goes by the year doesn't even count for me anymore uh so i just forgive me um december of 2020 uh and um you know the idea behind it was really for our team to be able to actually see if
we can ship an optimistic roll up even if it was very basic um so fuel um you know is taking a different path from the evm and where everything's going right now and we're an optimistic roll-up that is focusing on processing and specifically trying to address some of the processing problems of ethereum um and you can think of our projects as not afraid of trying something new or different even if you know even if people might not use it uh we are kind of going in that direction but we do think people will use it um so so essentially today i just wanted to go over though some of the pain points of processing with ethereum processing
the evm and kind of why a project like fuel needs to exist and particularly why we should be thinking about the way that we handle computations with blockchains so is can you guys can hear me fine we're all good uh not breaking up or anything zoom is handling me fine yeah all right good good okay all right cool so uh where are we now um so in the current uh landscape of things uh uh arbitum i think is gonna launch today i'm pretty sure it's supposed to i don't know if it has yet i i'm off twitter now so um trying to live my life outside twitter um uh you know right now in terms of layer
twos you know arbitum for me is the is the best you're gonna get with layer two on ethereum so it's gonna be the closest to the evm uh architecturally um they're going to achieve what i would consider to be the best processing results if you're going to do the evm again and you know there's also been some applications specifically or twos that have been launched there's been some privacy preserving their twos uh there's a lot of zk stuff on the way in terms of general purpose smart contracts obviously transferring swapping doing basic you know swapping pairs and stuff like that sure that's you know available but in terms of general purpose ck uh roll ups and these sorts of things
they're they're all in the way um not here yet uh and then of course uh we launched our little mvp utxo roll up uh uh as well so this is sort of the state of things of where we're headed and and of course optimism as well but again i think in terms of my purview if you're going to do the evm again with layer 2 and you're going to do that on ethereum arbitum is going to be your best design choice your best bet so the way that they put things together is so as close as you're gonna get to what you want um now how do we get to this whole system of layer twos like why do we even need
layer twos why are we here um and why can't ethereum just scale so this is a something you might ask yourself um so essentially ethereum can't just magically scale because it has processing bottlenecks and it has processing bottlenecks over the fact that we have some constraints um ethereum has a two-week sync constraint or about two weeks and essentially you want it to run on normal computers um you you want a peer-to-peer network to to run on normal hardware and you want it to function in a way that you know can can take up a bit of computing power but can ultimately run you know normal stuff across the internet and not take too
long to sing if it takes three months to sing who the hell knows if it's actually valid you know actually getting to that reality could be could be difficult um and actually getting up to sync can really suck so you put these constraints on it because you want the network to be real you want to be decentralized and you don't want to take forever uh to validate and process so when you add those constraints in you can't just do anything you have to restrain the processing that's going on in the blockchain but particularly anything that goes wrong in your design creates a bottleneck and with ethereum right now the main bottlenecks are really around serialization and processing particularly around state serialization accounts
serialization and general processing problems that that happen when you kind of go through the way the evm processes so to highlight some things just to get your mind around you know a little bit about uh and this is just me um ranting in a single slide there's a lot more than this but these are just some these are some highlights evm highlights of bad processing um you know the the accounts model requires nonces and global serialization um and uh it affects the way you use random access memory such that um essentially you need to process everything in serial which really sucks and i'm sure chain
safe knows all about processing large volumes of transactions and serial due to these sort of designs so inherently you can't paralyze the processing the evm for some reason uses 256-bit words which um oh by the way are we still good um can i get a sign of life okay sorry it just every every frame froze and i was like oh am i talking to myself okay good uh just let me know someone scream at me if it's not working so the evm uses 256-bit words um this was not a good choice uh you didn't we didn't need to do this um and ultimately this affects the way that maths work in the system
and can represent some significant overhead in terms of mathematical processing as well using 256-bit words in the encoding schemes is also extremely baggy there's an inefficient memory and state model um the way that memory is handled across frames sucks and the way the state model processes is really horrible um and i'm sure if you've had to do an implementation of ethereum you kind of know this gas accounting is improperly priced so state is underpriced and you know things like normal logical operations are extremely cheap um and uh and and certainly you know there could be some repricing that needs to happen essentially state needs to be repriced for sure um
and memory is oddly priced and not you know appropriately allocated um and uh you know when you get into um you know just the general processing model of having to process ethereum transactions be because of the random access issues um you essentially have to process every transaction in serial um and if we're going to handle the world's volume through ethereum can't be through a serial process so that was a little dumb as a design decision uh there's a lot of legacy baggage you know i don't need to go into it but but essentially just little choices about the way that jumps work and call frames work and other things ends up causing a
lot of problems both in the implementation side the auditing side and the processing side everything in ethereum is a caller contract and there's no scripts this generates a lot of state that's sort of useless it's a lot of times you just want to multi-sig for one use and you can't do that for example erc-20s suck and should be native so you know the fact that erc20s are basically re-implemented accounts model contracts using state and ethereum over and over again is kind of insane um and uh you know that causes a significant amount of you know overhead when you're doing processing we can go on um so if you want to put all that
into a roll up you can and it certainly will seem to alleviate things for a while and that's fine um you can put it into a layer two you know like optimism or algorithm does you could try to put it into something that is abstracted into a zk roll up but ultimately you still have to do the processing somewhere you still have to do it and it doesn't really solve much and you know there is some nice little things you can do in the meantime if you just want it to be really cheap is you can just create another layer one or you can create a side chain um so this does change the underlying security profile
of what you're processing and what your you know what you're transferring you requires bridges and other things from layer one to layer two or sorry layer one ethereum to layer one you know whatever um for what it's worth uh i like polygon and xdi i think they're pretty cool projects um and i think it shows that people just want it to be cheap and they'll you know let go of a certain amount of security just to get the sort of activities done that they want to get done and most of the people on ethereum right now a lot of them care about security but they've been getting it sort of for free and i think ultimately if they take a bit of risk
jump in a polygon do a bunch of trades sit there for a while and then come back maybe later they don't inherently mind that so you know right now i think the user base is sort of okay okay uh hey guys sorry i'm joining on my phone because i think my internet just dropped the wi-fi diy around here is pretty bad but uh basically california was great uh it is everything is great except in long beach the internet around here i'm just trolling it's it's just awful so you know there's a trade-off with everything well you might have the trees but we got the internet so yeah yeah that's right that's right i i really i really want my like t1 toronto line back
uh you know that was really good um all right so can you guys can you guys still hear me see me yeah we got you perfectly yeah all right great all right so phone to the rescue um so yeah essentially just to finish off you know our presentation because essentially there's only two slides left so you know you can go to a layer one or a side chain you know ultimately if you want to change the way things process you know the eip process tries to do that and it tries to do it in a way that is obviously democratic and working through everything and and making big hard changes which are sort of required to fix a lot of these bottlenecks
i don't think we're going to see for quite a while um i think things around the periphery that might be easier are things like making erc20s a little more native in processing but ultimately as a person i'm incredibly frustrated and sick of looking at the evm because i've been looking at it for six and a half years and i think ethereum as much as the evm and solidity have been a tremendous part of ethereum and the growth and development of ethereum the theorem to me is much more than just the evm and solidity as much as people would like to fixate on those things and ethereum can be used as a base arbitration layer for whatever execution layer you want
you don't have to do the evm again and so it's a great starting point for this sort of journey into you know um into sort of the next realm of uh you know of doing blockchains um but ultimately um you know you have to ask yourself the question if you did propose something different um you know would people use it would volume you know go to it um is it going to be good enough to really switch off the existing tooling and you know uh is the thing you're switching to really right or is ethereum and the evm as it currently stands sort of good enough and so ultimately you know all these um all these thoughts are valid and i
think it's very exciting what's happening in terms of both player two again uh as far as my admiration goes it's definitely for the like arbor trim team it's my my fanboy layer 2 pick you're going to do evm um polygon and xdi are are really interesting in their own right um but you know for what we've been working on um on the fuel side and a lot of it has been private since our last release just because we want to build up some momentum technologically is really to try to solve some of these processing problems um bring a different kind of experience to using um you know these blockchains and and um and ultimately try something different with with ethereum uh than what's
sort of going on and you know the hope is is that it's worth it for the for the learnings um but also that i think a lot of other blockchains you know would would benefit from seeing some experimentation here and not just recreating the evm over and over again and trying to reuse the solidity tooling over and over again uh because as we all know if you've tried to ship something with solidity in the past six years how stressful was it just ask yourself that simple question you know how awful was it for you to do that and you know it's taken us years to build up an understanding of the evm it's taken years for us to learn solidity in the ins and outs of it um
but ultimately kind of still sucks and i think we can always do better so um you know we'll be releasing a version of fuel um that should hopefully accommodate for some of these things um in the third quarter uh so stay tuned for that and um you know as well we will be doing some sort of private uh show and tells of our tech and trying to get some feedback from you know great senior engineers so i'm sure chain safe would love to see all that stuff and probably you know invite you guys to all of that um and uh yeah you know i i'm a little more cryptic about our stuff but it's only because uh space is so effing competitive if i went and told you all the processing
techniques we're using i bet teams would pick it up in two seconds uh so um so yeah that's the sort of uh end of my presentation on there two um you know uh a side rant on layer two scaling you could say and where i think things are going and what i think is exciting about the space um so i don't know how much time i have left uh for you know if we [Music] how how much time was i supposed to talk we can fill it up with questions so yeah we could take we could take questions now if anyone has um questions feel free to mute yourself or just drop it in the chat awesome new push go ahead cool now you go first
uh noob question what is this a z k uh zk oh oh what oh what is zk oh i was just uh short forming um zero knowledge proof so zero knowledge like a zero knowledge layer two or zero knowledge you know roll up so uh the the ultimate technique to optimistic well sorry i'm assuming a lot about uh the technical understanding of people in this uh in this uh in the room um i i i apologize if if some of this just went over everyone's head um but i have a basic idea that maybe you guys understand some of the current happenings of layer 2 and autistic roll-ups and seek roll-ups but
to go over that just briefly um with ethereum there's two predominant techniques right now to give the theorem a little more throughput a little more room uh without changing the underlying security of ethereum so one of which is an optimistic roll up the other one is the zk roll up and there's debatable properties of both um but both are what we consider layer two and in the zk side what you're doing is you're taking the processing and verification and you're putting that through zk proofs and circuits and then you're you're putting a a proof uh on chain or you're running a proof on chain and that is sort of um you know you could say you're sort of moving all that computation verification off chain
and then you're just using ethereum to sort of sign off on these uh changes of state and so you know ultimately again you're using ethereum as sort of the grand arbitrator um and uh and this is sort of the the predominant theme in the optimistic category you basically use a um you know a game so you play a game over processing um all of the data for transactions is dumped onto ethereum and only when there's a problem do you actually run specific you know parts of the execution on ethereum should also be you know operatable on ethereum and then um only if there's a problem do you actually need to go to ethereum really
to do any processing there's trade-offs and benefits for both um everyone has their pick and their favorite in terms of which they like um but the you know the optimistic roll up has some nice properties of we can get extremely close to peer processing so the operations that go on in our system off chain can basically go right down to the cpu and almost be completely unbothered whereas with the ck roll up you know you have to go through a very complex proving system requires a lot of asics and a lot of phds and a lot of experimental cryptography to get those results so i think ultimately i'm a big fan of the zk
roll ups and zk tech but i'm more of a fan of it for privacy than i am a fan of it for scaling um but that's just because i'm an official developer so i'm biased also i'm not sure who asked that question but um we had mark a couple meetups ago so two months ago from optimism who talked more generally about rollups as well so that's on our youtube channel if you are interested in just general roll up information as well yeah awesome uh other questions yeah antoine had a question um
i'll ask um so actually you dropped a few things while you were talking about uh ranting about the evm so i wanted to get the hate out of you and then like put it in display for everyone to see um you mentioned that you thought that gas costs were not properly charged like there was a big discrepancy between state operations not costing enough tell us about that and to kind of go with that there's a recent there's been a disco disclosure about broken meter have you heard about this uh do you have a take on that did you read that so i'll admit that i spend a lot more of my time right now uh at a higher level so i'm not paying attention too much to some of the recent
happenings that's uh john adler our other co-founders job but he's the one who will be on twitter yelling about things that happen right away i'm off twitter uh trying to stay away from all of this um but uh so that's my admission to you but in terms of the general problems of state um so with blockchain's state is really one of the most expensive things to you know keep track of process hold on to and use and with you know ethereum's current state you know we're using a tremendous amount of state i forget what it is i think it's like we're using 180 gigs or something of state
right now like some enormous amount and the problem with state is that it needs to be sort of readily accessible to be processed quickly and um you need to sort of have it on hand and because of the way ethereum state model works you know you have a system where you don't really know when you process a transaction what state it's going to touch where and this causes a random access bottleneck where you end up having to process everything in a serial process and ultimately there are eips and things to try to attempt to address this but unless you mandate a processing model that solves it you really aren't going to get significant benefit until you actually mandate something
across the whole chain if you mandate something across the whole chain then everyone needs to change the way everything processes and that's a big deal for us for ethereum and a legacy system but it essentially just comes down to state needs to be easily accessible uh it isn't uh if it isn't causes problems so when you have a lot of it and when you have to go grab it it's a big issue but more importantly when you write to state with ethereum we need to provide the you know this is just for everyone i know antoine you already know all this um when you need to you know uh you need to provide not just the rights to stay and what the state is but you need to provide cryptographic proof and ethereum uses a global um merklyzation system to do
this and ultimately creating these merkle proofs storing them for every state right and usage becomes extremely problematic when you have a global state model and you have to process everything in cereal so not only is it is it like you know compounded by the fact that state is just expensive it needs to be readily accessed but it's that's this re-serialization and remorkalization of everything that ends up causing these processing bottlenecks and making it so expensive and ultimately when ethereum was made they didn't really know where their processing bottlenecks would be because those benchmarks weren't really done because no one was using ethereum so essentially the original prices
were set to sort of assume some things about processing based upon best guess but um you know and they and and some things have been changed obviously in terms of state price but really if you really get down to it given where the bottlenecks are on ethereum processing um you know it should be magnitudes more expensive to write to state and magnitude is more expensive to read read from state and it's not and when it's not then you know people will advantage it too much in the wrong way and ultimately cause processing issues so it's an unfortunate side effect so state pricing is really the one of the major problems of gas pricing in ethereum
but there's there's of course other things in terms of the way that ethereum processes memory processes call frames processes jumps processes um all sorts of things that you know don't properly get at the you know the current way that cpus work and when you make everything into 256-bit chunks you really now are now you're just really causing issues because cpus are 64-bit and you're dealing with 256-bit so now it's like things are madly more complex in terms of you know processing and ticks and so um so for fuel and what we do with our processing is we just say [ __ ] it uh a real engineer
wants 64 bits because 64 bits is what cpus do and everyone else can suck it and we should probably change yeah interesting but that's my rant and i don't know if we'll we'll win anton so yeah sorry we added another link as well from from willem who also gave a talk about about rollups so we have a lot of roll-up content for those it's definitely something that i think is one of the most exciting things going on in the space right now and that it's unlocking a lot of scalability which is something we've been talking about for a very long time
yep absolutely um also for what it's worth for people who are interested you know with ethereum 2.0 because a lot of the questions i get are are you concerned about ethereum 2.0 and sharding and the sort of next phase for ethereum and the answer is that the way to scale steering 2.0 is still roll-ups so no uh it's just you get roll-ups over shards and shards you know give you more you know optional throughput um but ultimately as we've seen liquidity only favors certain areas and cross-shard liquidity is still going to be something that's problematic so you're still going to have issues
there and you're still going to want as much throughput out of a single shard as possible and you're still going to be back to likely the same issues that we have now um so again all these things nothing goes away because you just want to magically make it go away it just doesn't um yep sweet thank you um thank you for like amazing talk um nick awesome awesome we're also um we're also hiring good senior engineers particularly people who like rust or we just like good computer science um and if you like low meetings and you know very intensive computer science oriented discussions
uh and a lot of trolling um you know definitely uh let me know um so yeah not to poach any chain safe engineers um but you know if there's any board chain safe engineers i'm not going to turn you down if you apply and also yes you do get a free nintendo switch when you join us because we're very oriented around nintendo for some reason um okay that's it cool thank you everyone we got to get the [ __ ] in just need to share a little bit