Skip to content
  1. Apr 10, 2021
  2. Apr 09, 2021
  3. Apr 08, 2021
  4. Apr 07, 2021
  5. Apr 06, 2021
  6. Apr 05, 2021
  7. Apr 04, 2021
  8. Apr 03, 2021
  9. Apr 02, 2021
    • Bastian Köcher's avatar
      Fixes `storage_hash` caching issue and enables better caching for Cumulus (#8518) · 4186274d
      Bastian Köcher authored
      
      
      * 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: default avatarArkadiy Paronyan <[email protected]>
      
      * Indentation
      
      * Update client/db/src/storage_cache.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      Co-authored-by: default avatarArkadiy Paronyan <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      4186274d