-
Notifications
You must be signed in to change notification settings - Fork 176
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
Wasm on the Web #1990
Wasm on the Web #1990
Conversation
56bb71a
to
91b1bb4
Compare
In order to help contributions to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
use wasmer::NativeEngineExt; | ||
|
||
let engine = Engine::headless(); | ||
let engine = Engine::default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @jvff to confirm this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on call, this should be an improbable edge case that doesn't affect consensus, only the possibility of a client proposing a block. We should fix it eventually, but it's not a blocker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an issue tracking this future work: #2103.
{ | ||
let mut compiler_config = wasmer::Singlepass::default(); | ||
compiler_config.canonicalize_nans(true); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove newline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the newline is important here to visually separate the setup from the use of compiler_config
.
(Ideally it would be a builder! And then the whole thing would be one expression.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this is all doing one thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's small enough that I'm not particularly bothered by it. I think if we decide to make changes elsewhere I'll include it in the next push — otherwise I'd like to merge it without waiting another hour for CI so I can point linera-web
to it 😅
use wasmer::NativeEngineExt; | ||
|
||
let engine = Engine::headless(); | ||
let engine = Engine::default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on call, this should be an improbable edge case that doesn't affect consensus, only the possibility of a client proposing a block. We should fix it eventually, but it's not a blocker.
Motivation
We would like to be able to execute application blocks in the browser wallet.
Proposal
Make
linera-execution
'swasmer
feature work on the Web:Send
requirements for things that aren'tSend
on the Web (e.g.wasmer::Instance
)tokio::task::spawn_blocking
with a Web worker (to be done in a future PR).Test Plan
CI build of
linera-core
, and manual client worker build inlinera-web
.Once the Web wallet is all working as intended, we should add some tests using
wasm-bindgen-test
.Release Plan
Links