-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
Add an option to emit deterministic code exclusively #465
Comments
Would it also be sufficient to disable them, e.g. emit an error whenever a float would slip into the binary? |
May be better validate this on wasm vm (backend) and via custom ts-lint rules on frontend? |
A more general mechanism I'd think of in this context could be a |
btw life's vm which specially designed for blockchain supported float points (it seems just avoiding non-deterministics with qNaN and sNaN). But currently their vm works as interpreter without jit EDIT |
yes, but
This will be validated again when smart contracts are deployed. But we want some friendly errors with source code lines, etc. And
I like this. Generally it is even possible (long-term, we don't really need this) to implement floats in deterministic way, they just gonna be really slow. |
@vgrichina You don't need slow emulation float points (soft-floats) because WebAssembly fully deterministic even for operations like |
So, it looks like implementing a |
@dcodeIO I think there is still a cause for cleaning up |
@vgrichina Whole Just need exclude |
For context: So far, pretty much everything within As noted by Max, there are other builtins that also work with integers, like One solution here could be a |
I like this proposal! |
Smart contracts for blockchain need to be fully deterministic.
As I understand it's not generally possible with floats (because of minor CPU differences).
We need to have an option to compile without floats. I think some parts of
std
use floats unexpectedly as replacement fornumber
which may pose some problems with this.The text was updated successfully, but these errors were encountered: