dfinity / ic-wasm

A collection of libraries and tools for transforming Wasm canisters running on the Internet Computer
Apache License 2.0
34 stars 5 forks source link

Support gzipped WASM inputs in `utils::parse_wasm` and `utils::parse_wasm_file` #55

Closed aterga closed 8 months ago

aterga commented 8 months ago

The goal of this PR is to support gzipped WASMs as inputs in the ic-wasm crate. This is aligned with the IC interface spec that says:

WebAssembly modules that are (slightly) larger than 2MB can still be installed on ICP by using gzip file compression before uploading; ICP will then decompress the file and install the contained WebAssembly module.

https://internetcomputer.org/docs/current/developer-docs/smart-contracts/deploy/larger-wasm/

aterga commented 8 months ago

Another related question, if the input is gzipped, do we expect the output to be gzipped as well?

Good question. In my view, this should be controlled separately. I.e., we could add a feature to enable emitting gzipped WASMs, but it doesn't have to be part of this feature.