SNS upgrade canister wasm limit

It seems after upgrading to the latest SNS version there is a lower limit on wasm size when upgrading. Is there a way to increase it for a canister with a proposal?

Trying to upgrade using quill produces error:
“the maximum canister WASM and argument size for UpgradeSnsControlledCanister is 2000000 bytes.”

Before upgrading SNS the canister was deploying. It is 2,070,589 bytes. Just 70kb above. Any suggestions on how to optimize it with moc compiler arguments or another tool are welcome. It has 3 actors inside, so that’s why it’s bigger.

The canister we are trying to upgrade - https://dashboard.internetcomputer.org/canister/wxer6-3yaaa-aaaal-qjnua-cai

Hi @infu,

Looks like the limit was introduced around 4 months ago in 7842ba0dd46bc44036448b7449c6c0ee26f0ae89.

Are you trying to upgrade to a gzipped WASM? If not, that might help.

Otherwise, it’s hard to tell how to optimize the WASM size without seeing your code. Maybe there are some dependencies / libraries that you could remove?

Pinging @ggreif and @chenyan in case there’s a better way to optimize Motoko for WASM size.

I am compiling it with moc. So I can just gzip the wasm and try to deploy the gzipped file?

Ok that worked. Thanks!

2 Likes

Please check out Canister Optimizer available in dfx 0.14.0. It can significantly reduce Wasm size.

4 Likes