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

feat: Initial multivalue WASM proposal support #4379

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

ark0f
Copy link
Member

@ark0f ark0f commented Dec 6, 2024

No description provided.

@ark0f ark0f added A0-pleasereview PR is ready to be reviewed by the team D5-tooling Helper tools and utilities labels Dec 6, 2024
@ark0f ark0f force-pushed the al/wasm-multi-value branch from 19b9fcd to 7724179 Compare December 6, 2024 23:04
@ark0f ark0f force-pushed the al/wasm-multi-value branch from 0008c76 to 2284259 Compare December 7, 2024 12:39
@@ -592,9 +592,10 @@ debug = true
[patch.crates-io]
# sp-io = { version = "38.0.0", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409" }
# sp-application-crypto = { version = "38.0.0", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409" }

# these patched dependecies force their `sign_ext` feature to be used by Substrate dependencies

Choose a reason for hiding this comment

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

Are these patches necessary? Substrate (runtime) does not use sign-ext: https://github.com/paritytech/polkadot-sdk/blob/906fa9e51306635245a22e03160d1c761fae6cc3/substrate/utils/wasm-builder/src/wasm_project.rs#L850. Same goes for outdated version wasmi 0.13.2 in our Cargo.lock.

@@ -17,6 +17,10 @@ gwasm-instrument = { workspace = true, features = ["sign_ext"] }
derive_more.workspace = true
enum-iterator.workspace = true

# TODO: remove when tooling is updated

Choose a reason for hiding this comment

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

Before updating tooling, it makes sense to replace parity-wasm with gear-wasm in all our crates (except wasmi 0.13.2 and other substrate-related dependencies).

Also try applying existing patches to our tooling as git dependency:

Choose a reason for hiding this comment

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

It should also be under [target.'cfg(force_wasmer_cranelift_i_know_what_i_do)'.dependencies].

@StackOverflowExcept1on
Copy link
Member

StackOverflowExcept1on commented Dec 10, 2024

One more note: the multivalue refers not only to fn f() -> (i32, i32), but also to the fact that loop, if, block instructions can input/output multiple parameters. This might be worth checking and putting restrictions on it (as we do for call_indirect). Here's an example wat: https://github.com/gear-tech/wasm-instrument/blob/multi-value/tests/fixtures/stack-height/multi_value_if.wat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team D5-tooling Helper tools and utilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants