This week, I have completed the code for storage analysis, but found some critical issues to the design so I had to redo it. I've also connected with Stellar's state expiry dev and continued my conversation with the relevant mentors. I've also began to write my project proposal.
I've managed to setup a node on mainnet and let it full sync for 1 day. Here's a quick snippet:
As shown, we are able to see how much storage is being used for a certain block range (customizable).
But there's a huge flaw with this approach. Geth now uses a hash-based approach. Each MPT node is stored in the database where the key is its hash and the value is RLP-encoded data or raw value bytes. As we know, any underlying changes to the leaf nodes (values) will propagate its changes to their parent nodes, which modifies their hashes. Therefore, my current approach of storing key-value as hash(node)-blocknum will not work because there are guaranteed redundant trie nodes in the database Hence, the analysis result will be flawed.
With Geth's recent release of Path-based State Scheme (PBSS), we are able to reduce this redundancy because each trie node is stored as path-value instead of hash-value. However, if the MPT structure changes, there will still be data redundancy.
Another approach of doing this storage analysis is to analyze the number of KVs being accessed instead of the raw trie nodes. The general approach is every time the bottommost diff layer is written to the disk layer, we will also write the block number where the KV is accessed. Most of the code components will look similar, so I aim to finish this feature by the end of Week 5.
Link to the feature branch. Will make a separate branch for the new approach. Also, a complete documentation will be prepared in the upcoming weeks on how to reproduce the result.
I had a talk with Garand from Stellar to understand their state expiry approach. Garand also did a lot of research on various Ethereum's state expiry proposals, so I had gained tons of insights from the short call with him. Here are some notes:
What is an Expired State Store (ESS) in detail?
One of the best advantages of using Verkle Tree is its small witness size. Why use binary Merkle Tree instead of Verkle Tree?
If Stellar stores deleted persistent data in ESS, the amount of deleted data will grow over time, so state bloat still occurs. How to mitigate this issue?
What's your opinion on Vitalik's State Expiry EIP?
Any advice on State Expiry for Ethereum?
I've also continued my conversation with Guillaume on Discord. One of the state expiry approach that seems quite appealing as compared to the rest is to only expire the values in the bottommost nodes in the Verkle Tree. Quoting Guillaume, since internal nodes are quite small, so most of the data will be in the bottom nodes, expiring only the values might save a lot space.
Initially, I thought that expiring values in the leaf nodes will not save a lot of space comparatively because internal nodes take up more space. But his opinion was completely different. Therefore, I'll continue to explore this approach as the other state expiry schemes do not seem too appealing at the moment.
I've just started to write my project proposal, aiming to finish it by the end of this week or next week. The general idea is to work on post-verkle state expiry scheme, adding on to the storage analysis project that I've been working on.
To ensure consistency, I post daily updates (on weekdays) on what I did for EPF. Check out my daily updates this week:
Monday
Tuesday
Wednesday
Thursday
Friday
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing