-
Notifications
You must be signed in to change notification settings - Fork 88
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
do not use f64/f32/usize as it fails some wasm runtimes (cosmwasm) #800
Comments
I am trying to strip contract, if that works. UPDATE: did not helped |
Okey, it was |
So such code if it runs in ics wasm-08 likely will not work. |
I stably reproduce on my contact, but failed to repro on small contract. When I copy paste PrefixedDenom instead of ref, check passes.
The only differnece, I copied |
Added cw-check example https://github.com/dzmitry-lahoda-forks/ibc-rs/tree/dz/9/ci/cw-check . It still may be usefull to do this to ensure it can run in wasm hosts with no floats support (blockchains). |
so ideally ibc-rs and its deps not to use usize |
Thank you for bringing this to our attention! Very subtle... |
I fixed thing, it works for me now. |
this so works only on wasm https://github.com/chipshort/wasm-float-transpiler, not riskv or bpf or native float free. but it may be alfa version, and having yet another layer of compilation can be buggy. |
Fixed in #894 |
Feature Summary
CosmWasm(wasmd), and hence IBC WASM-08 fail to upload wasm file if it has code with f32/f64.
Unfortunately some things have usize which sometimes handled with floats (crazy but fact https://medium.com/cosmwasm/debugging-floating-point-generation-in-rust-wasm-smart-contract-f47d833b5fba ).
Given these things and that ibc-rs to support many runtime (near, solana, aptos, ic) which also may dislike these floats (as constraint and blockchain enviroments in general) preventing usage of this with linter is good.
Usize, except for some reason some crates use floats to handle it (now sure why), is of variable size, which may lead to bugs, e.g. when target would be wasm64.
Proposal
Remove all f64/f32/usize usage and lint that from repo.
LEGACY
Proposal
I used ibc-rs, and in latest version I get
when it is part of contract.
I see old Cargo.lock
new
Also I found
f64
usage in this repo when not needed.So I do not use any things changed directly, and yet get issues.
Run
https://github.com/CosmWasm/cosmwasm/blob/main/packages/check/README.md
in CI.
I did not yet found root cause so.
Thing happend from 0.41 release inclusive and before 0.43. I was able to upload contract.
I think not only cw wasmd will be such, but wasm-08 too.
The text was updated successfully, but these errors were encountered: