Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Allow --dev to run without wasm #7675

Closed
xlc opened this issue Dec 7, 2020 · 3 comments
Closed

Allow --dev to run without wasm #7675

xlc opened this issue Dec 7, 2020 · 3 comments

Comments

@xlc
Copy link
Contributor

xlc commented Dec 7, 2020

There isn't any point to build wasm if we want to run with --dev, however if an empty wasm code was provided, the node will fail with Error: Service(Client(Execution(Other("InvalidModule")))).

Is it possible to defer the Wasm code validation on when the client is actually attempting to invoke the wasm executor? So for native execution mode, no wasm validation is needed (so that I can pass a dummy wasm instead to build a valid one).

xlc added a commit to AcalaNetwork/Acala that referenced this issue Dec 7, 2020
@bkchr
Copy link
Member

bkchr commented Dec 7, 2020

This will not be supported. Wasm execution is one of the main point of Substrate and we need to check if the Wasm spec_version is compatible to the native spec_version. This is the reason we need to have the Wasm code available. However you could provide some dummy wasm binary that only exports Core_version and exports the correct version.

@bkchr bkchr closed this as completed Dec 7, 2020
@xlc
Copy link
Contributor Author

xlc commented Dec 7, 2020

That will work. Can you reopen this and make this to improve the generated dummy wasm so it exposes Core_version?
I guess some other work are needed so we can get spec_version easily. Now we are using crates version for pallet version, maybe we can do similar thing for spec_version? Use the value from Cargo.toml instead of configure it in source code?

@bkchr
Copy link
Member

bkchr commented Dec 7, 2020

No, if you need this kind of stuff, implement it. The "dummy wasm" is just Code = None. This is no code and I clearly don't want to invest in building more stuff to bloat this up for a very niche use case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants