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

Loading player…

Verkle integration in reth by Aditya Gupta | Devcon SEA

DevconTue, Oct 7, 2025, 12:00 AM

This talk concerns the presentation of EPF Project: Verkle integration in reth. The project comprised of replacing the current state-commitment structure in reth with verkle tries and other modifications for statelessness, including implementing EIPs such as EIP-4762: Statelessness gas cost changes (to REVM), EIP-6800: Ethereum State using a unified verkle trie, EIP-7709: Read BLOCKHASH from storage and update cost, and passing the associated execution-spec-test vectors designed for these EIPs. Speaker(s): Aditya Gupta Skill level: Intermediate Track: [CLS] EPF Day Keywords: EPF, Core Protocol, Cryptography, Verkle trees 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] thank you everyone uh hey so I am adya I worked on the project of voal tree integration in the r uh basically the uh code involved the modification in the r to enable the stateless mode so before moving forward I would like to discuss uh few points about the V and the work trees so the main goal of the vge was earlier to enable the stateless client uh in uh eum blockchain but now the Verge represents a very ambitious and a bigger goal to verify the whole consensus and execution using SNS but currently the stateless team is focusing on enabling the work trees in the execution clients so my project involved only uh implementing the stateless mode using the vle trees so the stateless mode first can also be enabled using the Merkel Patricia trees but the witness size are very big using the mpts uh in average case it's about 3 KB and in worst case it might rise to about three times faster so so the concept of Wal trees was introduced uh the main feature and the main advantage of the wal tree was to reduce the size of the witness and it will be used as a major State commitment tree in the stateless mode whenever The Verge is activated so yeah so uh now moving forward uh what were the changes are implemented in R so actually the changes can be divided into two parts uh because the devet 7 which is which was launched about a week ago uh it is a devet used for the work testing by all the clients such as the nther mine get R and every other execution layer clients so this devet targeted actually two eips the first one was uh 4762 which it was related to gas cost gas cost changes and uh the second one was 6800 it was basically related to the tri structure the so the first modification we related to the EIP 680 which were involving the tri structure modifications so the main change here was that in the mpts we basically maintained two structure one is for account tree and the second is for storage tree but in the veral world uh there will only be a single tree structure it will be uh handling the commitment of all the storage uh of of the storage as well as the account data which involves the code and the nons and the addresses which and every data which goes to the accounts right so at is the structure of workl tree and how this work tree uh how the how this process is accomplished uh basically work tree have uh leave key values for example if you want to access a account data you will be using zero zero value which is suffixed to the original key and included for the final key value and similarly for code value and the storage value so now now instead of using the two separate version of of tree we will be using a SE single work tree for managing the state now what were the changes actually needed to implement this first of all uh the r uh the the two the actually uses the state provider and the storage rout provider these two providers are basically used to provide data of the state for the uh account tree and the storage root provider for the storage tree so these two providers were completely removed and it were replaced by a work rout provider now the work root provider will be mainly handling all the state commitment process in the r now the major task was to uh replace the code of State provider and storage provider everywhere where they appear and uh where they are used uh so the main uses of these providers were in the uh State rout computation basically first it was in after every transaction in the block inter intermediate State Route was computed and after block finalization when the fin a state root after the block was computed and third one was when the peers get blocked from the other peers then there is a process of State root verification whether the state rout computed by your client matches the state route obtained by the PS and the final was during the chain REO when you need to recompute the state by reverting back to the previous state of the tree so these were the main four processes where the state commitment were using Merkle trees for computing The Roots and these four uh uh code blocks were needed to be majorly modified to enable veral commitment so everywhere uh in these blocks uh the above two providers were reped by voal root provider and the voal root provider were now handling the commitment process in the r now there are some uh Improvement in the uh efficiency and the processing of the clients for example currently the mpts uh implemented by r uh uses catch caching mechanism for storing the uh intermediate Roots they use incremental updat so that they do not have to compute the whole route again and they can just partially compute the roots and the third one was paralyzation uh so re has enabled the account tree paralyzation but the store storage tree paralyzation is yet to be enabled but in the wal World there will be only one tree so uh I would have to work on the paralyzation of work roote commitment as well but these are very future goals uh current Uh current work is just Implement a commitment structure using vle and that is done uh the the model is currently working fine uh one of the major changes that was introduced were in the database structure uh for example earlier there were two tables maintained one was for the storage and one was for the account but now uh there is only one work Tre structure which needs to be maintained which is responsible for handling or the state commitments so these changes were related to EIP 6800 basically the root uh the try structures and the commitment structure in the clients so next major EIP which was targeted by the uh devet 7 was 4762 uh 4762 is basically the uh modification n to the evm for uh when the witness is constructed all the gas cost changes were needed to be implemented in evm because now construction of witness were included in the block production and all these accesses will require extra extra cost for accessing the various data required for witness construction so basically the EIP targeted two types one one was for access event and second was for right events the access were basically reading the data for constructing the witness and right was for writing the data while constructing the witness right so you can see all the opcodes that whose uh gas cost will be modified when the CIP will go live all these op codes where need to be uh the gas cost model for this up course were modified yeah and this VIP also designs how how we are going to access the pre- compiles the system contracts and uh the gas cost of various offcuts so how the how do how I implemented in it revm so I referen the implementation of get and nethermind for this purpose uh these are all the functions that were called whenever a particular op code is executed uh during a transaction uh these functions will be called by this opcodes uh they will be adding the cost for witness access during the execution the main logic was the access key function which is internally called by all of this function access key function is basically responsible for uh basically charging all the Gest cost it it checks whether it's for exess it's whether it's for right it maintains a list of all the exed sub trees and modified trees it charges accordingly if the tree is not yet touched it charges the read cost if it already uh touched then it will be charging the right cost so all these functions were separately implemented and they were inserted wherever the opcodes for that particular function called now the most important part of the project were the test vectors so test Vector basically the execution spec test which is developed by the stateless team right now they are they are the major like the major uh the problem which I faced during my project even though all the changes were implemented but this test vectors they cently consist of more than 100 test about I guess 200 maybe so this tast Vector actually not only judges the code but also they are responsible for handling the various minute cases and the edge cases of the clients so after I was able to pass about 60% of this test Vector but there were some age cases for example uh you are uh for example you don't have enough gas for adding the data to the witness but still you are adding it because uh they were supposed to be added during the propagation so that AG cases need to be encoutered here so some of the test are still yet failing but I will be uh altering the code accordingly so 4762 and 68 there is a third EIP as well 7709 uh this EIP I yet to touch it is basically handling the block has instruction in the clients so if I able to pass all this execution spec test then I will be uh the re will be automatically able to join the devet 7 the plan ahead so basically I was able to implement all the EIP and about 60% of the test vectors be passed but the goal I set was very ambitious uh the basically this work is going on for almost uh 1.5 to 2 years so implementing all this thing in three to four months were like a hectic task but uh I am like really proud of the work which I have done till now so basic modification for commitments are done for RM changes are done and the try changes are also done the next phase will be for exam uh uh what I want to say is uh like the main things such as the construction of witness propagation of the witness are completed but the main feature of the stateless execution is the stateless mode where the block will be executed using the witness which is provided using the uh uh along with the block and not with the existing state with the local client so stateless execution uses witness is the next main feature this feature is not yet implemented by G because it's not targeted for this Dev nut but it is live in the nether mind so I will be refreshing the nether mind's implementation uh for this stateless mode now more into the future uh the work not only involves the TR design and the gas cost changes for storage but the main problem the veral world will be facing will the syn design uh how we will be moving from the Merkel Patricia trees to the workl trees how the data will be migrated there are some existing strategies for this for example the over root overlay root strategy which is currently accepted and there are some sying strategies as well for example it's implemented in either nether mind but the research is yet to be done for this purposes so syncing would be the next phase for the voal research and the main target for the stateless team apart from that uh the recent Z technology have evolved lot there are some improvements in the proving technology so even though there are many advantage of the vle for example the witness is updatable in the vle the proof size are very small and the voal code is almost ready for the production uh we can shift to statelessness directly but there are some research going on uh to directly shift to the full whole verification of the consensus and execution layer using ZK SS uh for that the vle is very uh not easily used uh we are not able to prove the voal TR structure usually using snars so there are some proposed structur such as stocked binary hash trees and circle stacks and proving hashes using Circle stock such as posidon and everything so uh the main task uh will be of the stateless team will be to go through a state uh Tri agnostic design so whatever will be the TR design accepted finally the main changes related to gas cost sinking and witness construction would should remain same so this will this will uh be my major TX I will be running uh syncing with the stateless team and uh carry on the work for the death on behalf of them final note uh EPF was a was a very great experience for me I would like to thank Josh and Mario for giving me this opportunity uh this was the first major project which I took apart from my personal contribution so this provided a very good direction for my future developments I would also like to thank Kev hre because he already implemented the rust wle tree structure uh which I used for modifications in the red I would like to thank ignasio from the get team and Tanish from the Nan team as well and Oliver from the red team for Ming me through this project so like EPF is one of the best Gateway for ethereum code protocol development and if you are getting a chance you should go for it yeah so thank you everyone this was my project awesome thank you so much much for your kind words thank you so much they appreciate it and we have a space for a question if there is maybe like one uh two questions anyone any comments yeah oh there is one online uh are you also going to implement the state three migration approaches like the overlay three yeah so uh the migration strategy is not yet finalized uh overlay tree the design of the overlay tree is not much clear right now like it not at all implemented in any client because research is also not going into that uh because uh like because we the the main target to first get over with the gas cost changes because we are the team is planning to make live the gas cost changes before the work because then the other l2s and should get accustomed to the various gas cost changes but the transition and the sink is not yet designed completely and it's very vague right now so uh I will be running inop with the stateless team and whenever it will be ready I will be more than happy to implement it yeah awesome thank you so much um yeah

Automatic transcript — names and jargon may be misspelled.