Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Rewrite state-cache #9769

Closed
bkchr opened this issue Sep 13, 2021 · 0 comments · Fixed by #11407
Closed

Rewrite state-cache #9769

bkchr opened this issue Sep 13, 2021 · 0 comments · Fixed by #11407
Assignees
Labels
I3-bug The node fails to follow expected behavior. I7-refactor Code needs refactoring.

Comments

@bkchr
Copy link
Member

bkchr commented Sep 13, 2021

The state cache, found here: https://github.com/paritytech/substrate/blob/master/client/db/src/storage_cache.rs is very error prone.
We have already tried to fix it multiple times, but there still exist bugs. Parachains for example are the ones that suffer from these state cache bugs which mainly lead to storage root mismatches.

The idea is to rewrite the state-cache into an overlay model, so that we just cache all the writes/deletes per block. Then, we can use these overlays to build the "state view" when accessing a particular state. Reads also should still be cached.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior. I7-refactor Code needs refactoring.
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

1 participant