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

Loading player…

What is Ethereum 2.0? - Preston Van Loon at ETHBoston

ETHGlobalWed, Oct 9, 2019, 12:00 AM

Preston Van Loon gives a talk at ETHBoston about Ethereum 2.0 and the future of Ethereum. ETHBoston was an ethereum focused hackathon that took place Sep. 6-8, 2019 at Northwest Building, Harvard Campus. ETHBoston was a hackathon organized by ETHGlobal and a team of hackers, developers and enthusiasts interested in building and creating in the ethereum ecosystem. The ethereum focused hackathon took place for 3 days at Northwest Building, Harvard Campus in Cambridge, MA. For more information visit eth.boston and ethglobal.co

Transcript

hi everybody thanks for taking a break from hacking to learn a little bit about 2.0 this is something that myself and a lot of other people are working on there so you know dozens almost 100 people work in this project something really cool and exciting them really thankful you guys are here it's good to get started clickers network there's a new computer so this is my team prismatic labs a couple people here today we started this as a project just for fun to do on the side we started in January of 2018 and ever since then has just been getting more and more momentum we've been able to get 15 years contributors on our project on github we've received grants from the etherion foundation Community Fund and other projects within the community to help us prepare to point out so what we're doing is we're building a production ready client this is a starting proof of State client that you can use at home on your laptop or and more complexed configuration is pretty gonna go a highly available high uptime guarantees with every 2.0 so let's dive right into what is the food 2.0 let's take a look at this quote from metallic-y founder of bacteria according to the tug this is a big multi-year upgrade to massively increase the buck in scalability through sharding increase security to prove mistake and increases the protoman program and the ability of the white panther new improving bunch of things we don't run the first time so this is this is really really a big effort it's a multi-year effort of cross 100 people or more so why are we going to do this if we already have blockchain that lasts for Eastern sliced applications why bother well it's actually not a very fast rate we can I do on average about 12 times X is per second and we have 14 second block time so that's the on average the minimum amount of time you eat away kind of actually to be included but also the proof-of-work consistent mechanism is very expensive today it's using enough power to our small countries or even medium-sized countries it's very wasteful but you know it's it's actually really good at what it does but we think we can do better with something like to the state so with this aetherium has the ability and momentum and the capacity to bring a truly decent-sized future on a global scale twelve times actions per second is not a global scale but we'll get there so let's take a look at how are we going to do this you know as Vitalik said this is a really huge project that we're working over many years over dozens of teams how we gonna do it we're gonna roll it out in in different paces so in the bottom here we have what's called the be contained for phase zero and this is going to be you know your bass player that we're putting everything upon and the foundation and we build everything else's it's proved mistake yes it's the beginning of starting but that the actual sharks don't come and tell phase one so this is phase one is really just building upon the B contain layer to actually add those shards and then finally for you know to complete this pyramid will actually then inputs to education so how many are smart contracts kind of striking other things so let's take a look at each of these these zero is is by far the most competitive of all these phases so far it has four major responsibilities which are to to deal with the actual validators themselves so getting people to join the nominator set through a one-way deposit so if you are wanting to be a validator and you have 32 eight is the minimum at the moment we're thinking is going to be permanent you will take that 32p and send a proof deposit to a smaller contract on if they're in one chain and then you'll be set up to become a validator in the be container this also is responsible for two ejections Texas draws basically keeping the list of elevators Nana Tina that's the validator registry next we have rewards and penalties so acting is about a there's not a cement company actually doing doing work you have to validate box and attest to the head of the states that you should be rewarded for that likewise if you're are flying not participating you should be penalized for that or if you're acting maliciously so the beacon chain is responsible for rewards and penalties in essence another key key part here is to deal with randomness and chuckling redness is really hard on watching it's really hard to do it in a way that's advisable so you know if you're thinking my god she's the previous boy - - to see my random data well you can have an actor choose not to just based on that and a value because they know what it's going to be they could wait until the right opportunity so even though that is random like you can't predict what the next block and she's going to be it's not advisable so we can still decide so it's not that problem you see what's called ran down and that's where you have a large group of people the validators in the sense producing a random number which is all mixed together and then that makes it number is then revealed at the end to so you knew it's not perfect yet because the last actor in that random on with it so choose whether or not to reveal their number and still bias the outcome so we're working on something called verifiable billion function which is a type of food of work where you have this you know complex operation that takes a long time to compute but easy to verify that way it could be random numbers that's a really big part of the be contain and the the last part that we we need is is the proof of stake finalization and so that's that's having finally six points where we you know we have more than two-thirds of the state agreeing on a certain buck to be to be finalized and that nothing can be reverted for that so that's part of Casper and we can actually use that to to finalize lunch a teeny look at Casper real quick this is the proof of state mechanism to replace equipment work so it is much more energy-efficient where we don't have to calculate this really expensive that's released it's a puzzle for the government puzzle we're really just putting up some value at stake and saying I can be not accountable because if I am malicious and you can prove it then you can take my a stake away I'd be rewarded for keeping the system in check so I'm disincentivized to attack the network because it literally cost money what for would cost compute and that's that are to get this you have to you know have more than my third of the network to value to burn to detect it so it's very very expensive and to attack and and works really well for frontline second place else is a lower barrier to entry so if you wanted to be a block producer today in etherium you need I don't know entire server farm of GPUs because the cost to produce one block is extremely expensive but here you only need a fixed number 32 teeth I knew would be selected to the person upon inspecting so that's that makes it more accessible to more people and therefore more decentralized this is good ok so let's take a look at how exactly you can become a Dominator I briefly mentioned that you would send 32e to deposit contract through this process so let's imagine that where this emoji guy and if you have a little bit of extra capital that we want to put up and be a participant in each tube is this very exciting so we'll send that to the deposit contract on the 8th one tank and then we'll wait until the beacon chain has seen that like this is also monitoring 8th one deposit box or this contract then it goes through a voting period which is consist of a thousand twenty-four slots as far as the a new block time which is six seconds and so this is a really long time it's about two hours and that's to prevent any sort of quick reorge to make it more expensive to to undo that deposit we have this long ish delay so once that's been you know voted on people have seen your your eath deposit and they agree that's happened all the votes are in you wait for finality or Caspar mechanism the food stick mechanism to come to a final misty pot where nothing can be reverted and that's finalized in the state finalized at time you put into inactivation of you so we have a rate limit ur so people are not so you don't have like surging people joining an exiting we have a rate limiter called the activation view which is also the executor they share the same rate usually this should be the line there all the milk you at all but if a lot of people are joining at once you might have to wait a little ro the minimum activation time assuming that there's no queue at all it's just over two hours so once you can you deposit get ready to start doing work this is going to be two laps so what does it mean to do work as a valet or what do you have to do you actually have two major roles you mean the be a proposer this is somebody who is selected to propose Anita block in this URL or you could be a tester which is someone who is part of a committee that is going to select their kind of essentially bought on what they think the head of the team is and then we took to consider us on that to reach finality committee is a subset of validator randomly selected every epoch is just 64 slots you'll be selected to be a maybe supposed to be a proposer and it will definitely be selected to be a tester so this like I said this time it's not passive in company need to be online you need to be available and you can be listening for your assignments you're gonna have something to do all the time okay so what does it mean to produce a beacon block v familiar with a thief what you might be familiar parks and how they're simple so you have a header and a body essentially and these look much different then each one what important being honest there's no transactions that doesn't come and tell these two so we're just still talking about a zero that be contain is her pita blocks are a little bit different than a serum blocks so the first thing I'm going to do is collect all this data so we have the random video that I mentioned earlier to do randomness we have add two stations that we've seen that are ready to include from other validators will include that here any deposits that already people who have deposited Eastman contract and we made it to the voting period they're ready to include those deposits here we have some operations so we have voluntary exits people who want to throw out there but what about it anymore we have slashing so people who we can prove did something wrong so maybe they're proposing a blog on two conflicting chains or testing to block some completely chains that's not not a good idea so we're gonna penalize them for that and they also transfers which are common evolve in phase one yet but they exist so when we're all ready we're going to turn our transfers and that's to send balances between between denominators unless I have our eighth one dare box of what we think the head of the eighth one chain is what we're listening but I did it too so we did all this put it all together we then execute the state transition so what happens after we get this block and take the route of that I just likely would do with these today and then we sign this whole thing and broadcast it to the network so this this is really quick you're just fetching it if a disk or memory and then signing into the south it's not at least compared compared to before work disabilities okay so talking about you know what happens to the Black Knight so we brought this to the network everybody don't know what's to run this process so we verified this modest within the appropriate time we verified that the parent group exists so the Buc that came before that exists we verified signature brand out we verify the vendors correct we have been mix it in for randomness we process the equal in data updating it to the state of if the voting period has to do and we want to update it and only do we process all of the the objects and the operations that need the block so that's the slashings a deposited statisticians test various expenses like that that's about cross the same as we want to what it's like to to do activations so at the station means to you know attest to what you think the head of the chain is so very similar to a beacon block we're going to assemble some information there's a little bit less secure but we're going to vote on you know literally what we think the best block is so we have a it's called an LNG duelist but that's part of resolving the fork choice I decided to have the chain and we also have our Casper finality book so the target would be cog that's where what we're currently in and then the source would be what we're aiming to do to finalize or justified really have some of the things like a custody bit field which is group of custody an aggregation that field so the aggregation that feels actually really interesting because ideally a lot about a there's going to be a testing the exact same data if there's there's no conflicting information there's no Forks in the network everyone should be seeing the same things instead of having you know in the robotics will actually aggregate them together and using our BOS cryptography library we can aggregate signatures together so we can see that a hundred and twenty eight people sign this exact same data and this big field represents the index of the people on the committee who actually scientists we can verify the so we'll collect all this data I hear getting any similar attestation live already seen and then sign it broadcast it to the network just like the good of the bar then to rewards and penalties you're rewarded for for both actions so what do you propose a block that's rewarded higher than at the stations because it's less frequent the rewards of penalties are applied at epochs so whenever we have any powerful by just the balances and then one interesting thing about categories that when there has been a long period of time since a finality meaning that we're having a hard time to agree on something the penalty start to increase exponentially so it's been more than 40 parts four times 64 slots no 1s star exponentially increasing those penalties so if you are offline during that time or if one third of the network's offline during that time we're going to increase fees and tether you know come back online or they're forcefully detective for their health danger level here's a table of what you can expect in terms of your issuance and maybe targeted on the 13th so the minimum the start of the chain is just over two billion so somewhere between 1 and 3 million approached but unless you say this thing's 12% maybe but yes this is this is for what we can expect over as the auditors that grows as the committee's get bigger as a registry is bigger we can with the rewards are low decreased in terms of rate of return but when even when you have a hundred million ether which is getting pretty closer to the DIA maximum in circulation is still getting 1.8% okay we under start change so we want to visible no and actually it is the idea of charting face you're always just mistake about errors venomous rewards and penalties but now we're going to have some data to to the whole operation so here we have the beading chain in the middle and then we have a thousand twenty-four shards they would not fit here but I just put you know a couple not for the diagram but that's the idea that so we have all these these shards and sort of like a hub and spoke model where they're they're linked to the beacon chain through was claw cross links but they're they're not tightly coupled with that so they're they're not actually connected they're only connected to the cross links and a zero I'm sorry at phase one the shards are just data only so there's still no sustained execution there's still no you know accounts or anything like that but you have this data availability guarantees I'm starting in a mistake so there's actually some benefit today we be expected to come to consensus on ten megabytes of data per second so that's pretty good - you're noisy so let's take a look at some use cases sometimes you can do are what's called a zoo or knowledge roll-up so blowing up a set of transactions into one zero knowledge proof you can roll those roll-ups in 200 up you can run like a decentralized Twitter his Twitter it's really you know right once and read many times so this is a perfect for is based one same thing with you know pretty good key service for pricey keys maybe web hosting you can put your JavaScript and HTML here that's something else is you know right once many times and even you know using this for private blockchains enterprise solutions where you can go to data and read it great about really anything that you would do small or medium sized pieces data would be grateful at this one and that's cool because the really interesting stuff comes when we let's take a look oh that's gonna be so the plan for Phase two state executions to take the ethereal virtual machine and completely rewrite it and web assembly or a flavor of webassembly he wasn't in this has some things taken out or at it for their specific Lee but it includes things like quash our transactions so for sending from an account in the space of shard one to start five we're going to need some support for that functionality also migrating between charts if you have contracted in charge five and it's getting really crowded for some reason maybe there's some really pocket out there and you just want to send a birthday card to your friend you don't apply that contract somewhere else or move it somewhere else using the concept of contract inking and this is exactly when the contract right the bottom becomes very useful to the other stuff or so when we get to phase two you'll have everything just about everything that we had in if they won but on a much scalable profession this parallel throughput capacity of 1024 x so we should get thousand 24 times to increase its currently in student research phases but we're getting close some people are actually experimenting already with proof concepts and running local Discovery type type of ideas to save solution so it's getting really close it's it's not tied to Facebook with zero or this one so if they don't have to wait until we're done with you know those phases to start you know researching designing and building it so hopefully that'll be likely to start on professional development at the beginning next year okay so that's sort of how things work let's talk about how actually do we build this thing going from a research idea to implementation this is quite a long process so we have researchers from the ethereal foundation and if any researchers other implementation teams or a research team as well they come up with ideas experiment collaborate and talk to each other and then propose these changes to the specification so we have a spec repo you know that's sort of the finest are things supposed to work everyone reviews it once too and then we merge that in and we tag clothing it release so if you play us a fire going indefinitely pretty straightforward once we have a release we can all start building you we can agree okay there's a version one we're going to start building so we'll take a look at all of the features that we need to implement and write out our own implementation and designs and how we're gonna do that so in prison prison was the name of our client at first glance what we do to get from a research idea to production code that you can hardly see clearly it looks great so we start with a design document so when we have non-trivial code so really complex logic like how we going to architect this entire system we don't just start our team usually these kinds of issues need to be broken up into smaller pieces for these tasks or the smaller pieces so we can work in parallel so with what we call a tracking issue which is sort of like an outline the very people are going to do broken up into bullet points that can be done in very no test then we implement we do code review then we run through some testing and finally we can add our own release of the support agent so let's dive into or that and so on prism please a a client-server architecture so your validator is thinking that pulsar Keys is a separate process from the B key chain note the thing that's actually talking to the network and this is really important because you can you can really lock down your validator and put it in a secure environment I just make sure your keys never leak out they don't have direct access to the network we asked to use top class students so we use a tool basil for are really reproducible builds so doesn't matter what you know dependencies you have installed in your system the basil or ignore those and use what's defined within the repository that's really great when we're working on Mac or Linux and everyone's environments a little bit different this really enforces those tools we use to your PC framework for inter process communication the PPE VIPRE collapse or a networking and then OTP for Davis our client is written go and we really like though it has an excellent documentation for the core logic a lot of the standard libraries that make it easy is this type safe language so you're not running into like paying with JavaScript but you don't know if it's a number or spinning it's really helpful to know exactly what your handling yes built in a garbage collection so give me fast without having to think about cleaning up after yourself of course you should be conscious of the space you use but you know don't worry about it too much Sam library is great it's got built-in concurrency patterns it's just for these in use it's also really easy to learn so if you're thinking of something new to learning language learn ghost was a good candidate for that like I said tracking issues so here you can see we have one word there's a new spec version tagged and we created a tribunal and instead of being night 19 tasks this one at the bottom was 75 and of course that's too much for one person to do so well let's put it up into those small pieces we have to do a lot of monitoring and production so we're running the client we're not always looking at a right it's running remotely so we're mostly done with query things so like how many peers are connected in this case I thought that the peer cat was correlated with the number of New York's turns out it wasn't it's just this looks pretty normal and that is crazy so I just it's been really helpful for debugging like that especially when things go really horribly wrong so this chart in the top left is this white count and I should just be linear nice linear slope and you can see your legs falling off and this is CPUs maxing out and the number of concurrent routines begin to clear a million of processors are dying Rios are going crazy everyone I'm scared man we need to know visually what is playing on itself it's a problem I think as you can do so instrumentation so how long is each operation taking here we have assignments being updated this this person is proposing a block took 300 milliseconds we think that's low we can sort of look into each operation what took the longest we can dive into errors with instrumentation this is really really great when you have a remote distributed system to stop in your laptop that's running in the cloud or locally when you wanted to see why is my why is my method really slowly you can do something clean graph which is you take a profile of your code and then this will measure how long each the case and you can actually click on them and drill down and you can see all the way until we click on one of these and see exactly what that was so that's us was a really helpful something that's came from C++ we inherited in go so it's with a great tool documentation is really really important especially if there's something expensive we put a big warning here we also reference the Python pseudo code from specification we run what's called a canary analysis which whenever we have a new binary that we want to action we will we will put it into production but only give it a subset of deflection traffic so if we had put this out here and you gave it we had ten ten nodes when we put one more with this one only give it ten percent traffic and it starts to behave crazy we can see against the baseline what's going on so this one is used in way more memory at less piers blocks are failing we don't like this one we're going to dive into it it's not going to get sent out for forever these so that's been something helpful to testing is really really important it's not just unit tests so we do unit testing which is testing for small piece of logic spec tests which are these data-driven tests that everyone runs and we only beyond we do something called mutation testing which goes through and speaks or code a little bit and if your tests if something doesn't fail it means that you're not really testing that so if you had a some boolean logic where you know if this guy's active give them a million dollars and you inverted that to give them nine dollars anyway so that's something you want to make sure you're testing because that could be a big deal plus 15 so pumping random data into something and seeing the close up into the test is really great or third the hard to do so there are religions of smoke test which can I start the operation can it do a simple thing in an attempt then we do the pre-production so so like I said canary testing will run it for three hours if it doesn't blow up in three hours the canary the saying is when coal miners when it came they had a canary bird down at the bottom of the cave and if the bird type is because there's like a gas leak or something it's the same thing here if our canary guys we don't we want to get out of there we don't wanna move forward with that and all this gives me the peace of mind that your cooks go into work and you have all this proof that it works so you feel good another important thing is that everyone participates in code review if you're on github this is how your chart should look it shouldn't be all commits and zero code review like everyone should be participating everyone should know what's going on and giving their feedback everybody has a different perspective so coming together you can learn from reading other people's code and make one for yourself it's really important what can you do on e to do today so we just have a zero at the moment so some really cool ideas if you're looking to hack it and not already I found something is to build a permanent buck Explorer analytics for values or just any kind of visualizations on what's going on the network we have what's called the etherium API as a open source repository this shows the API schema and metrics for the service designed on how you can get involved with that this first attempt you see and also based on the the urls done here github.

com / Kris dad dad / David gest just recap I think 2.0 introduced as a proof of stake and blockchain in charting it's an entirely new blockchain it's not a hard fork so this will run in parallel to the third one for some time while we migrate over designing the specification is hard researchers card but implementing is even harder as you saw we have all these all this tooling and all this stuff almost as process heat is just so that we don't screw it up and then phase zero we have these clients and his enemies and it's code but we don't have the data analysis and visualization is on the tooling that we're going to need to to really understand what's going on in the by chance so if you're looking for something fun to do please do I really need some tooling there and that's it if we have time for questions kind of drifting we I know you get started 10 minutes late but we're drifting down like we're 15 minutes before we do like two questions yeah so you put 32 you should be Allah they said that you pedal a sore when I go out how do you suppose that decision may be that keeps me like how looking somebody out or if I decide I no longer want to be kind of give my 32 back or well would I have to do and how that me decide it yeah exactly so there's two types of penalties there's a lightness penalty so if you're just not doing anything you've got to be penalized for that it's about the same rate as you can get rewarded and there's also the the slashing condition so if you're acting completely crazy you're proposing collecting information that's going to be a big big mistake in order to get your initial deposit back plus all the money you made you would do a voluntary exit and that will be included into a block and then you'll get put into there's a long delay on that it's about 27 hours once you sing out you want to exit and that's been included you still have to do work for just over a day and then you go into that rate limited queue and then you'll be released from your duties and you can withdraw your funds after that yeah the concreting is my contract going to sustain oldest right that I wanted to meet you or is that sorted yeah so you should signal the chard you want to go into because you'll probably want to choose one is co-located with other contracts to nitrate as many cross country clones or you want to choose from this whole not very populated depending on underneath so you will be able to choose

Automatic transcript — names and jargon may be misspelled.