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

Reduce CosmWasm gas cost by a factor of 1000 #1599

Closed
webmaster128 opened this issue Jan 25, 2023 · 0 comments · Fixed by #1884
Closed

Reduce CosmWasm gas cost by a factor of 1000 #1599

webmaster128 opened this issue Jan 25, 2023 · 0 comments · Fixed by #1884
Milestone

Comments

@webmaster128
Copy link
Member

We have been warned that gas consumption might hit the uint64 limit and lead to overflows or crashes. In https://github.com/CosmWasm/cosmwasm/pull/1222/files we documented why this cannot easily happen.

However, the gas values in CosmWasm are incredibly high. Each Wasm operation costs 150_000 gas and the Cosmos SDK / CosmWasm gas multiplier is at 140_000_000.

Reducing the factor allows us to get an additional safety margin of 1000x while preserving the necessary granularity level. This additional safety can be useful in the event of mispricing or execution times much larger than typical block times we see today.

CosmWasm 1.x CosmWasm 2.x
Cost target 1 Teragas/millisecond 1 Teragas/second
Exceeds uint64 range after 5 hours 5124 hours (213 days)
Cost per Wasm op 150_000 150
Multiplier 140_000_000 140_000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant