Tales from Interop

ETHCC 7 · 8 Jul 2024 · 20:31

Parithosh Jayanthi, who works on the DevOps team behind Ethereum testing, looks back at the third Interop event, where core developers test upgrades together, and how it shaped Pectra. He explains how the team used Kurtosis to let around 100 people run local devnets from a simple YAML configuration, avoiding DevOps bottlenecks and a shared Wi-Fi uplink. He describes importable Kurtosis packages, including an Optimism package that spins up an L1, and says adding OP Nethermind took about an hour and surfaced config bugs. In Q&A he says the team is focusing on happy-path tests before edge cases.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

He's going to be talking about tales from Interop. Hey, V1. So to just to give you a bit of an introduction, so Interop is an event that tends to happen one time every fork. We started this with the merge and it's continued since. This is the third Interop event. It happened in me, so I'm going to be talking a bit about how we went into Interop, what we planned, what the outcomes were, and how Pectra is looking as a result. So the first question we had was how do you prevent bottlenecks, right?

Because there's an insane number of EIPs coming in, and we have a finite number of core devs working on them. We have at least three to four streams that are actively worked on at Interop. So we had Pectra, we had PiaDas, we had Virkle, and there was also a Virkle pre-transition, Virkle Transition stream, and so on. At some point you kind of need access to the same resources, and we don't want to create artificial bottlenecks because the event is really high value otherwise. So we had to ask ourselves what does a dev actually need for interop?

What do they need during that week? What are they trying to achieve? And the first answer we got was they needed a simple way to run a client. By simple way to run a client, uh you might imagine, hey, they're client devs, they need to learn how to run clients. You'd be surprised, they know how to run their own client, but we have uh five CLs and we have five ELs. If you ask uh geth dev how to run uh Reth node, uh they're gonna be able to do it, of course. They can read docs and do it. But this is an event where they should be focusing on Pecktra. They shouldn't be focusing on how to run the other clients, right?

Um that's something traditionally that the DevOps team has been handling. Uh but if we have so many people and so many EIPs, we can't do this for everyone. So we had to find a way to codify how clients are run. And we needed to make a way such that they could run it themselves without needing to talk to us. So this needed to be local. Another needed reason it needed to be local is there's 100 people on one uplink for the Wi-Fi. So it's there's a bottleneck there to begin with, right? And they're gonna need some way to know what the chain is doing.

Uh is it actually progressing? Are the blocks being produced? Are the transactions going in and so on? Uh it saves them time from reading the logs and figuring out what's going on. They need to have a way to stay up to date with the progress that other client teams have made. So if, for example, there's a new fork, there's a new branch, they fixed the bug, they need to be able to pull the release and run it against their latest version. Uh they need to be able to see what's going on and test the features that they're implementing. So it doesn't actually help us if we say Pectra is done because we never actually tried any of the EIPs that Pecktra was actually implementing.

So we need a way to actually do that. And we also need a way to collect debug data. These are the first dev nets. I can give you like a hundred percent guarantee it's not gonna work. Um almost never works on the first try. So we've been working on Kurtosis for about a year and a half, two years. I think it started around the merge, and it's gotten to a stage where we were confident going in with uh to the interop event with uh, hey, there's gonna be a hundred people using this. Chances are they haven't even like installed this before. Uh, we're gonna have to support it, and we're gonna have to make this work.

Because that's the only way we could think of that we could actually parallelize testing. This would switch the focus heavily to local testing. So you can give a config, and any dev is able to run this config on their machine, it gives them a devnet, and uh you can override whatever values you want to override. This removes the DevOps bus and bottleneck. Uh it's YAML, so anyone can read it. It's quite obvious what it's doing. Um, we tried to simplify it as much as possible. And this uh Kortosis already included all the visualizations and tooling that we were interested in.

Since we've been running it ourselves in the team, so to give you a bit of a background, so for the Dinkon fork, before we launched any DevNet, um, we ran through the DevNets locally. So it might seem suspicious that every DevNet was relatively successful in Ding Coon. Uh, it's because we knocked out most of the bugs that we could locally, and whatever we um didn't find locally is the other ones that you actually see on-chain. And we also found this, oh, sorry. We also saw uh found this as a um much nicer approach because if you're doing something locally, the dev cycle is really really fast. Another thing uh we kind of anticipated is if you have a hundred people pulling Docker images, you're gonna get rate limited very quickly.

And these images can vary between 20 MB to a couple hundred MB or uh a gigabyte, right? So we brought a Docker cache. Uh I can highly recommend Harbor in case anyone's interested. Uh it's a tiny Nook. We just threw in an SSD in there, put in a Docker cache, and brought it there. And all we had to do was change our Kurtosis configs to say point to the Docker cache instead, and then we got a pro Docker hub account to get around the rate limit, because otherwise you were hitting rate limits on the IP address level. So the entire stack, by the way, for Kurtosis is completely open sourced.

The tool, the engine, the configs, how you run Ethereum nodes, all of it is MIT licensed. Please have a look. Anyone can fork it. It's kind of like you have a definition for how something needs to run, and then you can run it either locally or you can point the engine towards Kubernetes, in which case you get a more production workload. Now that solves the first half of the question, right? So clients are able to then run a node themselves and they're able to run other nodes themselves on their machine. How do they actually ensure that the changes work?

You don't want to have like a bunch of scripts that you tell them, hey, run these scripts or log into a MetaMask and make this transaction. That's just too high a friction. So enter a new tool, Aserter. I don't think we've used Aserter in mainstream testing up until the interop event. So it's the first time a lot of client teams actually looked into it. It's a test assertion tool. So you tell it what you want it to do and how you expect the network to behave at the end of the test, and that's what it asserts. If it fails, it shows you a nice X.

If it passes, it shows you a nice tick. You can trigger this via the API, there's a web UI, there's all the nice stuff. So it's quite obvious to know if your network has passed or failed. Aserter is already built into Kurtosis for the Ethereum package at least, and the tests are just links to GitHub. So while the client teams were fixing their stuff, we could just update the tests on the side, we could generate new ones, we could just increase the size of this YAML file. And as long as clients were running the latest YAML file, they were pulling the latest tests, and we were sure that what they were doing actually was testing what they were implementing. And you could see at the bottom over here, I've just put a tiny snippet.

So if, for example, you set run stability check is true, what it does is it waits a few minutes and then it checks if the network is finalized. If you say run block proposal check is true, what it does is it checks if every single validator on the node has produced every single validator client has produced at least one block. And all of this is really important because it might be that your attestation code is working, but your proposal code is broken or the other way around. So we want to set all of these things to true so that we're actually going through the processes. And you can see a link to GitHub over there, and that's the all opcode test.

So all it does is it calls every single opcode. And for example, if a client has implemented it wrong or they haven't implemented an opcode, you'd easily catch that. And from a perspective of a client dev, they don't actually need to know what's going on. We just need to tell them that hey, these are the tests we verified and this is what needs to work. And the outcome of this sort of local testing as well as automated assertions is that interrupt tends to be a five-day event, and we already had DevNets on day one. Um, this is about two days earlier than the last DevNet.

And for context, the first time we had an interop event uh that was during the merge, we had the DevNet on the last day, about five minutes before we ended the event. So we went from doing this at the last possible moment to being able to do this on day one, which is an insane unlock because you're no longer spending time figuring out how to get interop to work, but you're figuring out what tests can break. And hey, if this broke in this particular manner, maybe we can sit down and talk about what we want to change in the EIP. Um this changes the focus. You focus on more advanced conversations, you focus on things that actually are really valuable to do in person.

And we had three concurrent testing streams this time. So we had Workle, Piatas, and Petra. Um, each of them had different client teams working on them at different levels, and they didn't disrupt each other. They were able to progress quite well together. Uh, with about a hundred people, you can say roughly a thousand dev nets were performed. This is just mental math. Um, definitely impossible with a team of five DevOps engineers. We would have spent a whole week to probably get 10 DevNets up. Uh, we did find a bunch of bugs, and the nice thing about finding bugs at these events is that you can also write a test for it and just add another GitHub link.

And then suddenly you have a nice way updated during that week to catch that bug. And I think I think uh the DevOps team was kind of bored on the day one because uh we we went into this with a lot of planning and with a lot of uh preparation, and we went in expecting a lot of things to break, and nothing broke. So we were like, shit, okay, we have all of the scheduled time that we, I guess, talk about stuff or write tests. Um there's a there's a nice picture of everyone on there. Uh it's a great event. So uh just a bit about what's next for Kurtosis, because it is an interesting tool and would be amazing to have more people uh using it as well.

So we're focusing on uh improving and promoting the import functionality of Kurtosis. So everything is a module, and every module can be imported and you can build more complex applications. So a simple example is we have Ethereum test nets defined under this package called Ethereum package. So all you do is import module and point it to GitHub, and then you can build around that. And this Ethereum package variable that you see on the left has the RPCs, it has pre-funded wallets, it has links to the tooling, it has everything. You can, if you have some sort of autocomplete or an IDE, just hit dot and you'll see like 50 things that you can access from that variable.

And as you can imagine, this is great if you're building tooling, explorers or whatnot. And in order to showcase how useful it could be, we uh did an example implementation with optimism, because uh as an L2, you kind of need an L1. Um in this way, if you just run Kurtosis run optimism package, it spins up the L1. And no matter which fork we're on or what updates we do, the person maintaining the optimism package doesn't need to know what's happening in the L1. They can just expect that an L1, a healthy L1, will be launched with funds existing at uh variable um name.

And they can focus on the L2 integration. They can focus on L2 tooling, they can focus on um whatever they want. And a simple example of how much time it actually takes to do this. Um the Nethermind team has a package called OP Nethermind, so it's an optimism client that they have. And I just asked, hey, is there some way to run this? They showed me a Docker image and they told me what flags I need. It took me about an hour to add OP Nethermind to it. We found three, two config-related bugs that they had, and we found a way for them to test how to do their sequencer logic a bit better. And like this is perfect for them.

And we're also working with the other optimism clients to get to get stuff up and running. And this is just an example implementation. We're hoping that there's a nice L2 environment where you have the shared testing system. There's already an overarching L2 package. So you could say, hey, I want ZK Sync, I want Arbitrum, I want Optimism, and it'll call the respective packages, and you'll have this environment where it kind of replicates what Ethereum mainnet is like. You could even have MEV in this world. The pre-confirmation guys use this as well when they were getting their DevNet up two weeks ago because they could just import the L1 and actually focus on the pre-confirmation logic.

So it's great from a perspective of, hey, I want to prototype something and I don't want to overload myself with understanding how the entire stack works. Let me abstract it. And as an overview of what Pectra testing looks like, I don't think anyone from the EF testing team is here, but they're doing amazing work. And we're gonna let them do amazing work because what we're doing is we're changing the paradigm a little bit. So this time we want to focus on the execution spec tests. And the execution spec test format is written in a way such that both hive, which is their determined the testing team's deterministic test framework, as well as asserter can import them.

So earlier we used to need to write the tests twice. So the testing team as well as the PandaOps team had to define the same tests. And by changing this paradigm around, we can all focus on writing tests upstream and just consume them everywhere. We might consume just a subset of the tests because we're not a deterministic environment. And they might consume the entire portion of the test, right? So this is gonna really really speed up pectra testing for us. The teams also have different competences, so we focus on probably more on PeerDAS, whereas they can focus more on EOF. And at the same time, we're both leveraging each other's competencies to make sure that the fork we ship in the end actually works really well.

So we're doing a lot of test changes in the background to make things better. And there's also another outcome that came out from Nyota. We realized that hey, we're kind of doing the same thing. Let's let's fix this for the long term. Clients are still deep in implementation work. There's a lot of EIPs, it's touching a huge surface. We've started testing happy paths. So if you check the ETH RD chat, uh there's a channel called Interop, and we're posting what tests work, what tests break, which clients are ready, and so on. Um there's some changes for EIPs like 7702, PeerDAS might still have some changes, so keep a lookout for that.

Um EOF is gonna be integrated, at least as the plan is right now, in the next DevNet. And um clients are currently using uh EOF's generated tests to check that they're actually implementing what they should be. And as at the moment, we're keeping PureDAS as a separate DevNet cycle from Pecktra, purely because we don't want to confuse PeerDAS bugs with Pectra bugs, and it's easier to test and fix in isolation and then merge them in later. And we're looking for ways to engage with the community. So there's a lot of changes here.

Mac CB for one, EL-triggered exits, and we really need people to understand what is going on as well and how the paradigm is changing. So Eats taker is the perfect avenue for that. And as a side note, please check out the Denkun retrospectives. The fork went live about three, four months ago. The guys from Megalabs, for example, have a great three months into the fork explanation on what's going on in the network. A lot of this data came from this tool we've been building.

And please have a look at my uh talk at I think Istanbul if you want to know more about Zatu. So it's this peer-to-peer data collection tool we've built, and uh the Mega Labs guys use this tool and the data sets to analyze what's going on. Uh the data sets are now also completely public, so anyone can download them, anyone can make do your own local analyses. And we're working on big query integration because we've been told a lot of um data science people also like that. Um I don't have much time, so I'm just gonna quickly go through this one. Uh here's an example of what you can build from the data set, um, weekly variation and how long blobs add delays per block.

And what next? Uh get involved in pectra testing. Like I said, the there's a lot of changes happening. Please help us communicate the changes better. They're confusing even for me. They must be insane for anyone who's not uh paying attention as a day job here. Um and especially application devs. Uh, if we're breaking something that you're building, the time to speak up is now and not once we schedule the fork and it's happening in a month. So please look into EOF, please look into uh all the changes that PECTRA is making and start getting involved today. Especially also wallet devs, please.

Uh account abstraction is a huge change, and if we're breaking stuff, speak up now. And uh I couldn't figure out which urge we're actually testing, so I just made it testing the urge right now. Um I think we're touching like two or three of them. So yeah. And we have a nice website where we publish some blog posts once in a while. Have a look. Thanks. We could probably do one quick question if anybody has one over here. Hi Perry, thank you so much for the talk.

Um, so Pecktra for is kind of um for the first time ever, like devs are layering on top a bunch of code changes, and every devnet is changing in terms of what it includes in pretty major ways. Um how do you think that's gonna impact um upgrade timeline? And how do you think that's gonna how does that change kind of the concerns or the thoughts or the processes that you have for testing these upgrades, if every single DevNet is changing and if you're now layering on top of like the PetraCore, like EOF and then PeerDAS, and then I don't know, something else. How do you think that changes kind of your thoughts around the testing process?

Yeah, I think one thing we've tried to do is stick to hey, these are the core EIPs that are going in for sure. And here are the things that we're still not necessarily sure of. Let's include them in a dev net, let's see how things are working before we actually commit to it full time. So the way we're working on it is we're making sure that we have the testing framework ready, but we're not actually writing all of the exhaustive tests that we need to. Um, because that would then be wasted time if in case it doesn't actually go in. So that's why we're focusing very much on the happy path testing right now.

And then the happy path I'm hoping would eliminate a couple of EIPs, or it tells us that, hey, this was easier than expected, let's do the whole set. Um and that's when we would deep dive into edge case testing. Cool. Thank you so much, Perry. Can we get a round of applause? Thanks. Um we'll take a short two to three minute break and then start the next presentation.

Related talks