-
Notifications
You must be signed in to change notification settings - Fork 122
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
switch runtime to wasm only #701
Conversation
Signed-off-by: Yi <[email protected]>
Before remove native binary size: 134MB. Compiler env: cargo 1.61.0 (a028ae42f 2022-04-29) stable on MacPro 2022 M1 Chip |
Use polkadot-launch raising up a local network. It works well. |
Signed-off-by: Yi <[email protected]>
Signed-off-by: Yi <[email protected]>
This is also part of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this force-debug
feature for debugging: https://github.com/PureStake/moonbeam/blob/master/runtime/moonbase/Cargo.toml#L252
When we compile for wasm a lot of the debug impl is stripped, so we will be getting <wasm:stripped>
in logs
Until now we've been working around this by running with native while debugging, but this is better solution
This is the log implementation if you're curios https://paritytech.github.io/substrate/master/src/sp_debug_derive/impls.rs.html#46-175
We could probably also use disable-logging
feature for releases to shrink the size further.
Can you also write a description for the PR.
Signed-off-by: Yi <[email protected]>
Signed-off-by: Yi <[email protected]>
Signed-off-by: Yi <[email protected]>
Signed-off-by: Yi <[email protected]>
for the
|
Signed-off-by: Yi <[email protected]>
Signed-off-by: Yi <[email protected]>
Signed-off-by: Yi <[email protected]>
Signed-off-by: Adam Reif <[email protected]>
RPC is part of the client, this change is referring to the runtime. Also recall that in all of our production nodes the client is already only communicating with a wasm-executed runtime. So there should not be any performance loss/gain from this change. Following the link chain you can find the broader discussion paritytech/polkadot-sdk#62. The main problem with native runtime (imo) is that there's a chance that the network can run runtimes compiled with different compiler versions, which was partly the reason for a major stall on Polkadot already. @flame4 I'd put some of these more important discussion issues and linked PRs in the description so they can be in plain view of reviewers. |
Runtime Executor is part of the client as well. Check the diffs on this PR. The argument here is, what's wrong with the CLI flag? Second argument is - if this performance difference is negligible, this whole discussion doesn't matter. |
Not sure i'm following. But 1. we will continue running our runtime in WASM and 2.The client will always be native. |
No argument there for collator nodes. My point is that for full nodes, forcing WASM over native runtime is wasteful. |
I guess I'm still not following, but can you ask your question in the upstream discussion. Perhaps they can answer. |
I'll do that. In the meantime - CC @stechu for a second opinion |
Actually I think I get what you mean, but we need to measure the system as a whole to see whether RPC nodes are the bottleneck. Definitely out of scope of this PR. And in the end of the day you can always spawn more RPC nodes if that's the bottleneck. |
Probably it would be best to compile a list of all the benefits in 1 place. |
My concern was answered here paritytech/polkadot-sdk#62 We're good to merge this :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we're not:
- Please add A- C- and L- labels :)
@Garandor @ghzlatarev @flame4 for the RPC performance discussion, I think it really depends on kind of RPC we are doing. To make it simple, let's imagine two extreme scenarios:
Clearly, switching to wasm only execution only affect |
Already Add. Please review it. |
Signed-off-by: Yi [email protected]
Description
relates to PR closes: paritytech/substrate#469.
This PR switch the runtime to wasm only, instead of NativeElseWasmExecutor.
It means in compiled binary, it'll never contain a native runtime.
You can get more relative issue on paritytech/substrate#469, but the brief benifit i think is:
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
<branch>/CHANGELOG.md
Files changed
in the Github PR explorer.Situational Notes:
BaseFilter
. Ensure every extrinsic works from front-end. If there's corresponding tool, ensure both work for each other.try-runtime
. This includes migrations inherited from upstream changes, and you can search the diffs for modifications of#[pallet::storage]
items to check for any.authoring_version
: The version of the authorship interface. An authoring node will not attempt to author blocks unless this is equal to its native runtime.spec_version
: The version of the runtime specification. A full node will not attempt to use its native runtime in substitute for the on-chain Wasm runtime unless all of spec_name, spec_version, and authoring_version are the same between Wasm and native.impl_version
: The version of the implementation of the specification. Nodes are free to ignore this; it serves only as an indication that the code is different; as long as the other two versions are the same then while the actual code may be different, it is nonetheless required to do the same thing. Non-consensus-breaking optimizations are about the only changes that could be made which would result in only the impl_version changing.transaction_version
: The version of the extrinsics interface. This number must be updated in the following circumstances: extrinsic parameters (number, order, or types) have been changed; extrinsics or pallets have been removed; or the pallet order in the construct_runtime! macro or extrinsic order in a pallet has been changed. You can run themetadata_diff.yml
workflow for help. If this number is updated, then thespec_version
must also be updated