I've completed most of the components related to the EVM layer which includes hard fork, revive gas cost and new transaction type. The next steps is to complete the state storage components and the integration of EVM, state storage and Verkle Tree.
Check out my development branch for Verkle Tree here.
Check out my development branch for Geth here.
There are 2 hard forks needed to enable the state expiry feature fully. Once the first hard fork is enabled, any CRUD operations on any key value pairs will modify the leaf node to contain an additional state epoch metadata. Once the second hard fork is enabled, any state that is deemed expired will not be able to be accessed.
The following is the code for a new transaction used to revive expired state:
This new transaction is essentially the same as the DynamicFeeTx (aka EIP1559), with the addition of ReviveList
. The ReviveList
components are as follows:
To put it in simpler words, one transaction can revive multiple key-value pairs of different addresses. The revive operation also comes with additional gas cost. For now, I just use some arbitrary number measured in bytes. Here's the code for the calculation:
Aside from showcasing a PoC, I should be able to show how much state storage can be saved if we were to implement this on Ethereum mainnet. To do this, I need to perform the overlay transition to convert existing MPT to the Verkle Tree. At the same time, I need two information in order to perform the transition alongside the state expiry scheme:
For 1, I have been full syncing a node for weeks and now it's at ~12.5M blocks. It should take another 1 month to reach the latest block height.
For 2, I have contacted Ignacio and Guillaume to see if they have any existing preimage file. Will need to follow up with Guillaume next week.