mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
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:
committed by
GitHub
parent
2893be8321
commit
eb5f07a2e5
@@ -191,10 +191,13 @@ impl<'a, T: Config> ContractModule<'a, T> {
|
||||
}
|
||||
|
||||
fn inject_stack_height_metering(self) -> Result<Self, &'static str> {
|
||||
let contract_module =
|
||||
wasm_instrument::inject_stack_limiter(self.module, self.schedule.limits.stack_height)
|
||||
if let Some(limit) = self.schedule.limits.stack_height {
|
||||
let contract_module = wasm_instrument::inject_stack_limiter(self.module, limit)
|
||||
.map_err(|_| "stack height instrumentation failed")?;
|
||||
Ok(ContractModule { module: contract_module, schedule: self.schedule })
|
||||
Ok(ContractModule { module: contract_module, schedule: self.schedule })
|
||||
} else {
|
||||
Ok(ContractModule { module: self.module, schedule: self.schedule })
|
||||
}
|
||||
}
|
||||
|
||||
/// Check that the module has required exported functions. For now
|
||||
|
||||
Reference in New Issue
Block a user