[contracts] Remove stack height limiter wasm instrumentation (#12957)

* Remove stack height limiter from uploaded wasm

* fix benchmarks

* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts

Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
Sasha Gryaznov
2022-12-22 19:22:57 +02:00
committed by GitHub
parent 4083b5358a
commit 29f8f037b7
5 changed files with 12 additions and 69 deletions
+1 -14
View File
@@ -216,16 +216,6 @@ impl<'a, T: Config> ContractModule<'a, T> {
Ok(ContractModule { module: contract_module, schedule: self.schedule })
}
fn inject_stack_height_metering(self) -> Result<Self, &'static str> {
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 })
} else {
Ok(ContractModule { module: self.module, schedule: self.schedule })
}
}
/// Check that the module has required exported functions. For now
/// these are just entrypoints:
///
@@ -447,10 +437,7 @@ where
let memory_limits =
get_memory_limits(contract_module.scan_imports(&disallowed_imports)?, schedule)?;
let code = contract_module
.inject_gas_metering(determinism)?
.inject_stack_height_metering()?
.into_wasm_code()?;
let code = contract_module.inject_gas_metering(determinism)?.into_wasm_code()?;
Ok((code, memory_limits))
})()