This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Remove dependency on sandboxing host functions#9592
Merged
2 commits merged intomasterfrom Aug 25, 2021
Merged
Conversation
Member
Author
|
/benchmark runtime pallet pallet_contracts |
|
Benchmark Runtime Pallet for branch "at-wasmi-runtime" with command cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs Results |
…path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
6800b79 to
961824d
Compare
cmichi
approved these changes
Aug 25, 2021
pepyakin
approved these changes
Aug 25, 2021
| use sp_std::collections::btree_map::BTreeMap; | ||
| use sp_std::fmt; | ||
|
|
||
| use super::{Error, HostError, HostFuncType, ReturnValue, Value, TARGET}; |
Contributor
There was a problem hiding this comment.
heh, handy that we haven't killed this.
| .saturating_add((113_515_000 as Weight).saturating_mul(c as Weight)) | ||
| // Standard Error: 7_000 | ||
| .saturating_add((2_314_000 as Weight).saturating_mul(s as Weight)) | ||
| (479_578_000 as Weight) |
Member
Author
|
bot merge |
|
Trying merge. |
Wizdave97
pushed a commit
to Wizdave97/substrate
that referenced
this pull request
Aug 25, 2021
* Embed wasmi into the runtime * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
cmichi
pushed a commit
that referenced
this pull request
Sep 1, 2021
* Embed wasmi into the runtime * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes the dependency on sandboxing host functions by embedding wasmi into the runtime. Previously, it did live inside the client and needed said host functions to communicate with the runtime. This is necessary to use pallet_contracts on a parachain because the sandbox host functions are not supported there, yet.
With this PR, the sandbox always uses an embedded (compiled into the runtime) wasmi. The only exception is when the experimental
wasmer-sandboxfeature is enabled. In this case the host resident execution engine is used (wasmer in this case). Note that this does not work for the native runtime which will always use an embedded wasmi.