-
Notifications
You must be signed in to change notification settings - Fork 402
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
Cosmwasm v 0.11 - broken wasm files (deserialization error) #288
Comments
Thank you for the report. Could you upload |
Nevermind, it is in your repo. |
I tested contractv11.wasm (1.6M; @ethanfrey is it possible the contract is silently corrupted in the wasmd CLI or the chain because it is 1.6 MB in size? |
I don't see how 1.6MB fits in wasmd block limit. I have tried to upload similarly large files and gotten rejected by tendermint rpc. In any case, somewhere along the line in the tx processing (abci), this steps over some limit. I can look more where it is and how it gets that far. However, I wonder why this is so large. I usually get around 200kb when I compile with rust-optimizer. Was this optimized and stripped already? |
Hmmm..... wasmcli does compress (gzip) to about 1/3 of the size and we unzip on the other side. Maybe there is a limit there that is being silently enforced rather than throwing and error (I know we added protection against zip bombs). @alpe maybe you remember? Or I will investigate that Monday |
@ethanfrey, in folder artifacts there is a downsized (production) ready version of the contract with a size of 105kB, this version can be uploaded. So, it looks like that there is a limit (like you mentioned) somewhere in the ABCI interface. |
It looks like we have a 400kb limit hard coded (could raise it a bit) https://github.com/CosmWasm/wasmd/blob/master/x/wasm/internal/keeper/ioutil.go#L16 But the main issue is that we cut off at the end and don't return n error https://github.com/CosmWasm/wasmd/blob/master/x/wasm/internal/keeper/ioutil.go#L32 We'll fix it. Thank you for reporting |
Thank you Ethan. Yes, the missing error is the biggest problem for UX and security. The constant limit should probably be turned into a config of the application using x/wasm. Moving this ticket to wasmd. |
After I upgraded my toolchain to cosmwasm v 0.11. I can't upload contracts any longer to wasmd with 'wasmcli tx wasm store 'contractv11.wasm'
Following error encountered:
ERROR: create wasm contract failed: Error calling the VM: Error during static Wasm validation: Wasm bytecode could not be deserialized. Deserialization error: "I/O Error: UnexpectedEof": failed to execute message; message index: 0: failed to simulate tx
Of course I recompiled my existing contract with cargo clean/build/schema/wasm before.
Here are more details:
ls -l contractv11.wasm
-rwxr-xr-x 1 changed staff 1640608 Oct 10 20:35 contractv11.wasm
file contractv11.wasm
contractv11.wasm: WebAssembly (wasm) binary module version 0x1 (MVP)
$uname -a
Darwin MacBook-Pro-16-inch-2019 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
docker version
Client: Docker Engine - Community
Cloud integration 0.1.18
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 16:58:31 2020
OS/Arch: darwin/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:07:04 2020
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: v1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Here is the repo with the contract: https://github.com/BlockscapeLab/contractv11/tree/master
The text was updated successfully, but these errors were encountered: