Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Bump wasmtime to 6.0.0 #13429

Merged
merged 4 commits into from
Feb 23, 2023

Conversation

koute
Copy link
Contributor

@koute koute commented Feb 21, 2023

This PR updates wasmtime to 6.0.0.

This new version includes my fix to make LTO work again, so we can finally get rid of our own wasmtime fork.

Also of particular note here is that wasmtime 6.0.0 enabled a new optimization framework which heavily regresses the contracts pallet's performance (cc @athei); I still haven't finished investigating why exactly this happens, but for the time being we can just revert this back to 5.0.0's behavior by changing the relevant option when initializing wasmtime. Otherwise the performance looks to be mostly unchanged.

@koute koute added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Feb 21, 2023
@koute koute requested a review from a team February 21, 2023 12:43
@michalkucharczyk michalkucharczyk requested a review from a team February 21, 2023 12:53
Copy link
Member

@athei athei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the regression with egraphs can be removed by wasm-opt. But lets merge this and #13408 first. Then we can check if the regression persists in a follow up PR.

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

client/executor/wasmtime/src/runtime.rs Show resolved Hide resolved
@koute
Copy link
Contributor Author

koute commented Feb 23, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 5a1d521 into paritytech:master Feb 23, 2023
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Bump `wasmtime` to 6.0.0

* Disable cranelift egraphs
ukint-vs pushed a commit to gear-tech/substrate that referenced this pull request Apr 10, 2023
* Bump `wasmtime` to 6.0.0

* Disable cranelift egraphs
ukint-vs pushed a commit to gear-tech/substrate that referenced this pull request Apr 13, 2023
* Bump `wasmtime` to 6.0.0

* Disable cranelift egraphs
breathx pushed a commit to gear-tech/substrate that referenced this pull request Apr 22, 2023
* Bump `wasmtime` to 6.0.0

* Disable cranelift egraphs
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* Bump `wasmtime` to 6.0.0

* Disable cranelift egraphs
kayabaNerve added a commit to serai-dex/substrate that referenced this pull request Aug 23, 2023
Substrate prior disabled egraph-based optimizations due to its performance
impact on pallets-contract
(paritytech#13429).

This commit performs the upgrade without benchmarking. Why?
1) pallets-contract isn't in-tree.
2) The only option now is egraph based optimizations, making this inevitable.
3) A preference for security and simplicity over performance.

The second reason doesn't hold. We could wait until egraph based performance is
equivalent or better, and then while it's still inevitable, it'd have been
delayed long enough to not be an issue.

The third reason is the real one. By not upgrading, we missed out on
performance and security updates. While none critical, most appreciated. This
also reduces the size of our tree, improving compilation times and supply chain
scope.

For benefits introduced with wasmtime 12, please see:
1) Improved native call performance (since wasmtime 9)
2) Wider SIMD support (since wasmtime 9, further improved in 11)
3) Fixing of a soundness issue (wasmtime issue 6509)
4) Misc performance improvements
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

5 participants