You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make SharedTrieCache/LocalTrieCache work with entire state in memory (#7682)
Part of
#6131 (comment),
we need to make sure that the TrieCache is able to work with the
assumption that more or less the entire current state fits into memory,
this can be split into a few parts:
- [x] Remove the LocalTrieCache hard coded size and make it configurable
from outside.
- [x] Decided to have two flavours of building the LocalTrieCache, for
the import and block authoring we are using a trusted local cache that
grow to hold everything in the block and then propagated everything into
the shared trie cache.
- ~[x] Everything from LocalTrieCache needs to be propagated back to the
SharedTrieCache in a fast and safe manner, so that it doesn't become a
bottleneck. Currently, that is done on drop, with the function holding
the ShareTrieCache write lock while promoting all keys. Decided to move
this on a separate worker thread, so that the hot-path does not have to
wait for drop function to propagate everything from the LocalTrieCache
to the SharedTrieCache, the flushing of the worker thread happens after
the block production and import happens.~ Update this is not need
because authoring and imports is bounded, so the numbers is not
exaggeratedly big, to make the drop too heavy, see numbers here
#7682 (comment).
# Todo
- [x] Stats to prove most of reads/writes hit the shared or the local
trie cache.
- [x] Unit testing the new changes.
Fixes: #7534
---------
Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
0 commit comments