-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perform State Caching With Merkle Structure #2011
Comments
Blocked by testnet feature freeze, but design can start now. |
A design that would have excellent side effects for this would be store the state itself in a Merkle DB structure. From @protolambda's design:
Doing this would allow us to easily fetch the data we need at runtime without needing the entire state and would allow for lightning fast fetching of its hash tree root. |
@nisdas @prestonvanloon @terencechain @0xKiwi @shayzluf what do you all think? What we have to carefully consider here is how much of this we will keep in memory vs. on disk and how we can prevent data corruption or accidental mutation. |
@rauljordan this looks good to me. Optimizing for some thing like this would definetly be very helpful. But as you stated we need to be extra careful about data corruption. The state having so many pieces, it would be easy for a minor bug to slip in and cause an unintended mutation. If we store this as a binary db, how would the state look like in bolt ? Right now we just place the whole ssz blob into the state key. But with something like this we would need to break it up further and have some sort of schema to iterate over keys for the state field. Ex: state.Slot => could be stored in a nested bucket using the state key. The same would apply for other fields. This all would need a detailed design. |
The spec now includes a section on state caching, this issue is to track state caching from this PR in the specs repo ethereum/consensus-specs#732 and is also a part of #1999.
The text was updated successfully, but these errors were encountered: