-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecated host functions that were supported in early releases of the substrate make a node unable to synchronize and verify the history from the genesis block. #4338
Comments
Yeah this is the right idea.
I don't get the problem? I mean you implemented the host functions, but you could not implement them as before? Why? |
Thank you for your quick answer (cc: @bkchr) !
It looks like I implemented them exactly as they were in polkadot-v0.9.33 release, as I just copied them and resolved some simple compilation issues with imports without any custom code. Originally the
What values should I use for the If you take a look at my attempt to fix the issue, I'm creating the function executor using a blob of my network's runtime. Is it correct or not? If yes, should I use the blob of the runtime that was running when the missing sandboxing functions were applied (the Mainnet that was ~3 years ago), or should I just use the blob of the latest runtime (the current Mainnet) to create the instance of the function executor? If you could shed some light on what arguments I need to use to instantiate my "custom" The reason I thought the "custom" function executor was not a viable solution is that when I tried to process the history using the copy-pasted functions, I got the Can you explain how to properly construct and inject an instance of the custom |
Your problem is stuff like this:
Writing it this way should make it work. You will also need to change |
Thank you for your clarifications, I will try and let you know whether it works or not and collect new details if it doesn't :) |
@bkchr I am currently addressing the same issue but am exploring the use of |
Not that much I can provide here. I would also need to look into the APIs etc. |
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
Hello, recently I posted this question at the Stack Exchange that describes the issue in detail.
To summarize, the removal of the sandboxing host function interface in PR #12852 causes old transactions submitted to the
pallet-contracts
to fail while synchronizing a node with an old chain from the genesis block infull
mode and verifying the blocks history. At some point in time, the sandbox was an internal dependency of thepallet-contracts
. This requires the function executor to have the sandbox-related host functions available at the host to process old transactions.I tried to resolve the issue by extending the default host functions with sandbox ones to process old blocks. For that, I literally copied a part of the code for the wasmi
FunctionExecutor
to my network's node source code at the state it was in polkadot-v0.9.33 release. But it didn't do the trick. Executing old transactions using this "custom" function executor causedStorage root must match that calculated
error. Probably, this attempt is not a viable solution at all, as I can't apply the correct arguments (MemoryRef
,TableRef
, etc.) to the "custom" function executor due to accessibility modifiers in substrate crates.It feels like there is no way to fix the issue without a full fork of the substrate framework, where I can return the sandboxing host function interface back for the newest substrate releases.
Unless there is a way to recover the synchronization with old chain in
full
mode from the genesis block for substrate-based nodes that are built on top of the substrate-node-template, I think this issue should be treated as a bug in the substrate.Steps to reproduce
pallet-contracts
and is built on top of substrate 2.0.1 release. Run the node and start a network.full
mode starting from the genesis block.The text was updated successfully, but these errors were encountered: