Open tomaka opened 3 years ago
Problem likely caused by the fact that a storage transaction rollback doesn't revert the trie cache.
diff --git a/src/executor/runtime_host.rs b/src/executor/runtime_host.rs
index 8f483b25..324d1419 100644
--- a/src/executor/runtime_host.rs
+++ b/src/executor/runtime_host.rs
@@ -725,8 +725,16 @@ impl Inner {
if rollback {
for (key, value) in self.top_trie_transaction_revert.take().unwrap() {
if let Some(value) = value {
+ self.top_trie_root_calculation_cache
+ .as_mut()
+ .unwrap()
+ .storage_value_update(&key, value.is_some());
let _ = self.top_trie_changes.insert(key, value);
} else {
+ self.top_trie_root_calculation_cache
+ .as_mut()
+ .unwrap()
+ .storage_value_update(&key, false); // TODO: `false` is wrong!
let _ = self.top_trie_changes.remove(&key);
}
}
This false
requires much deeper changes to the trie cache.
A bit above Polkadot block 2719744