contracts: Use proof_size from benchmarks (#13268)

* Avoid reading contract code when it is supplied in the extrinsic

* Remove custom proof size injection from schedule

* Set benchmarks pov_mode to Measure

* Reduce overestimation of code size on re-instrument

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts

* Do not override proof size from benchmark

* Do not charge proof size for basic block

* Incrase gas limit for tests

* Fix deletion queue to also use `proof_size`

* Fix tests

* Update frame/contracts/src/schedule.rs

Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com>

* Fix wrong schedule macro invocations

* Remove stale docs

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts

* Handle zero components

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts

* Fix instruction weight

---------

Co-authored-by: command-bot <>
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Alexander Theißen
2023-02-15 22:56:50 +01:00
committed by GitHub
parent 3c0d8fe149
commit 1c04ab0f6f
8 changed files with 2173 additions and 2021 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ pub use crate::wasm::{
use crate::{
exec::{ExecResult, Executable, ExportedFunction, Ext},
gas::GasMeter,
AccountIdOf, BalanceOf, CodeHash, CodeStorage, CodeVec, Config, Error, RelaxedCodeVec,
AccountIdOf, BalanceOf, CodeHash, CodeVec, Config, Error, OwnerInfoOf, RelaxedCodeVec,
Schedule,
};
use codec::{Decode, Encode, MaxEncodedLen};
@@ -191,7 +191,7 @@ impl<T: Config> PrefabWasmModule<T> {
/// Returns `0` if the module is already in storage and hence no deposit will
/// be charged when storing it.
pub fn open_deposit(&self) -> BalanceOf<T> {
if <CodeStorage<T>>::contains_key(&self.code_hash) {
if <OwnerInfoOf<T>>::contains_key(&self.code_hash) {
0u32.into()
} else {
// Only already in-storage contracts have their `owner_info` set to `None`.