eth_multicall Meeting, Jul 15, 2024

eth_multicall and eth_simulate Meetings · 15 Jul 2024 · 27:22

A meeting of the developers working on eth_multicall and its successor eth_simulate, held on 15 July 2024. Client and tooling teams compare implementations and work on the specification for simulating transactions.

Topics

From eth_multicall and eth_simulate Meetings, hosted by Ethereum Foundation.

Transcript

then let's begin and I'll be able to like DM Lucish with the presentation details if he would like to add anything specific. Uh all right. So currently the idea is to give a brief overview of what if simulate does and then to focus on like particular implementation details core developers can potentially struggle with so that they would know what to expect and where to look at. And uh this is a draft presentation. I would very much like your input and your comments.

Uh, however like rough they would be, it's good it's good to update it as we'll present it on Friday. So, we have quite a lot of time to change it in any way that you would see fit. All right. So if simulate is a new RPC method that we want to introduce to allow users to have ability to mock multiple blocks and multiple sets of transactions on fork basically forks of a chain that is happening now or happened sometime in the past or would happen sometime in the future. We allow users to take any block header they want to start from, set what kind of blocks they want to create with

what amount of transitions, transactions, what those transactions should actually do. Users also allowed to set state overrides. They can override states for contracts. They can override states for accounts and states are not the only thing they can override. Also they can override pre-ompiles so they can redirect them and change them for some other code they want to use. Basic idea and use case for it is that you want to see how a contract would react in some amount of time or some amount of blocks from now and to be able to actually do that.

Currently you have no utilities besides spinning your own chain and doing some magic that would basically do same thing that we are doing here. But here we are trying to do this in more professional and uh integrated way so that everybody on any client would be able to simulate and mock what would happen on chain if and then there is this large if where user can define what transactions what balance changes what state overrides would happen during these blocks. Every block can have state overrides and every state override can change uh basically anything that happens on the chain and is stored on the chain. So

it enables much more than we currently have with this call. It allows users to get the mock that they always wanted from the system. And the only like uh application that is running and available now that we found was this beautiful uh interceptor demo. It allows you to swap uh to see what would life be if you would become for example Vitalic Buterine or somebody else with like a lot of money on their wallet uh to be able to Hey Lucas so we are doing a like presentation draft discussion today. The

idea is for you all to see the presentation that is currently created. It was based on Kilaris one and it is expansion of it. Uh it is focusing for Ethereum core developers probably. So all the input would be greatly appreciated and we will have four days to update it. So yeah, basically the interceptor is a nice application that allows you to feel your feet in in the feet of some other users to feel how it is to have a lot of money on chain and to play around with contracts so that they would think that all the transaction that you are performing with them are real. So

basically it allows you to mock uh not test chains but mock what happens on the real uh mainet of Ethereum and that uh that is great. Um so implementation details uh in simplified form we take user's input in form of a parent block he wants to utilize his desired state updates we create a header with that after that state updates and with the parent block in mind we utilize desired user transactions fill them in test them if it goes all right we fill the block with them and we process a block and commit a new state and we go through a

loop Uh this is basically would be nice if would would happen only like for one chain of uh sort that usually happens on the like Ethereum mainet but in our case this shall happen for every user that is calling our RPC every time. So for every user we basically fork the chain create a new like spin up from the chain that lives only in memory. It takes that block as base and all that happens after that is this like subchain a branch of a tree.

You can imagine it something like that that happens and possesses whatever a user wants to uh do on the chain and it's basically turning Ethereum client into something like a multi-tenant application which can allow many many universe versions like a multiverse. So it's quite fun. Uh let me see uh yeah from the system design standpoint in at least our client and I'm representing Nethermind. I'm one of the co-developers that were developing this feature and is currently supporting it uh is simulate uh and uh our design philosophy was relying on two basic pillars. First one

were on disk databases and the second one was inmemory temp storage which contained freshly blocks not yet synchronized onto hard drive. It contained a lot of stuff that was basically uh not synchronized until some event happened or some amount of blocks were like chained up to be ready to fill into the hard drive. and over laying on top of those kind of databases is sometimes hard. So one shall note the fact that you would need to for every like catching mechanism

that is not persisted. You would need to have an overlay that allows read only access with to the base overlay and write access to the temporary storage that is created on top. So overlays all over all over the place. And secondly, the important thing is to be able to have the storage cleaned up after the RPC have finished because everything is single use basically. So you create for a particular user this branch that he can play around with. Yes. Yes, please Lush.

So this goes potentially a bit deep into nethermind internals which will be probably a bit different but on for other clients. All right like the graphs like it will be somewhat similar. Yeah graphs are simplified like in comparison to real life. Yeah but I don't think they are simplified enough. I'm not sure if they can simplified enough. Right. do that because who is the target audience for this? I don't understand 100% but in my understanding it were Ethereum client developers.

So the question there was that uh was asked to ask uh why are client developers working on it? So in my understanding this is for other clients to like start working in more prioritized fashion on this feature. So let me recite the message that was sent to us. Uh we'd like to invite someone to talk about is multicol uh to provide overview client implementation and why client if developers are working on this sharing more about this ongoing meeting may get some contributors on board. So it is for developers potentially

and what I I understood that that's they asking why we are developing this but didn't say like who is interested knowing that information so it's I don't think it's necessary for developers only was the meeting you will be presenting all cordfs uh as I'm not all not already invited I don't know exactly but it is definitely not all cords it will be on Friday 18:30 okay Friday I think it's I think it's recorded And it's not in a way. It's not a meeting. It's more of interview. That's how I understood it.

Yeah, it might. Is it like a pipep or something similar? Who knows? No, I'm not sure if this is more for car developers that will be implementing this or is it more for developers that will be using this? Oh well, but looking at the message that was initially sent to us, sharing more about this ongoing board. So it is to get on multiol who send that message.

Uh Puja Rajan Ranjan. Okay. Okay. Okay. Uh yeah, I would ask her a bit more about it then. Yeah. Perfect. Directly what's and we'll simplify the graph. Yeah. So, so basically, yeah, you have the bees, right? So, so this one, this format is more readable. Yeah. Yes, I think this was correct. Yeah, this is very good. And that you need to keep the state of blocks and keep the state of the state so the accounts and storage between those blocks. That's important, right?

uh but this internals how do you do it's not important in my opinion because this is very different between uh well not very but somewhat different between the clients uh so the important part is that there is some state that is uh in memory right it's fine uh and that is being kept between between blocks so you that it's a loop right and it's we keep some state between blocks which is something new in RPC that haven't been done until now all All right, we'll focus the attention on that in the RPC part. Uh, and there are EVM updates. We update how users can override pre-ompiles and redirect

pre-ompiles. And this means that there is a chance that your client EVM would need to be updated. Not every time, but there is s such a chance a user may override pre-ompiles with their own code and we to move them to their user defined locations. This allows complicated scenarios when a user for example has a mock that sets a set of conditions uh just right for a specific call to walk and open a wallet and that would open only one particular wallet automatically and for other cases it would use the default schemas and default pre-ompiles. There are RPC

updates and it is one of the few methods that is focusing on object uh as a data structure that it is required for user to operate it. There are more than 100 new hive tests uh created by Kari. Thank you Kari and fled. Uh and uh users can run transactions in two modes. They can run transaction in validate on mode and invalidate off mode. Validate off mode is more similar to what you get with is call and validate off mode uh sorry and validate on mode is more similar to what you get when a transaction comes to a client and is and is getting uh ready to

be validated and passes through all the regular rigorous checks and uh requirements that a real transaction that shall be posted on a block shall pass through. uh there are set of parameters that we initiate and that are like sely defined. So user haven't have no like if user doesn't know what parameters shall be we will try to set them up correctly so that his transaction would pass the uh validation by default uh but it is uh not uh not forced and to summarize uh we present a new RPC method that allows for

mocking and other kinds of experiments on mainet chain. So that mainet chain is not affected but users can simulate whatever they want on it. Uh it is quite far in terms of functionality from call because it brings a lot of new things to the uh to the playground and it is potentially usable for im research contract testing and complex unchained simulations without consequences. With this I give you a link to if simulate and thank you all for listening.

So this is the draft of the presentation to present on Friday and I will share it with like uh with everyone who would share an email. Mhm. And we'll all be able to edit it. Two things for me. Uh some examples of usage of if simulate like with multiple blocks, right? Yeah. Yeah. We definitely need that because the only one we had was in the beginning and it was outdated because it was using ETH multicol but I'm not even saying the like JSON RPC showing JSON RPC but showing like an intent how can it be used what we can achieve with this

and a bit more detail uh with an example of pre-ompile overloading right so why do we want so for example your code wants to unlock something, right? Or like calculate something. And this is mainly useful at the moment for this pre-ompile, right? Because it's only the uh the the I forgot which one, the the curve pre-ompile, whatever that what that's called. Um we don't really see it being useful for others, but we developed a general mechanism for for this, right?

Uh yeah. And in my understanding basically this application highlights how it's used. Uh but we definitely need to provide the like mechanism of how it is actually like taking part on chain and where the actual pre-ompile is called we'll add an slide and an image to it. All right. Yep. And uh Kari, if you have like specific examples in mind or like special highlights that you can share in forms of uh either hive test or just JSON input for simulate, it would be great. And same for Cena. If you would have anything interesting like specific, it would be lovely.

One one some more questions for me. Would you guys co-present or is it only Oleg presenting or what's the deal there? I cannot join on Friday. So it would be Oleg only unless we want to move it then I could also join like I like I was saying Oleg has a good technical knowledge and technical background which is also good to share but Ukilari or Micah have a better like uh user oriented view of this feature right so it might be it would be good to understand what is the kind of the target audience for it it would be more developers or more to clear stuff then it would be more better in a way that like but if it's more in a

way userf facing then then me and my way are more user facing I expect it will be more general community uh and by developer I wouldn't expect only core developers but also application developers and users of this so that's my guess but that's my guess yeah if it is for users will definitely need somebody from your side if it's that then Yeah, we should ask ask that and then then try I'm busy on Friday, so like for example, Monday would work.

Mhm. Yeah, let's ask her and see what she would tell us about it. Yes, S please. Um I regarding the current presentation, I don't know if this might change depending on the audience, but I had two small points. Uh, one is um that I think you can add a new page potentially for validation mode. It felt a bit out of place in the like talking about the hive test and all everything at the same time and I think there's like some things that you can talk about here. So it definitely um I feel like it deserves its own page.

Um the other thing that I wanted to mention right the something that Kilari mentioned in the chat uh which is definitely useful especially for users is the logs I don't remember if we mentioned that during the presentation yeah we haven't and this is like specific picture um I would also you introduced yourself in the middle of the presentation I should move that in the beginning that you introduced yourself there and then yeah we can like post like the beginning slide from somewhere and I would introduce listed

I would introduce the eat simulator it's like eat call in a way that other people might be understanding that you are sending batch transaction which is kind of not the case but we are just doing the simulations so would try to introduce it's kind of very similar to eat call except it can do more stuff and and in a way it kind of replaces the it call as f it can do more stuff than it call and and all the same stuff that it call also can do and then I would introduce those new features which are listed in the chat like those those five things which are kind of like the big things that that are new in the HIP uh we'll do but yeah then I I will more start to morph this into the presentation that I

had had in in the already show them. I don't want to make it exactly the same same presentation that we had. Yeah. Yeah. Um so yeah, we'll add that and we'll know if this presentation is focused more on like developers or on the uh on just uh on the core developers or on every developers like in general or on the users and yeah that would allow us to move forward. All right. So, thank you guys. Uh, hold on. Hold on.

Yeah, simulate. There's there's a typo here. Yeah, I'll check it and edit it and we'll give access to everybody. Okay. And I s I still have one small uh comment. It was regarding the chart on page seven. Seven. All right. Y Yep. Uh here I think you have a loop. Yep. But I think the loop should go um to fill header basically. I don't know how to mention it but um the parent block part or the just after block or maybe I'm just misunderstanding what

means parent block. Is it the base block or what is it? Yeah, that's the tricky question about this chart because after the first like first round the parent block becomes whatever we processed and generated and so it is the parent block. Yeah. Yeah. But that that makes sense to have a separate start block that it doesn't look to just the beginning. But we can maybe some somehow highlight that it is like a start block that not just a general parent block that because every parent block happens like in the circleish thingy and this is just once start block. Yeah, we'll do that. Thank you.

Anything else? Um, no. I was I mean I guess this would depend on the audience, but uh um I was wondering if we should mention something about blocks, block numbers that are skipped, like the former phantom blocks. Um but yeah, honestly, I'm on the fence about it. Yeah, for example, I would be interested in knowing kind of internally how Netmind and get are doing the ED simulate, but then I don't know if that's the audience that are interested in the internal stuff or not. But yeah, for example, I would be interested in having a presentation about the

internals on how those things work. But yeah. Yeah, but it's you. So we can Yeah. Yeah. But that's why it depends on the audience. In my opinion, it's not useful for any audience uh to have too deep internals. Uh I'm audience of one. Yeah. Yeah. Yeah. But okay. I mean public audience. I mean it's not for you. But even for developers, I doubt they would take too much. Yeah. Because whenever they would implement that on their own, they would have different troubles, different architectures and different languages.

So it won't map directly. But the concepts should be should be presented somehow and in general we should draw a tree somewhere. I think whenever you want to understand the internals you uh you will get a presentation for just like a private presentation. Yeah. Really? Just ask and yes receive. Just read the code. Um, I've been trying it sometimes, but quite complex. Yeah. Some This was so simplified. So simplified, but we need to simplify it even more.

Yeah, we'll do that. All right. Uh, and on other notes, I'm finishing the uh block uh overload gas pricing, and I broke my git. So sadly it will take at least one more day uh because we were trying to do some security update like all of the Netherland and it sucks. Sorry guys. Um actually I made it work. So yeah, you can make it work but after I started my computer my Git stopped working.

Okay. So now I can't like clone anything that is on like private repos and that's sad. Yeah. All right. So, any other news? Uh, not much from my side. I did not do any work on a simulate this week or the last week. Um, just that um my team will probably start looking into it soon. So yeah, I don't have any updates either.

Look at Would you ask uh Puja yourself or shall I do that? Um it would be great if you can ask you can add me to the conversation. Maybe you are in the I think we'll just ask in this simulate channel. Oh just ask in there. Yeah. Okay. Yeah. Oh, please ask. Yeah, we'll do that. All right. I don't know if that that's Peep and E or if there's some other YouTube channels that that they are doing, but that's also one option what it could be. Oh, sorry. I wasn't aware that this is on the Okay.

Someone to talk about multicol providing I don't know. I don't think Pa is running the peep and either, but I don't know if it if they are recruiting people. Yeah. Okay. Yeah.

Also, also is it just that interview or that presentation or are there is there somebody asking questions? So, kind of what's the format as well? Like if Yeah. And how long it needs to be that one questions from Yep. All right. So, do we have anything

else for today? I don't think so. Do you think you can get the new version out soon as uh I'll do my best, but I think tomorrow is most realistic. Yeah. All right. Okay. And when you'll post your emails onto chat, I'll be able to share the presentation with you guys. Thank you.

Bye. Thank you. Bye. Thanks. Bye.