-
Notifications
You must be signed in to change notification settings - Fork 1
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
New AssemblyScript compiler introduced floats #73
Comments
That's strange. I can't see any |
I do not remember exactly which contract out of the two given generated floats. |
The version of the compiler is currently tied to near-shell, so the dependency |
Also I can't download the zip file as dropbox says it's too large and I can't open the |
@willemneal Did you figure out how to download the dropbox file? |
When we compile AssemblyScript that does not use floats it gets compiled into WebAssembly that uses float operations. Float operations are not allowed for smart contracts, since they introduce non-determinism, see relevant: AssemblyScript#732
To reproduce:
Copy smart contracts:
https://www.dropbox.com/sh/yd1gi0a83robwvc/AACGJhts5TBr6OlOtWcZrg0sa?dl=0
https://www.dropbox.com/sh/5m4thls6bd3nwhw/AADa3CakXizUxfpA_d9Vwieta?dl=0
Do not rebuild them (since we have near-runtime-ts and near-shell should depend on a fixed version of AssemblyScript compiler near-runtime-ts#85 and I cannot tell what AssemblyScript will be like at the moment of someone trying to reproduce this issue);
Launch contracts:
(Fix the path to nearcore)
Observe the error message:
Expected: to get no error message.
To see that it is float-related comment out https://github.com/nearprotocol/nearcore/blob/2cb653181143cfe4a0c8b2eac5a9e7701e88d1ea/runtime/near-vm-runner/src/prepare.rs#L59 and try again, it will succeed this time.
The text was updated successfully, but these errors were encountered: