Skip to content
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

[Feature]: Investigate the Impact of Using wasm-opt on Contracts to Reduce Gas Costs #468

Open
1 task done
0xNeshi opened this issue Dec 27, 2024 · 0 comments
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.

Comments

@0xNeshi
Copy link
Collaborator

0xNeshi commented Dec 27, 2024

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

  • I agree to follow this project's Contribution Guidelines
@0xNeshi 0xNeshi added priority: 1 We will do our best to deal with this. type: perf Performance work. effort: medium Default level of effort. labels Dec 27, 2024
@0xNeshi 0xNeshi added the type: build Related to build configuration. label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
Status: Todo
Development

No branches or pull requests

1 participant