[Feature]: Investigate the Impact of Using wasm-opt
on Contracts to Reduce Gas Costs
#468
Open
1 task done
Labels
effort: medium
Default level of effort.
priority: 1
We will do our best to deal with this.
type: build
Related to build configuration.
type: perf
Performance work.
What is the feature you would like to see?
Optimizing the generated contract wasm for size or speed could impact the gas costs associated with both deploying the contract, and calling the contract. This could have major effects on cryptographic function-related gas costs, ideally further proving the benefits of using Stylus over Solidity.
We have a couple of big contracts that we had to break up (e.g. Erc1155 and Erc721 examples), which is a problem our lib users will also have. A contract size reduction could mean the difference between deploying one contract, and deploying multiple contracts to avoid the size issue (as we had to do).
There's a tool called
wasm-opt
that can perform these optimizations.We should investigate its the impact on Stylus contracts.
If
wasm-opt
turns out useful, it could be beneficial to push the Stylus team to integrate it into the Stylus CLI, so that everyone will have its gas cost benefits, without having to manually integrate it into their workflow, as most probably won't bother.https://rustwasm.github.io/docs/book/reference/code-size.html#use-the-wasm-opt-tool
Contribution Guidelines
The text was updated successfully, but these errors were encountered: