Skip to content
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

Create WebAssembly build #293

Open
axic opened this issue Mar 23, 2021 · 2 comments
Open

Create WebAssembly build #293

axic opened this issue Mar 23, 2021 · 2 comments

Comments

@axic
Copy link
Member

axic commented Mar 23, 2021

For quite a long time we considered creating a WebAssembly build, going back as far as when runevm was created. We did try, but since evmone was using exceptions at the time it was not straightforward -- they are not yet supported natively by wasm, so the only option was commercial compilers or emscripten, both create additional scaffolding. Today however evmone is exception-free.

Probably there would not be many immediate use cases/users, but the following situations may change it:
a) Should computationally heavy opcodes be added to the EVM (akin to evm384), then a Wasm build would likely be faster than ethereumjs + BigInt and could speed up browser tools (e.g. remix, metamask)
b) If Silkworm gets used in dfinity
c) Widespread use of browser-based light clients

Since Silkworm already compiles to Wasm that means evmone compiles already too. The only thing left here is adding some CI tasks for creating builds here.

@axic
Copy link
Member Author

axic commented May 20, 2021

I think all it takes is installing wasi-sdk on cpp-build-env (the latest release requires llvm9+, and is built for llvm11) and adding a toolchain file with --target=wasm32-wasi --sysroot=/path/to/sysroot -fno-exceptions.

Though the README is unclear, perhaps llvm11 has wasi-libc also included.

This was referenced May 20, 2021
@axic
Copy link
Member Author

axic commented May 24, 2021

We should also look into compilation with emscripten, as that gives us more control over the exposed API.

WASI would be good for a build containing the evmc CLI tool and evmone (and potentially precompiles).

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

No branches or pull requests

1 participant