This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Fix wasm module reuse #2051
Copy link
Copy link
Closed
Labels
I3-bugThe node fails to follow expected behavior.The node fails to follow expected behavior.
Milestone
Description
CC: @pepyakin
Seems that the original cause for #2022 is somewhere in wasm module re-use.
diff --git a/core/executor/src/native_executor.rs b/core/executor/src/native_executor.rs
index 0944cbdb..f0793af3 100644
--- a/core/executor/src/native_executor.rs
+++ b/core/executor/src/native_executor.rs
@@ -58,6 +58,7 @@ fn fetch_cached_runtime_version<'a, E: Externalities<Blake2Hasher>>(
Some(code_hash) => code_hash,
None => return Err(ErrorKind::InvalidCode(vec![]).into()),
};
+ cache.borrow_mut().remove(&code_hash[..]);
let maybe_runtime_preproc = cache.borrow_mut().entry(code_hash.into())
.or_insert_with(|| {
let code = match ext.storage(well_known_keys::CODE) {
This change causes the issue to disappear.
See branch https://github.com/paritytech/substrate/tree/td-debugging it's forked off from the #1800 that introduced spin::Once, but contains all the fixes that allow to reproduce currently using deployed version of https://polkadot.js.org/apps
Note that last commit is the patch above, so revert if you want to reproduce the issue:
- Send one transaction from any account
- Send 1-2 more transactions form the same account, they will fail with
InvalidTransaction
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
I3-bugThe node fails to follow expected behavior.The node fails to follow expected behavior.