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

Remove wasmi as sc-executor backend #13496

Closed
bkchr opened this issue Feb 28, 2023 · 12 comments · Fixed by #13800
Closed

Remove wasmi as sc-executor backend #13496

bkchr opened this issue Feb 28, 2023 · 12 comments · Fixed by #13800
Labels
I7-refactor Code needs refactoring.

Comments

@bkchr
Copy link
Member

bkchr commented Feb 28, 2023

wasmi should be removed as sc-executor backend. It was quite useful in the early days, but it will never be as fast as wasmtime which is currently the de-facto standard in Substrate. For the beginning it should probably be enough to just remove the crate and keep the current structure with sc-executor/sc-executor-wasmtime. In the future we may could merge these both crates as well to remove unneeded code and to simplify the entire structure.

@bkchr bkchr added the I7-refactor Code needs refactoring. label Feb 28, 2023
@bkchr bkchr added this to SDK Node Feb 28, 2023
@github-project-automation github-project-automation bot moved this to Backlog 🗒 in SDK Node Feb 28, 2023
@ghost
Copy link

ghost commented Mar 1, 2023

As substrate is a framework, shouldn't this removal be done via a deprecation process?

@bkchr
Copy link
Member Author

bkchr commented Mar 1, 2023

wasmtime is already the default since quite some time.

@liuchengxu
Copy link
Contributor

I notice Interpreted is still used as the default in some places though, probably nicer to update them to use Compiled and deprecate Interpreted.

NativeElseWasmExecutor::new(WasmExecutionMethod::Interpreted, None, 8, 2)

impl Default for WasmExecutionMethod {
fn default() -> WasmExecutionMethod {
WasmExecutionMethod::Interpreted
}

@koute
Copy link
Contributor

koute commented Mar 2, 2023

As substrate is a framework, shouldn't this removal be done via a deprecation process?

For any practical use-case the wasmi-based executor is useless as it's too slow, and it's mostly still here for historical reasons. No one should really be using it, but people do end up still accidentally using it since it's there, and then they encounter weird issues (either because it's too slow, or because almost no one uses it so it receives very little testing).

It makes sense to just remove it.

@ghost
Copy link

ghost commented Mar 2, 2023

useless
No one should really be using it
but people do end up still accidentally using it

core dev manual

No functionality should be removed without a deprecation warning period. In rust code: Use construct xyz...

@bkchr
Copy link
Member Author

bkchr commented Mar 2, 2023

Just because we remove the backend, doesn't mean that we can not put out these warnings. Especially for users (which hopefully don't use it) we can print warnings.

@ghost
Copy link

ghost commented Mar 2, 2023

Just because we remove the backend, doesn't mean that we can not put out these warnings.

I talk about functionality-deprecation.

You talk about functionality-slaughter.

All good, just go on.

@bkchr
Copy link
Member Author

bkchr commented Mar 2, 2023

There is no functionality slaughter. The wasmtime backend is doing exactly the same, faster and better. Not sure why we should keep something around that is not maintained anymore.

@ghost
Copy link

ghost commented Mar 2, 2023

Not sure why we should keep something around that is not maintained anymore.

Not "keep"...

As substrate is a framework, shouldn't this removal be done via a deprecation process?

=> remove via a deprecation-process (= standard practice)

@yjhmelody
Copy link
Contributor

I could cleanup wasmi-executor, It's not hard for me to remove it.

@bkchr
Copy link
Member Author

bkchr commented Mar 30, 2023

@yjhmelody feel free to remove it!!

@yjhmelody
Copy link
Contributor

be happy to do it after #13740

@github-project-automation github-project-automation bot moved this from Backlog 🗒 to Done ✅ in SDK Node May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I7-refactor Code needs refactoring.
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

4 participants