This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes
storage_hash
caching issue and enables better caching for Cum…
…ulus (#8518) * Fixes `storage_hash` caching issue and enables better caching for Cumulus There was a caching issue with `storage_hash` that resulted in not reverting cached storage hashes when required. In Cumulus this resulted in nodes failing to import new blocks after a runtime upgrade, because they were using the old runtime version. Besides that, this pr optimizes for the Cumulus use case. In particular that we always import blocks first as non-best blocks and enact them later. In current version of the caching that would mean we would always throw away the complete cache of the latest imported block. Now, we always update the cache for the first block of a new block height. This enables us to use the cache if this block will enacted as best block later. If there is a fork and that is enacted as best, we revert all the changes to the cache. * Apply suggestions from code review Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com> * Indentation * Update client/db/src/storage_cache.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: Arkadiy Paronyan <arkady.paronyan@gmail.com> Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
- Loading branch information