contracts: Allow stack height metering to be disabled (#10877)

* Allow stack height metering to be disabled

* cargo run --quiet --profile=production  --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

* cargo run --quiet --profile=production  --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 Bot <admin@parity.io>
This commit is contained in:
Alexander Theißen
2022-02-22 10:10:38 +01:00
committed by GitHub
parent 2893be8321
commit eb5f07a2e5
6 changed files with 697 additions and 679 deletions
@@ -566,6 +566,9 @@ fn inject_gas_metering<T: Config>(module: Module) -> Module {
}
fn inject_stack_metering<T: Config>(module: Module) -> Module {
let height = T::Schedule::get().limits.stack_height;
wasm_instrument::inject_stack_limiter(module, height).unwrap()
if let Some(height) = T::Schedule::get().limits.stack_height {
wasm_instrument::inject_stack_limiter(module, height).unwrap()
} else {
module
}
}