-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Remove dependency on sandboxing host functions #9592
Conversation
/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
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.
Broadly looks fine
use sp_std::collections::btree_map::BTreeMap; | ||
use sp_std::fmt; | ||
|
||
use super::{Error, HostError, HostFuncType, ReturnValue, Value, TARGET}; |
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.
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) |
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.
💢
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.
Ouch :)
bot merge |
Trying merge. |
* 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>
* 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 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-sandbox
feature 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.