# Revm Endgame by Dragan Rakita | Devcon SEA

- Speakers: [Dragan Rakita](https://streameth.org/speakers/dragan-rakita)
- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2025-10-09
- Duration: 24:45
- Topics: Science & Technology
- Watch: https://streameth.org/watch/yt-xRuDWTWuxKA
- YouTube: https://www.youtube.com/watch?v=xRuDWTWuxKA

## Description

Revm is a critical component of the Ethereum ecosystem, used by builders, toolings and clients. It is an audited and proven library that is both fast and easy to use.

As more projects adopt Revm, I feel the increasing burden of making breaking changes and the need to consolidate its functionality. That’s why I am thinking about Revm Endgame, a solution to support experimentation, Layer 2 features, and EIPs without the need for repository forks.

Speaker(s): Dragan Rakita
Skill level: Intermediate
Track: Core Protocol
Keywords: Core Protocol, Architecture, Public good, execution, client

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

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.

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon SEA was held in Bangkok, Thailand on Nov 12 - Nov 15, 2024.
Devcon is organized and presented by the Ethereum Foundation. To find out more, please visit https://ethereum.foundation/

## Transcript

[Music] [Music] the introduction yeah uh in this talk I would like to talk about endgame the last step of uh Aran project it started few years ago and I think I found the solution that's going to last for a while uh before that let's talk about history uh and basic evolution of the project it started in 2021 I took a break for the work I basically go went to the seaside relaxed a little bit and after I came back I uh I did basically want to do some project that's related to infrastructure wanted to build something that use evm and I started researching what's basically on the market and it was like treatings open ethereum was the client that I worked on before and it was GP license so it was not suitable uh EV modm was the new one it has some it's built by ex colleague it has some experimental and exotic crust night features and it was like just interpreter so that sense it was not enough for me SP VM I was most interested in it and it was old the project old the evm but it was not that maintain uh it was hard to use it and if you want to do inspection tracing you need to basically build it in some different way and that's very hard to use so after making PR to the sputnic to add some generics on the instruction set uh basically after two weeks of no response nothing and seeing the project not moving anywhere I closed that PR and made my own rvm in the month I had some initial initial code that can be run is PR if you want to look at that by the end of 2021 I supported the latest Forks uh state for test state test for passing it supported to pre compil and the most important interface was simple I wanted to have for my experience open ethereum I want to have evm where you set all the data and say transact and then basically it gives you the output of that execution the database trait was the obstruction that allows you run time fetching of account storage environment was the way how you set transaction block configuration everything around it and inspector was the good abstraction very powerful one that allows you run time inspection of the your evm when you it it's run get it's this PR it was optimized few times but this PR was most impactful it basically forx the the performance uh it was no STD from the start uh IDE idea was to use it in JavaScript or vas it was M MIT license and by that year basically jumped to another project and rvm became my hobby first adopters came next year uh fundry was the biggest one at the first one uh the way how I met giio was he tweeted if there is any EVMS out there and I responded on the Tweet hey freshly back if you're interested and he was in the minutes my DMs that's georgeos he's basically amazing in that sense uh they started integrated a few months I think the Oliver did the first integration uh five months after the start that was like March 2022 uh hardhead started integrating the r backand they published the this year Builder sures was one of the big uh users of the CL of the library and they would the first one they sync from the Genesis to the tip of the main net and it was very nice to to hear hey we are thinking everything is fine by the end of 2022 all Forks was supported optimization was done our RV MGS was supported but removed by the end of the year there is no traction a few more optimization was done and most importantly R the client started to be made October 2022 at that point of time I join Paradigm to work on the client I think I had H from the my open etherium times second year and R are mostly basically focused on the client implementation uh we needed to make something stable and we did it very fastly team was amazing I plan to stay there just for a few months but I'm still there now in inaka but did the very same team shanka and kakum were added and time moved on this year R 01 was relased big stability Improvement U it was audited it was the the people like it people wanted to use it it was it is amazing RM on its own hit it own Milestone it got audited uh it was Community Driven by the six company and it's B guy gido basically the guy that finds a lot of evm bugs uh there's blog post if you want to hear more uh you have got supported and start of of the year uh Z KVM become a thing this year I could claim I feel that's okay to claim that the rvm become the became the most popular evm Library out there and it's become the critical component of etherum ecosystem there is few types of the rvm users that I can see they're basically clients and chain R first hel like client SC uh as the execution clients there is different chains Optimus scroll binance polygon they all all interested to have uh RM in their code or basically in this sense R and in that connection rvm the tooling both The Foundry hardhead are basically using RM Builder searches uh they're a little bit private but always in my DMs are the big users of it and Z KVM uh basically it became the standard Library that's used in that field there is even a grant by EF uh Foundation that basically uh targets RM formal verification with the usage of the risk 5 and Z kvms this all affected the future of Aran how I look at it so the problems first problem how to do AIP testing how to do how to allow AIP Champions to come to the code base improve their thing implemented tested in The Foundry if needed and basically do their own thing and do their basically on their own time the one of the example is trans storage I want to just moved on that pad uh in July 24 I got issue in GitHub hey can you implement that that was one of the a iions that wanted this included in Aran for him to test it in The Foundry y it was not included in the any hard Fork there is no even notion for it to be included so that was mostly it few months after uh a got CFI so it potentially can be included in shangai but either way there is not like strong guarantee shangai happened yep he was not inside next har Fork Cancun July PR was made for that AIP August it was merged in March the AIP landed on minute approximately four months before that a should be made inside the clients for the testing for the dam Nets and for test Nets at the end another example was 3074 and I want to say all the requests that Champions made were reasonable it is from their point of view but but the question that I had is like should I have started working on I right away when the first request come it's a little bit silly because I have different priorities I cannot do everything should I just merge PR when it was made the question with that is who is going to do maintenance who is going to remove it if the AIP was not included do I do it for every iip that would be a lot of unnecessary code and in the end who is going to maintain all of that second problem with the maintainance is uh how to add testing Dev uh experimental features one of those I always try to facilitate and enable a big project that depend of our evm to give it support to give a to to make Tech functionality happen sometimes that there's like features U rust features that basically enable those things as configuration but sometimes if this is only the evm project simple evm project RMC r55 integration that require different execution environment would not be possible and problem three is chain support most of chains have small difference and they're not like uh they don't want to move away from evm a lot they're most like new Chains speec hards new transaction types maybe few aips but in general they're like small difference from the main net main net evm only way to do that previously it was like Fork the project and that brings the maintainance issue and burden of maintaining to basically repos so solution for all that is to make evm framework I think that's the the last stage of our evm and it's end game what do you mean by that uh let's make the code extensible chain can use RM as the library override the functionality that they need uh add NE transaction that they need and just uses the library that makes the core of the library same across all the chains implementing new aips that are on the main net become easier and uh all the chains can just reuse the code uh tooling can create their own Uh custom way to inspect maybe they need more performance way maybe they need rvnc needed new execution environment uh new AP can be implemented and tested separately uh and for example this is the first look how how basically I I'm not coming to the code a little bit but yeah the main inspector main optimis inspector Optimus you will have different types for your different evm that you need idea came uh initial idea came few years ago I looked at TV and bom and they had like array of functions and um array of functions that was different by Fork so my first idea was hey can we introduce customers struction and make it like allow user to reimplement or add their own custom instruction that idea expanded so it's not just on instruction but on full logic and that full logic function overriding was the Handler from the last year uh I think it was very great idea but implementation wise it was like box or pointer or function that was not uh the greatest and more flexible ve uh I like the insights that I got while Implement that and the EV framework uh it Ru two things it ruce the generics on the data on transaction block config and it reduce it revor the Handler in more trait like way so it's more easier to use few examples of that is basically how how our basic of the optimism that was the first uh few that was first chain that was included in RBM in sense of the it was included as the feature it was very like in intrusive with the handlers it be I tried I succeed to extract some functionality to the handlers but with EV framework uh that become even easier currently it stands it's con crate I still have work to do on EV frameworking but it become possibility under uh another chain is call that did the similar thing on their own repo just imagine like every evm chain doing their own crates and having Foundry r or all the tooling support those ex variants of RM and all be tested all be done in basically it eases the integration with all the stack the split uh that was inside that the head with the Handler is there is split between the data that is currently context and the Handler that is the logic part of RM context contain transaction block usual things it contains journaling state that allows you to revert things when the revert happen in the calls and and it contains database that fetch the runtime data uh trans stor and Waring of account is all done in journaling uh Handler on other hand he has four parts uh validator that validates the interaction between block transaction and config config can config can have chain ID that needs to be checked with the transaction chain ID for example prevalidation do some warming do some deduct the call balance dop 7702 um yeah it it yeah change delegate quote to the state execution uh is little bit complex it has two main Loops the frame is the loop around the around the calls and interpreter is loop around the bite code basic instructions and in the end we have post execution that does refund of not spend gas it reimburse the color it basically RS the beneficiary and creates the the outcome of the execution in code as you see context has a lot of generics and it allows you basically to have it generalized there is some to-do too spec needs to be made inside side moved ins side configuration but in general this is the the first view of the of the new context in evm framework validation wire one of the four stages in the Handler has basically self contain it contains associate types of the context and arrow a few factor that needs to be called uh other Handler types are in similar fashion made and you can have ethereum validation that basically does the the AUM specific implementation many evm became become just the context and the Handler and to create your own evm this is example of manm it's still pending and it's probably going to be changed in small or maybe medium way uh you basically specify everything you need for example you have your context with some predefined data theaction and for example are the structure inside RM but you can add your transaction initation on it and you have specified the Handler that has their own uh functionality execution uh eum executor has few field that are maybe um they're interesting to people they have pre-compile provider and instruction provider where you can generate your basic list of precompilers and there is trade that you need to implement for this to happen uh on other hand this is example of Inspector main evm is still working in progress but idea is you will do your create you create your own uh in inspector types where that Implement those traits and you can just override it in the end this inspector main uses the D B and inspector genics and this is how you use it there probably going to be some helper function that is allow a little bit more um flexibility and utility but I want to show you just example how this could look it's um yeah in the end um I assume a lot of users are going to come and Implement their own evm or their own like extensions and just use our evm in that form uh I think that's it uh thank you very much for having me and that's [Music] it thank you Dragon it's really amazing what you have the man us to do and all those years with RM so let's start with our questions uh the first question is about testing so do you use any kind of equivalent testing or basically differential testing uh as part of of uh your C uh yeah on every PR state test around basically state test made by Teran Foundation the testing team and it's like good first line of the fence if everything is okay if everything works other than that there is fuzzing team fuzzing project that are run in the backgrounds by materium Foundation by I think Martin has it from go evm lab from go etherum but go lab I think is project but yeah it's there are few stages of the testing done and this is based on every new PR or yeah uh for fuzzing is done in the background it's not on every PR but the state test running it in the on theb web assembly some specific rust Target uh running on uh different targets basic allows you to test all the those things mhm so are there any early architectural decisions that uh you have regret uh yeah um I think I didn't understood how the calls and everything around that works I still struggle with that I didn't find a good fit on top of it the frame and how the frame basically works with other frames it seems it's nice but still need to land on the good abstructure on top of it uh initially the the calling a sub calling was behind the basically you call your sub call and stack became the problem so I needed to move all that to the the loop so yeah there are few of those things the next question is uh if there are any plans to natively support ZK VMS like sp1 because currently uh you need to do some uh hockey patches to be able to run them uh we should talk with them basically AV framework is a idea that basically would allow support this great um another question again related to zvm so RM is now used on both CPUs and ZK VMS and uh these two environments have very different performance profiles uh how can you optimize for the one or the other or both in general everything is Ras compiler so it what compiles optimization of D basically on Ras compilers so the target is different zkv mcus risk 5 while the CPUs has different instruction set that are May more performant in general I didn't I didn't do the testing on on top of it so that would be like good way to check those I guess a followup here is and probably you haven't check yourself and that's more about the zvm but have have you any intuitions that some uh llvm optimizations might be better for zvm or may be better to not use some optim iations um compiler optimization basically I'm not sure I didn't look at it great uh so what is missing in our evm to be more performant than AVM 1 uh I have some task in my backlog uh they require basically testing every change that happen on the performance side needs to be tested measured then well validated that that assumption that I made are correct so I need to look at call optimization to check it I need to look at the stack verification if this extracted from the instruction to before instruction to the main Loop if this is going to affect the performance MH uh is it easy to add a new new promiles yeah it was one of the use cases that to say used a lot and it was very easy it's one of the biggest use cases of um how you can extend easiest and biggest way to extend AR what uh the most interesting use case that you have seen so far um Z kvms was really really unexpected to be honest it just landed it was like Hey it can be used in that way I didn't expect that I made it nod to use it in maybe front ends so that JavaScript can be implemented on top of it maybe it can be used in vasm as the like some project that do that b but zvm was like unexpected surprise and was amazing in general like thank again our speaker Dragon for the excellent presentation thank you
