# Spin it up - spin up your own Ethereum validator on testnet | Devcon Bogotá

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2023-10-07
- Duration: 1:22:17
- Watch: https://streameth.org/watch/yt-dWCck2IniNc
- YouTube: https://www.youtube.com/watch?v=dWCck2IniNc

## Description

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on Swarm, IPFS and more.
https://archive.devcon.org/archive/watch/6/spin-it-up-spin-up-your-own-ethereum-validator-on-testnet/

This workshop aims to be an essential introduction to Ethereum PoS consensus by inspecting its underlying infrastructure.

We will first demystify concepts such as Execution + Consensus layer, PoS validation, Keys and Signatures, and Slashing. 

You will learn by watching when we demo how to spin up a validator using the Lighthouse validator client. 

You will learn by doing when we give you some time to spin up a validator yourself and experiment with the setup.

Speaker(s): Jennifer Parak, Gabriella Sofia
Track: Staking & Validator Experience
Keywords: Validation,Infrastructure,Engineering

Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon 6 was held in Bogotá, Colombia on Oct 11 - 14, 2022.
Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

## Transcript

[Music] okay hello everyone last day of Defcon thanks you a lot for coming and yeah we hope this is like a fun workshop for everyone and we can actually get to see how this uh technology works and you you might be able to like running on your own hopefully by the end um yeah do you want to introduce yourselves yeah yes sir um hi my name is Jennifer I'm a software engineer at cor one um course one is a um staking provider like we run valid datas on several lots of different networks actually but of course the coolest one being etherum and this is what what we're going to talk about today um Gabriella yeah um my name is Gabriella I I part of like the research team at cran I focus on ethereum mainly and yeah definitely the coolest chain they one not matter so the the title of this is spin it off uh spin up all the DAT on testet and yeah the the way I think we wanted to structure this is basically in the beginning I'm going to be giving you like an Essentials outlines of like the different parts that uh we're going to be looking at when we we move to the second part which is the demo uh when Jennifer is going to actually demonstrate how to scen up this validator and well then I think you'll get the time to do it yourselves um with the repo that we're going to be sharing with you um the information on like the Wi-Fi is over there if you need it and yeah then maybe this kind of like we wanted to co-create it with you we can continue into like the steps on the validator so exiting the validator or we want to do like more bun things that we think could be fun like going more into like the block explorers for the other dat that you created and maybe like even understanding a little bit more like inan maybe like the different parts that we mentioned during the the essential like talk that I'm going to give so yeah I think uh one thing I'd like to mention like feel free to like just interrupt this ask any questions um this is your workshop and this is why we also leave it kind of like very flexible for you what kind of like exercises um you want to do um and then we'll see who's interested in exiting a validator um we we have some keys um that you can use um that we've already deposited um so and they will only be available during this Workshop so if you want to play around do it during the workshop and after that they won't be available anymore all of these of course powered by courtsan who gave us this this GI our company so yeah I think we're ready yeah let's go into like this essential like talk that I want to give um do we I let's get yeah let's get give some context actually oh about how how this uh Workshop actually came about um namely the yeah the past few months we were like working really hard um on an API um to automatically spin up validators I'm like I'm super proud that we're like this week we like released it um so I can publicly talk about it um kind of my baby so basically obviously before you automate something you have to do it all like manually um so I found myself running like lots of Docker containers and like running validates um just to test it and with Opus API you can actually just um call our API and it will um spin up a validator automatically for you yeah very cool and yeah we have like announcements on our Twitter and everything if you want to read more about it but yeah I think you're here to do the the Practical part let healing so okay let's go to to this and yeah I wanted to start with like kind of like a big picture look into like the ethereum network and well vitalic gave like this very good talk during the opening ceremony but I guess I wanted to take a little bit from that and also make it like more pertinent to like the topic of staking and moderators and what they do inside like the network that yeah we are creating here no so yeah this is again um a quote byonic and I'm not going to read everything to you but this is like a cool I think look into what is uh blockchain and the different parts that we are going to be seeing today are mentioned there but I guess one of the most important parts to I guess pick out of this definition is when it says like car is very strong crypto economically secure guarantee and well crypto economically is basically a madeup word that we have here at crypto but yeah it has a lot of meaning specifically when it comes to like the security of the ethereum network it has two Parts the crypto which makes you think of math and then like the economic part which makes you think of money and it's like math and money has a lot to do with like the things we do here but yeah and specifically like the role of validators here in the network so that is uh essentially like the idea that we have behind this blockchains and there's like quite a few of a very like interesting things that they can do for example for me I do find find that like the guarantees that they have to continue running even if people like are not interested in them that they are basically like infinite and they continue even like Beyond hopefully beyond the ages of everyone here present um they have like very high availability like up time and everything that we try to keep here at the network and basically all of these uh blockchains that we kind of hear about they're part of this called they're part of this thing called like consensus protocols right and when we think about consensus what we're basically talking about is trying to keep like a huge number of different computers in sync even in front of like all of the challenges that you could find to keep like a number of distributed computers like always in think in sync which could be like Network outages or even like a denial of service like attacks uh WI know of those here in here in ethereum yes but basically when we try to think about like this definition we are basically conflating like two different things or two things that are kind of conceptually different H especially when it comes to like smart contract platforms like ethereum and for example when you're running like an ethereum full note and yeah by the end of this Workshop I hope everyone here is like cap doing that then it is true that you're running like a consensus protocol so on that side you're working hard like connecting to other nodes and trying to bring like all of them in sync like I said but at the same time what you are staying in sync on is like the set of instructions and these instructions are in themselves like updates to the state the state of the machine that we are running right and these instructions could be like as simple as like transfer money to one side to the other the is good at that but also much more complex things and well I think this talk would have been better at the beginning of Dev gun but we've seen like so many of those applications uh during the week all the things that can be done no so if you're running like that full node in ethereum then you also like responsible for like the compute and the computation of all this H instructions that we can on consensus of and those are very two like two very distinct responsibilities that are worth worth like separating and when we see that well what I'm talking about is obviously like the separation between what we call like the execution layer and the consensus layer in the Protocol no that is like kind of like the main architecture behind the noes that you'll be you'll be developing so we want to dive just a tiny bit deeper into these two things um on one side well you can see the the architecture there but yeah on one side we have the consensus and this consensus mechanism so you might be wondering like okay how does ethereum keep like this x number of validators uh in sync and well nowadays or by the time like I Was preparing this presentation then that number was like X correspondent to 4 41,0 747 active validators but there is a world right where there could be like millions of this or we hope that there's millions of noes running and we can actually like cap the amount of uh notes that the ethereum network can handle because it is a function on like the total supply of ethereum that is currently like on the network but yeah uh to understand like a little bit more about the relationship between like Supply and E then I would recommend like a talk that was given here called ultrasound money H won't go very deep into that but yeah to go back into our topic ER eum today uses something that is called the gas vest Gasper consensus algorithm uh the too long didn't read is that it's not really like a single algorithm that controls the network is like two different and very complex algorithms one bringing like the blog finality and the other bringing like a fork choice and I do love talking about this so I will go a little bit deeper hope I don't lose you um let's see CER FFG is the name of the finality algorithm so basically and yeah I want to relate it more to like the validating process so during the blog proposing process like the one of basically randomly like one of the validators of the whole set of validator active validators that I mentioned is selected from the pool ER however what is expected is that the network will grow like in a single blockchain one block at a time one by one but sometimes the network like I said could fall out of sync and produce or broadcast or two blog or true validators might broadcast like two bid blocks that could be potentially added to the network H and when that happens that creates something that is called a decision or like a fork and even like small Forks are very like existential threats to like the protocol or different distributed systems because there should always be like one true blockchain or one canonical blockchains so Casper the idea and and not going intoa details is to like give certainty to like this one true blockchain and the fourth choice would be like it's called lmd ghost uh helps to complement this Gasper protocol and like I said most of the time it grows one by one but sometimes like the choice appears okay which one of these four choices should we choose so this is like a function that takes like all the different path that are in the chain and speds out like the one canonical chain that is going to be ethereum and together like both both of these things H try to keep like the network Instinct at all times I think that that's a pretty cool description um going into like H the execution part like I mentioned uh basically eum is definitely more interested in like being a consensus protocol and DM is interesting but in my opinion is H something that can be changed in the protocol but yeah etherum exists in a Network that has like thousands of uh computers and each of them is currently running like a local version of the etherum virtual machine and basically the evm is like the place where all of these decentralized computation happens all smart contracts and all the trans transactions that we know and and that is a place where all of those uh contracts live and this is the same environment like it doesn't matter what kind of computer you have or what kind of client you're running it basically is like the same environment all across the network within DM There lives like a number of entities that are called accounts and like contracts objects and the E will which H fuels like everything within within the network and basically what DM has to do is basically follow like a set of rules and the main rules there are that everything should be recorded in blocks everything that happens inside the ABM and should be added to like the public blockchain anything recorded in the blockchain cannot be undone and all objects should have like an owner and they cannot be altered without the permission of the owner this is very basic some of the these things are changed depending on like different applications but and different like things that are going in the protocol but this is like the basic rules I think going pretty quickly in this another thing interesting thing are like the different clients so today in the workshop we'll be using uh two I guess minority client clients I mean it's difficult to to still say that Lighthouse is minority but yeah we'll be we'll be using that at some points and also like te te for for what you've been doing what you've been doing and also in the execution side we'll be using Bessel which yeah I think we could say is pretty minority and yeah like we said we have like this execution part and this consensus part and we have execution clients and consensus clients uh the ex clients will listen to the different transactions they change the state of the evm and they hold like the current copy of well the state and the consensus client well they keep all the machines in sync so that the proof of stake uh well consensus algorithm can work no and well etherum having like different implementations is actually like a great asset I think we all know it um and yeah the important part there is keeping like each of these implementations under like a security threshold so that a network can say online at all times um yeah I think we're all aware of the importance of client diversity so yeah we wanted to use minority clients today so yeah a little bit more into like the validation process uh it's basically what it keeps ethereum secure know and staking on ethereum can take many views but let's take like the more canonical like idea of what staking is uh definitely a lot of changes going on in the in this industry yeah but okay canonically what it means to stake is to secure the the network by making a deposit which has like a transaction of a financial bond which is uh 32 e that you have to like deposit into like what it's called the deposit contract of eum and the idea there is that if you validate transactions honestly then you get like a certain payment and if you are dis dishonest dishonest then you basically can you lose this Bond because ifone does not have like a native delegation model then you either go through like running your full node or you could have like a few options for example like the most decentralized of the liquid staking Solutions are probably better and yeah maybe other options uh we don't want to encourage okay so and yeah going a little bit further into like those rewards and slashing conditions [Music] um basically here I just want to quickly mention like the incentives and like the design solutions that the protocol has had but like very quickly so in the same sense that you have like an execution layer and a consensus layer then you also have like execution rewards and consensus rewards so the consensus rewards make like the biggest like piece of the pie of the rewards at eum and they basically come from like doing like the attestations and proposing the blogs attestation means voting inside the system okay uh voting for the different blogs and voting for them to be included and very rarely then producing blogs I mean you probably will be producing blogs but it is kind of more random than doing like the attestations and in the same way that you can earn those rewards then H the exact amount that you earn is what is detracted from like your balance when you uh are offline for example on you fall into like what is called the inactivity leak and that isn't like really slashing slashing is a completely different thing um hopefully today we'll have enough people to like try that and see if we can get a slash and in our test net just to see how it is but yeah and slashing can go like from like one e to losing like the complete Bond so the 32 e of that you have in your balance and yes finally okay you have a question for the time that and yeah uh exactly basically ER this penalty that you can get usually comes from being online and it is the exact amount that you would have earned in the same period like you said and like you said H slashing come from things that directly attack like the consensus uh of of ethereum so that is usually like either double signing putting like the same keys on two different machines is very common if you like forget I don't know probably shouldn't it's money after all and and also like the basically trying to do like surround boting which is difficult to explain but basically you're trying to change like the canonical change back uh like the historical data that has already been added to the blockchain in the future but yeah I can explain later if you want yeah I I guess that the the last thing I wanted to mention because it's very important for what we're going to do is uh yeah you can pass that I think we talk about it keys and signatures so today we'll be actually going through like the process of generating keys and everything here in front of you and keys and signatures are like the main crypto cryptographic like Primitives that allow all the communication that is is going on in the network when you look at the most like base level uh you can definitely look into like the different block explorers and you see like all the different keys that are interacting with each other all the contracts which also have like these uh different signatures and everything and yeah hopefully we have the time to look at in in the block Explorer and they work through something called hashing um which is basically of a cryptographic term and it's more like a more efficient way to like securely store data inside the blockchain which is like the entire basis of the protocol I think and basically you have like this digital signature that represents like the validator and you get it from like a key generation algorithm that will will go through in here like I said and there's also like a signning algorithm and a verification algorithm that go behind like the scenes to to really verify that everything that is H getting added is well correct hopefully we have like the time to see all of those things and yeah I think I hope this wasn't very boring to you like I think these May bir side view on what the protocol is it's important to like understand what we'll be seeing so yeah I think it's time for for the demo nice okay then I'll take over um and I will just work from this GitHub repo that you can try and find um so basically the way I kind of thought um might be helpful for you is like I'm going to walk through the demo um I would kind of like recommend you kind of then in the self-study time retrace my steps you can just do the same and then yeah go on wi um the Wi-Fi I think it's best to connect to the Devcon Workshop one yeah I think so it's not working it's working for you okay are you are you guys okay with the internet you think you're good okay it's working on mine what cuz where cuz you canor my laptop cool yeah all right not my nfts um yeah okay what was I saying yes um I'm going to walk for demo I think it would be best if you didn't kind of like retrace my steps and then there's kind of uh some exercises like first we're going to do light try the light us client then you can try the teoc client yourself and then uh number three is like fairly challenging but obviously if you're feeling adventurous um you can walk through uh these steps too and then I think we'll kind of like reconvene and then see what people are interested in either we like exit our validators or we um I don't know explore the block but let's get let's get into it um okay actually let me just let me just uh kind of like describe the test uh the steps um that's a great brilliant question actually so generally on a higher level like what you need um to actually like become a validator on ethereum is you need to generate your keys that's like step one um you need to set up your infrastructure um and then like make a deposit of like 32 e we're going to use test e by the way and then it takes a while for the uh validator to be activated um and because of kind of like we have to take a shortcut because also like girly e is like pretty uh sparse um and also like this like waiting for the valid dat to be active I don't think it would be feasible um in this Workshop so basically what I've done is um I already generated Keys um for test net and we we do have like some of the infrastructure already kind of like set up um we have like an execution client and a beacon notes which is already synced provide with course one and basically we will set up the valid dat client and connect to that and this will be on test net so no like private Nets any more questions before I jump into the demo thanks so much there's like a seems like it's a market it's a real Market cool we can do an auction later all right let me sit down um got this weird setup because my screen is broken but this works actually really really well all right um let's start a yeah Steps step number one what we want to do we want to generate our keys and the way I do this um actually if like go if you go into the repo um you want to open this link which takes you to the staking deposit CLI it's an open source project by the ethereum foundation when you open the link um just download um the state the the CLI for your uh operating system um Pro probably best if you just I've already downloaded it so you don't need to watch me um do that um so basically what the deposit CLI will generate like two important artifacts um number one is the information it's called the deposit data the information I need to make my deposit and number two actually probably the most important it's going to generate your private signing key so as like Gabriella was saying before whenever valid data like basically does makes any attestations or like propos the block they need to sign it they need to sign them so they can be hold accountable um so is there anything else I want to say there no I'm just going to like run the CLI to show you what's uh how this works um there's this command called new M monic which will like generate a memonic for you um anyone wants to know what a memonic is or is everyone aware um basically MIM monic is like um a list of words you will see in a bit because it will generate it for me um which represent the seat and from this kind of like seat I can uh generate my my private keys and the cool thing about this is that it's like deterministic so the same memonic will always generate the same uh key so in case you lose your key um you need your memonic uh to regenerate them okay the C is asking me a few questions um going to pick English I'm going to pick English I want to run one validator um oh yeah of course that work cool um this is an important bit Let's uh we're going to do this for girly test net a yeah and then uh what the deposit S I will do is um as I said like generates um my private signing key and it will decrypt it um and the file is kind of like called a key store file so here in this point I'm going to select a password which I can then use to like um encrypt my private signing key and I type it in again oh yeah this m monic the thing I was talking about um need to copy it and and put it somewhere don't show it to anyone um and this um oh cool it's quite fast um so now it should have generated my keys in here let's have a look um the first thing is the deposit data um as I said like this is the information we need um to activate our validator cuz when I generate my keys no one knows that my keys exist right so actually I need to um submit this uh information to the beacon chain and tell it's like hey this is my information and I want to become a valid data basically um but I will go into this um in the next step I just wanted to show you what is generated here actually just look into the key store file um so this is my uh encrypted private signing key it looks a bit scary but actually if we decrypt it with the password that I've typed in before it would just be like classic uh private key not not not scary looking at all um so yay we generate our keys um really like important things uh just to remember actually the most important if you remember anything from this section like this is the private signing key and we're going to use it later uh to start our validated client go on they use okay they use the same hashing algorithm and yeah the same the the keys and the accounts basically look the same like if we look at uh the Explorer you could see like they all start with like ox and because they use like the same hashen algorithm basically yeah no because there different like entities inside ethereum like a wallet is recognized as like an account and this is recognized as like a key okay nice one thanks um where we testing testing testing testing oh yeah there it is um any more questions because I'm going jump into the next step um because now that we have a keys um the next thing I want to do is make it a deposit um also oh yeah I've added like lots of like uh reading material so you can dep first search your way into uh the demo um if you if you want to make a deposit um the best thing to do is go to this like staking lunch pet um and you're going to walk it's going to take take you through kind of like some questions I'm not going to do it all in front of you um but it's actually like if you want to click through this this actually gives a really good information like what like about deposit about up time and general information and once you get to the end of this checklist um it will ask you to um upload the Json file that we saw earlier um namely the deposit data and then you connect with your wallet and um if you're super lucky 32 e and then you can just make the deposit girly that's quite important actually um to use the correct Network um okay actually this is um um pretty pretty neat graph I found on the uh prism documentation um so again as I said like when we generate a keys no one really knows about them so we have to make a deposit um then kind kind of the valid data comes into this deposited uh State um and it in in the end it joins a queue um this is actually by Design I can talk about this um probably later on um but then um the most important thing is like it joins a queue and it takes a while from to become active um and then as uh as Gabriella already said like you I mean if you're valid dat like participating in in consensus and everything's going great you're getting rewards but could also be that like your validator I don't know like you like make a mistake validator misbehaves and then you would get slashed and then it could even uh get to a point where you get forcefully exited from the network um also like if you um if your valid data has been like N9 days active then you can also voluntarily exit your valid data although there's no there's no turning back if you exit your valid data it's done um and at some point you will also at some point after the Shanghai Fork we will also be able to finally withdraw AR okay I think that's everything I wanted to say here so we generated our keys we made a deposit and now we're actually ready to set up our infrastructure can you repat sorry okay yeah I I see your point okay I mean in this Workshop I guess we are showing you how to run your own notes so you will be your own Staker we do have or there says like liquid staking Solutions because to be to run your own note you would need like 30 to e which yeah it can be a limitation to some people there are like other liquid staking Solutions where they ask you either like a smaller Bond or you can do like uh just H deposit H the staking in all in a different protocol deposit like I don't know one e if that's everything all all that you have and you get the staking rewards without having to run your own uh your own validator like at home like the the entire setup and okay yeah then there's also other Solutions we have like this API that you can do these steps easier with um but yeah I guess you you can be a solo Staker you can St with like a liquid steaking solution or like a steaking pool or yeah steak with centralized entities sweet um um Gabriel actually gave like a really good uh overview before of like the infrastructure involved and I just want to repeat that because I think it's like um really really important to note um so what we need um is we need our execution client um which is responsible obviously for executing the consensus um we actually already have like we will um have a bezel note uh set up um and then you also need the consensus client and this uh kind of consists of two parts um it's like the beacon node um which connects to the P2P Network and then the validata client which um which which you're going to run locally which actually manages um which which manages the validators um and again here we had to take a shortcut um because the both the execution client and the beacon note they actually take a while to syn um I know there like workarounds but I still thought it's like easiest we already connect to an uh synced um execution client um a Bez note and a synced Beacon note um I believe that's a te note um again both uh provided by chorus one um so I think the first thing um we should do is just make sure that the beacon node uh we can connect to it that would actually be tragic if not but let's have a look I was trying it before so that's that's okay uh seems seems fine we can connect to it um yeah I also like included a link for like the whole like Beacon node API so if you feeling like you want to explore like what the beacon note looks like you can actually um again in the demo you see the the URL from the pick note that we provided and you can just play around and um send some requests if you fancy it okay so um summary we have an ex we have a big note synced connected to an execution client already synced um so all we have to do um is we pick a validate client and the one um I'm going to show in a demo right now is Lighthouse so Lighthouse is a validat client um written in Rust um they have really cool uh documentation um actually I think I think when I started looking into this there were still fairly minority um they really caught up um oh yeah okay so we're going to pick lighthous and what you do is uh you pull the docker container sorry okay I can talk again um I've already I've already like pulled a do uh image um so let me just uh try and see this if this works yeah so you don't have to watch me uh download a Docker image um and once we have this set up actually let's let me now jump into vs code cuz it's going to be um much easier I think to show you um all this configuration okay so I'm going to jump into demo and then Lighthouse config um and Lighthouse has like a neat thing um this validation validated definition yaml where you can um configure all the valid datas you want to run in this uh client instance and I'm just going to walk you through this um so you can actually like run multiple um multiple validators in uh one instance and you can like here's a flag to enable or disable um here comes the voting public key um you like that would be from the key that we like generated um so here you basically want to say okay I'm running this valid dator and this is how it will kind of identify you um since the merge we also like uh have to um or want to um configure a suggested like a fee recipient um yeah actually let me go into this so um before proof of work um the miners would like receive some kind of tip um in the transaction when you put them in a block and now with um now after the merge actually these kind of tips go to the validators um so with the fee recipient you just kind of like um specify which address this should uh be sent to I just put a burner address uh in there because if I don't uh Lighthouse will like start complaining and logging uh some warnings oh yeah and then actually most importantly here we actually want to configure our keys now that we've generated before um there's other ways to configure them um just for Simplicity um we're going to go for Lo local key store um and then you just kind of um show the voting key store path so basically um remember um are the key store are encrypted private signing key um this is what you point to so you point Lighthouse to the path and then you give it the decryption password um because obviously needs a signning key to like sign whatever attestations you make um so this is all the configuration um just to show you here um is my voting key store um and lighthous is just want to mention this lios is very opinionated about how you name kind of these uh folders and files so if you run into errors then it could also just be like maybe you had like a typo in a name or something um but now I have any questions is yeah oh um so basically what I what I meant is like I could actually have like two or three valid dat just trus in this client instance uh running yeah I think it's important to say you have to have like one execution client connected to one beon client okay but inside the beon client you could have uh several validators it's like a one-onone one to one relationship between the Von client and the execution client but many validators and it's fine thank you um I'm audible yeah yeah yeah any of those works as long as you're having like a one on one to one relationship between the beon and the execution board thanks for mentioning that that's yeah it's actually important thanks cool any more questions um yeah I mean the idea there is to have like more of an opportunity I guess to and like their rewards and propose more blogs and I guess on the other side like to keep like more secure the network like the amount of validators is like a measure of security I guess okay yeah that is what I meant when I said that uh this is like the canonical way of running it but there are a lot of things going on in like the staking like part of the world well like she said if you want to learn more about distributed validators go ahead we had several great talks about it here at Devon Yeah we actually had a conversation about it yesterday so don't it didn't take too long for someone to bring up distribute about day I like it um okay I mean keep the questions coming um it's really important so now like we finished the configuration of our Lighthouse client um we can actually jump into like running our Docker container um so basically I I need to um you know do Docker run I expose the port um and then I mount um I mount my configuration into the docker image so it's accessible within um within Docker and then here this command is important like valid dat client because Lighthouse offers um it actually offers also to run the beacon node and valid dat client in one process and but here obviously we want to kind of like split it up running it separately because we we want to connect to a synced Beacon node um lias also has this like um argument in its slashing protection so what it will do is um it will kind of like set set up a slashing protection database um I what I have to point out though is that this only works within your client that you have running so if you have like two Lighthouse clients running then this uh slashing protection this internal one doesn't help you um we specified a network um we specified a beacon note that we want to connect to and then I need just this validated steer argument to tell it okay this is where my configuration lives um so then see I'm pretty sure I've done this before I just see if I have this command in my history I don't have to type it all in um this looks good actually from my point of view so I'm going to try and run this um and hope it works okay so what's interesting here in the log okay yeah we want to run this for pra that's really important um oh W now it's going quick um this is my yeah it found an enabled validator in my configuration um this is the voting public key we can quickly check if that's true yeah exactly is the one we configured um what else is interesting ah yeah this is really important it connected to the beon note um if the beacon note wasn't sync then you would see this in here um it would tell you like the beacon note is out of sync um and now yes this is also very good news so the validator that of U running that are running is um known to the bacon chain so that means we actually made the deposit already and it's active um yeah and this is our valid dator running um now to show you kind of like a proof of this um we're going to go to Beacon train um probably like the one of the very famous uh tools to kind of like analyze your validators um I'm going to copy paste my public key and now okay now it shows me some information um here you can actually see like the the statuses I was talking about um so when we made the deposit um it was in the deposited State then when it was like queuing it was like in a pending State and now it's active and the reason why it's red was is because um I I wasn't I wasn't the key wasn't running anywhere so I only just started uh the valid data client with this um with this key um and this is why it's uh leaking so if you're if if you're like like this is why validator up time is so important because if you don't ensure that your valid dator is like running you will lose some of your deposit yeah I think you can show in like the attestations yes exactly um you would see that we were missing ATT stations because we were offline oh look it already oh we already attested on okay since since started running but yeah you can see we had like a lot of missing attestations because we were offline but yeah cool uh that work out perfectly we are attesting um is there anything else interesting we can show in here um maybe can you um I don't know yeah question can you pass him the microphone please uh yeah no since you guys had asked um anything interesting so one thing that we um I've been paying more attention to I guess most validators probably will pay to attention to it to some degree is the effectiveness rating um I don't know if you guys have already um talked about that but that can affect the um the degree to which you receive like the full amount of a reward for a testing or producing a block um just yes kind of measures how like the latency or how late you are in terms of being able to test um the network yeah I can't see what it is right now cuz I'm like kind of blind but what is let me see it should be out the top yeah effective effective this rating okay yeah I think it's 90% no is it this one no no 50 50 it active 32 oh that's weird yeah I actually don't see it we can we can look for it maybe we'll find it yeah give us a minute and we'll find it yeah um but I think this is like this kind of concludes the demo um if you want to kind of Clone the repo no no don't absolutely don't be sorry sorry actually this is what a workshop is for like if you want to interrupt us absolutely so I just want oh okay yeah um yeah I guess I forgot to mention also something that is kind kind of important when I mentioned like H the four Choice rule when I went into that point so basically what you're attesting to is the blocks so you propose the block very rarely but everyone should be attesting to like the blocks probably all the time like you would want to have like a 100% attestation rate like it's a little bit common in in now inov stake uh it is like the the analytics show that it is a little bit more common to to miss attestations but yeah you should be attesting each block and voting and the reason I mentioned like the First Choice rule is because ethereum is has this rule of not like for example something like Bitcoin which is like the longest chain but it is the chain with the most weight and the weight is measured in attestations so for example if you had like a different choice between like two forks and one of them them weights more like has more attestations added or yeah they're like cryptographically added I guess um then that is the chain that it would ch uh you is there a way to withdraw the staken Rewards or is that also locked till the Shanghai update yeah so like I mentioned there's two kind of rewards like the execution rewards you get them in your wallet and you can with withdraw them like immediately from the fee recipient address that you you decide so those comes from like the different like transactions so the transactions that you add inside the block they have like a tip and you get those those tips and and also maybe something more complex like Meb like that also goes into that and then the consensus one are the ones that are locked and cannot me and those are added to like the balance so for example you can see there can you see yeah the balance says like 32 point something if but you what you added what you deposited is is 32 so you already earned something there but you cannot move it yet and eventually when withdrawals are enabled there will be like only two options like do like the full withdrawal so like all of the all of the basically e that you have or like just a rem like what is above 32 because you should always have like the 32 okay to specify so the wallet address you entered earlier but you had it in the editor that's the one where receive the you will receive the execution rewards there yeah and you can move the frequency how often they're paid out I mean it really depends because it is like the byy one you uh propose a Blog and that is basically random so very hard to I mean you could like analytically say that for example you propose a block like once a year or something but yeah that would be like a curve like yeah you you propose basically randomly romly chosen thank you you're welcome okay okay you okay you first and then you okay okay um because you have the microphone question at one point you said like the you were mentioning the difference between like the Bon node and the validator the validator client um you do need a validator client to like uh sync with the rest of the of the of the consensus uh B2B right yeah the the client needs to be connected to the beon node yeah and this is what um I actually configured when I let me show the command again when you went to the yo yeah no actually when I started the DOA container um I had to SP specify the beacon note that I want to connect to and let me if I can pull this up again I can show you um and this is really important because I like if we don't have this the valid data client can't can't run so um it's actually this bit where I specify the beacon nodes um and otherwise you wouldn't be able to start I I mean could you have like one beon node and run like different validator clients inside it yeah you can connect multiple valid data clients to one Pon note okay yeah I think most clients allow for that but yeah definitely check the documentation but I think most of them allow for a different Bon chain and Aon validator C but at this point like during this Workshop we didn't spin up the like the Bon note like you had it beforeand exactly yeah yeah um because because it just takes a while to say got you okay thank you so two points I believe you were asking about sying right between so I think the execution client and the consensus client need to be synced but like the validator client need be need to be connected right not yeah yeah and the second thing regarding ATT station sorry and to add to that yeah they are sync because they are the parts that are actually connected to the peer-to-peer Network so they have to sync to all the blocks just yeah and regarding attestation as to what I know each validator need to attest once each each Epoch right like each 32 slots each slot yeah each 32 slots the validated has to attest only once mhm right each EPO you say yeah I think well I think the they have these things called committees and yeah basically yeah to get a little bit more complicated yeah 128 uh validators are chosen each slot to attest and these committees are like rotating so they rotate between because it would be it would actually it is already kind of hard to to reach consensus in time with the amount of validators that exist so there needs to be like H other models to like aggregate the different signatures and one of them is like the same committees that it is what she's mentioning yeah you are right hi uh I just got a quick question sorry quick question uh where's the execution client running I mean is it running with the together with Theon node uh in this setup or yeah like the the execution client um we have um we have running um somewhere you you wouldn't you wouldn't see it because like the beacon noes is um connected to this exe execution client and Beacon node is basically what we make available here yeah okay is running on cus one yes exactly corus one infrastructure I think you can show him the the picture in the slide so they can have like the full full look at the architecture of a node that is what a node looks like okay like a full node you have the vono the execution engine they connect they talk to each other so we have yeah we have both of them currently running on course infrastructure and we just connect to the pick not with the validator client is it you would be then talking about things like latency for example if they are like two separate you could fall into a situation where they don't communicate in time so when you are like trying to I don't know propose a block and you go into the consensus you missed a slot um it definitely would depend on like the capabilities of your machine to do so um but yeah you definitely have to like take into consideration like things like latency and uh yeah the the capabilities I think actually also one point um let me go back to this uh how to run this uh Docker command you can actually uh connect to multiple Beacon notes and this is sometimes uh recommended um just to have some some kind of like failover to make sure you're like connected definitely connected to a beacon note that was nice that was like really nice uh questions yeah thank you um what what are we going to do I think are I think so yeah actually oh maybe maybe one point um that might trigger some conversation um maybe like having walked through the stemo maybe you're noticing some kind of like limitations um with this like setup um a few of them kind of um I think are obvious like we we have you know we like configured the local key storage can be maybe a bit dangerous if you just have like your key store locally with the decryption password um what you could do um to kind of like improve this you could actually store them in bold in that case uh they're also usually backed up um also because we're just running like one validated client um we are really dependent on the lighthouse software and this exactly what Gabriel showed before um we saw this actually with with um prison like a few months ago like they had like a lot of validated clients where like like prison was kind of like represented and the problem is just like if there is really like a bug in the software um it's just it can become really tragic for for ethereum for the network because it could be that like the the chain can't finalize and this is why um client diversity is so important um just so if if there's any errors uh the network can survive and then um something you can explore in the in the exercises is um I already talked about the sessioning protection that lios has if you if you're actually running like multiple instances or multiple clients this won't uh serve you um so there's one exercise if you like again if you're feeling V uh you can actually use a remote signer um and if you have like multiple clients you connect the remote signer that would um um also enable like slashing protection yeah you just mentioned the like the key management part um if you could elaborate a little bit on like what you see um people actually do with their keys um and like the good and the bad and then the second part is from what I understood is basically these two Json files uh it's all you would would you need in case your computer that you're running a note will be stolen or burns down or whatever um so it's really as long as you have those two files the hardware doesn't really matter is that correct um you mean like the deposit data and the key store Json right yeah these two Json files so the deposit dat essentially you just um basically needed come like to make the deposit um and the keys um as long as you have your memonic you can regenerate them that's true so if you if your like Hardware is broken then keep your memonic and you can regenerate from from there and then spin up the note again because as long as it's offline you can spin it up again and then you should be good exactly yeah okay yeah and on your first question one of the things that I guess it's not an issue but it is important important to note is that you always need to have like your private key online so you cannot have it like offline like store securely in like a bol you need to keep it like online so that they they actually H the network can connect and you can actually sign but like she said there's these Solutions like the remote signer and yeah other like different kind of solutions where you can have it like remotely or store somewhere or yeah they they're like a lot of things you can do in terms of like key management and it is definitely important I mean I've known of people who have like their key freely on their computer like just signing like that and yeah it's definitely like a security risk even if you do have to keep it online or at all times okay thanks again so much for the questions gone so um pgy backing on what you were just saying about uh like a best key practices like is is um uh where could we like uh do you recommend any sources where we could read more about this and uh like those uh best practices security I'll find those out for you I send them yeah thank you there's like there's one section here um which goes into like remote signers y um and if you like open this up like one example that I give is um web free signer which is fairly like it's um kind of a famous product actually so if you go into this link um there's also like good documentation because with um with this remote signer um I don't want to go too much into it because like you can like read through this like now um but there you can I think it supports um storing your keys on either HSM or in the vault um or locally okay and um let's say that for some reason like those keys were compromised uh is there anything I can do or I got direct what what do you mean compromised uh compromised as in uh someone you gave them to someone please don't no uh like I connected my uh laptop to the HDMI of the New York uh Time Square screen you connected the same computer where you're staring your keys on no no let's see uh I don't know like everyone in Deon had the had those keys like they are completely compromised yeah I mean if they're compromised I'm sorry you just got wrecked yeah okay sorry and um last question was now that we went through all of these like this is uh the manual setup right let's say I have my own Hardware I set this up myself what are like the pros and cons versus using something like uh stum or DB node or any other like uh simple UI i' say I mean yeah those Solutions are pretty cool like they already come with like the pre-install software so you don't actually have to do like anything of these that I've just just shown you and yeah I I personally think that there are good solutions for like first time stakers or anything but yeah I think you get a lot more customization through your setup uh by doing it yourself and configuring everything and yeah that gives you like a lot more flexibility into what you can do with it with the with the node um also I mean the purpose of this is really to like share the knowledge um because um this this trend I think this trend is like good to like make sure like some like a lot of people can run notes but they also oversimplify um which can also be a bit dangerous um so I think it's like definitely worth worth learning worth understanding like the underlying kind of infrastructure um and with this if we if like more people actually customize the setup then we would have more diversity because the why we end up with no diversity is because everyone runs the same product and they run the same notes yeah yeah um I would say on like the key management stuff like at coinbase what we would do is we would import the key into like an inmemory embedded database so that way you don't have to have it like you don't have to store it like um on your disc so you could import it from like a vault like I don't know like Hashi Corp or something like that if you set up the remote siger with web 3 stuff that consensus has you need to set up a a postgress database um one of the ways that they manage risk around key like let's say you lose your key um what they would do is that we have pre-signed messages with uh the ability to exit so like if things got compromised you would have a pre-signed message message that you can just submit to the the smart contract to exit so you could also take that approach yeah that is a good approach I think it's always like a good thing to have like a database when you uh store what is happening with your noia s so uh I think these These are the signer keys right that is separate from the withdrawal key correct yeah so so the risk that he would have if his keys were compromised is someone double signing and then at risk at uh being slashed okay that part I have correct yeah what would the withdrawal I know it's not available yet yeah but what would the withdrawal process look like when we're ready to withdraw some of our excellent question I mean that is to be specified by uh the ethereum foundation and yeah they did like this whole discussion I think it was day one or day two where they went into like the different possibilities for specifying that but yeah that spec is not ready yet waiting waiting um any more questions honestly I'm really I'm really enjoying this um it's been really nice conversations um I guess the the idea like if you go to the repo and you answer this key Stores um we have like 16 Keys pregenerated already deposited and active um I would say you just choose randomly whatever which one you like and then if we're really lucky maybe we get um slashed I think it would be like that that's the worst thing that could happen is that we get like slashed heavily um because you're using probably people will use um the same Keys um but I think that would be quite exciting exting to explore actually and you all have this right like you'll have access to it everyone has access to the repo um then again I'll unzip the key stores and you can pick one of them um which you can run you can run a demo and just continue if you have any questions just uh give me a shout um happy [Applause] to yeah I think I think okay you have a question okay yeah but this is like the time for you to like do what we just show you and see what happened like anything could happen right now yeah uh so you didn't cover it specifically but you mentioned you showed the like set up your own validator demo uh site that they have set up I was going through that and it was everything was going fine and then I saw that they wanted me to like uh do Port routing on my home router which was like opening ports on my computer to the general internet and that freaked me out wasn't comfortable with that um is that necessary to to be why did you say was that sorry um in the in the um not yours but the like how to set up your own validator website I and it say staking launch pad mean when you click through it ah yeah so in in that one of the steps is to go into your like home router and open ports on your computer to the general internet and that's it um so the only way is it somewhere here the only way where this uh kind of like would make sense is like for the for the um Beacon nodes to sync MH um because usually what they do is um I mean either like you configure it that you have like checkpoints but usually they like really like try to like you know find other like notes to kind of exp makes it easier for them to find more peers yeah okay I'll say so okay but it is not NE so there it is the third Che I forwarded the necessary ports to the correct machines so uh I guess yeah so it's not necessary to become a validator it just makes it easier to find peers um I mean to be honest like now I'm not so confident anymore I think that means like opening the ports for like the connection between the E and the CL like between themselves does it says like connecting to the internet I don't see it okay so if I if I'm running my e and cl on the same computer then that is not necessary that would make sense because then you don't have to open a portra right yeah that makes sense yeah okay only for okay here thank you oh can you answer the question yeah okay he has the answer let's see so um it's not technically necessary but um we've run many different types of nodes over the years and you will fall behind the synchronization [Music] it's me for simply that that the peer-to-peer network works you need lots and lots of connections and if you don't have any incoming Port means you will have outgoing connections that will bootstrap and you will sync the chain at some point but um the the incoming connection uh pools is uh like a scarce resource on the network and the longer you stay online you sometimes get blacklisted by other notes and there are many different things that can happen so usually what happens is that you see like you have uh start with eight connections and then it goes down down down and you have one and then you have maybe zero then it tries to St again and then you fall behind and then you will miss some atation so it will perform worse um and um I don't think it's uh uh that uh critical I think the most yeah the free o303 um that is the most uh important one to have opened um because uh um that is the majority of the data that needs to get pushed through the other ones the 9,000 is uh sort of less I'm not sure I always open both but I think the fre or fre or fre is the most important one good so like like it's that's exactly right those peer-to-peer ports are necessary for finding other beacons to communicate too you need those to broadcast your messages and then also like you know to sync as well and and um the way that like communication happens to your clients is like it's it's going to reject something that doesn't match the spec so like you know even coinbase has those ports open so like you should feel comfortable having them exposed yeah I get your concern but yeah I think maybe that's where talking about network configuration if you are if you are in a hosted environment what you absolutely must do is set up a local firewall um for for outgoing connections okay because if you are in any sort of hatna or AWS or other environment that monitors for a network attacks you will get your service contract cancelled if you just leave it open like that because in the in the payload of the peer-to-peer Network people are injecting weird stuff like uh not not uh not assigned IP addresses and so on your note will try to connect to those and that will be seen as an attack and actually I had to do that multiple times to restore my service contract with them so this guy runs nose yeah that's why that's why I invited him to the talk in case I couldn't answer answer any questions thanks so much sweet so so to continue what was being said about the ports I'm actually a lighthouse developer and I handle networking so the thing is that when you start your node you connect to some peers but on time you're going to be dropped because they're going to prefer some other peers or I know maybe they're going offline doesn't matter you need incoming connections and since in networking we are forwarding let's say like information about one peer to other peers so that they can connect between themselves um it's likely that your information if you don't have ports open it's not going to be forwarded to other peers and even if it is because I don't know maybe it's wrong and you are claiming to be reable from the outside they're going to try to reach you and it's going to fail um so yeah it actually makes you vulnerable to attacks not having ports open in that way because you need to have P diversity exactly thanks a lot thanks nice to see a lot us develop yeah cool who is trying like who is doing it to see you you nice are you guys trying sweet do you find it difficult or what is going or we have we have a question okay we have a question sorry is there some place you know know for the shortcut you didn't show how to do the execution client and the modde is there some place where um I could see that that part of the process like do you did you make a video of it by chance or uh like how we set up the execution client yeah I would like to see that um no sorry no player clients they have um documentation on how to go through the entire flow of setting up the execution layer um as well as consensus layer client so I mean in case yeah reference also Co cashier there's a bunch of resources on [Music] well um so you wanted some more information about slashing is that are the two main things that well the two really big rules that you have to follow are no like you said H double signing so if you have like H these Keys running on a certain infrastructure make sure to exit that infrastructure before you decide to deploy it somewhere else and the second one is called uh surrounded boating and this is like an attack uh tactic uh towards like trying to change like the historical data in in ethereum basically trying to change the past of the network yeah and those are regarded as like attacks on the consensus like they they affect that part so that is why they are like regarded slashing conditions I mean you can have that uh you can set up like a do we have like a database for like um the slashing database basically kind of like records who's currently um um proposing and um also like with this uh web free sign up product um if you have like multiple instances of it running it would usually that connect to like one kind of like Global uh database and by like by database locking um it will always kind of like update like who's currently um like you know signing which are the stations um to avoid uh double signing so like if one key is like currently like doing something then a second key like actually the same key running somewhere else can't uh access it sorry a small no I mean I I guess yeah I mean it's like this is like how you like you know record the state and make sure like kind of like lock someone else's um to like make sure that you have like aard process um yes we mostly pretty much 100% tested and and operated with running um uh the same client type for both the beacon and the validator node um have you guys tested running like a prism validator against like a lighthouse Beacon node um those different combinations I know the EF Foundation um they they have they test different combinations but mainly between the execution layer clients and the consens layer clients not between the two execution layer client components yeah like um yeah we totally we totally tested that I think we we still um I've heard from a few clients like still preference um to like uh kind of like black house Beacon note with black um sometimes we like just to ensure kind of like up time um you want to configure multiple Beacon nodes um and there like you have the option like generally like so far it's worked it's worked fine actually I think um I'm pretty sure that this Beacon node is a TECO Beacon node and we just connected to it with a lighthouse client um so that's that's one test we run just now and to the ones that are trying if you go into any errors or you find something cool to show definitely share maybe now it's time to start some elevator music some launch background so they they play music at some of the this thing yeah like exactly awesome [Music] amazing andone thank thanks a lot for coming I hope this was like really informative uh we definitely want to you know promote everyone that if is possible to run run a note you don't even have to run like a validator note you can also run like just a H full note without that does not validate uh and those just keep like the consensus going so yeah I think that is possible even if you don't have like the 32 years so yeah thanks
