Fetch runtime code from storage cache when using proofing backend (#9611)

Before we fetched the runtime code from the `TrieBackend` and this lead
to not using the storage cache. Thus, we recalculated the storage hash
for the runtime code on every call into the runtime and this killed the
performance on parachains block authoring. The solution is to fetch the
runtime code from the storage cache, to make sure we use the cached
storage cache.
This commit is contained in:
Bastian Köcher authored and GitHub committed 2021-08-24 09:54:53 +00:00
1 parent ac9c3259bf
commit 30ce8bbc8c
11 files changed
+31 -41

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ where
.into_iter()
.map(|(k, v)| (k, Some(v)))
.collect::<Vec<_>>();
let mut storage = InMemoryBackend::<Hasher>::default().update(vec![(None, transaction)]);
let storage = InMemoryBackend::<Hasher>::default().update(vec![(None, transaction)]);
let trie_storage = storage
.as_trie_backend()
.expect("InMemoryState::as_trie_backend always returns Some; qed");