Add Proof Size to Weight Output (#11637)

* initial impl

* add template test

* linear fit proof size

* always record proof when tracking storage

* calculate worst case pov

* remove duplicate worst case

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* more comment output

* add cli for worst case map size

* update name

* clap does not support underscores

* rename

* expose worst case map values

* improve some comments

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* update template

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* fix fmt

* more fmt

* more fmt

* Dont panic when there is no proof

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test features

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Whitelist :extrinsic_index

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use whitelist when recording proof

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add logs

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add PoV testing pallet

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Deploy PoV testing pallet

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Storage benches reside in the PoV pallet

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Linear regress PoV per component

Splits the PoV calculation into "measured" and "estimated".
The measured part is reported by the Proof recorder and linear
regressed over all components at once.
The estimated part is calculated as worst-case by using the max
PoV size per storage access and calculating one linear regress per
component. This gives each component a (possibly) independent PoV.
For now the measured size will always be lower than the PoV on
Polkadot since it is measured on an empty snapshot. The measured
part is therefor only used as diagnostic for debugging.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Put PoV into the weight templates

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Extra alanysis choise for PoV

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add+Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make benches faster

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Cleanup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use same template comments

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

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

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

* Update referenda mock BlockWeights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Take measured value size into account

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

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

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* proof_size: None

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* ugly, but works

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* wup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add pov_mode attribute to the benchmarks! macro

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use pov_mode attribute in PoV benchmarking

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Scheduler, Whitelist: Add pov_mode attr

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update PoV weights

* Add CLI arg: default-pov-mode

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fix

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Update PoV weights"

This reverts commit 2f3ac2387396470b118122a6ff8fa4ee12216f4b.

* Revert "WIP"

This reverts commit c34b538cd2bc45da4544e887180184e30957904a.

* Revert first approach

This reverts commit range 8ddaa2fffe5930f225a30bee314d0b7c94c344dd^..4c84f8748e5395852a9e0e25b0404953fee1a59e

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add extra benchmarks

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

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

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

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

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Clippy 🤦

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add reference benchmarks

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix doc comments

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Undo logging

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add 'Ignored' pov_mode

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Allow multiple attributes per benchmark

Turns out that the current benchmarking syntax does not support
multiple attributes per bench 🤦. Changing it to support that
since otherwise the `pov_mode` would conflict with the others.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Validate pov_mode syntax

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Ignore PoV for all contract benchmarks

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Bump macro recursion limit

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update contract weights

They dont have a PoV component anymore.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fix test ffs

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* pov_mode is unsupported in V2 syntax

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix pallet ui tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update pallet ui

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix pallet ui tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Your Name <you@example.com>
This commit is contained in:
Shawn Tabrizi
2023-01-26 19:35:39 -03:00
committed by GitHub
parent 41f819eb48
commit 1b27ae9549
74 changed files with 18668 additions and 9111 deletions
@@ -0,0 +1,371 @@
// This file is part of Substrate.
// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! All benchmarks in this file are just for debugging the PoV calculation logic, they are unused.
#![cfg(feature = "runtime-benchmarks")]
use super::*;
use frame_support::traits::UnfilteredDispatchable;
use frame_system::{Pallet as System, RawOrigin};
use sp_runtime::traits::Hash;
frame_benchmarking::benchmarks! {
storage_single_value_read {
Value::<T>::put(123);
}: {
assert_eq!(Value::<T>::get(), Some(123));
}
#[pov_mode = Ignored]
storage_single_value_ignored_read {
Value::<T>::put(123);
}: {
assert_eq!(Value::<T>::get(), Some(123));
}
storage_single_value_read_twice {
Value::<T>::put(123);
}: {
assert_eq!(Value::<T>::get(), Some(123));
assert_eq!(Value::<T>::get(), Some(123));
}
storage_single_value_write {
}: {
Value::<T>::put(123);
} verify {
assert_eq!(Value::<T>::get(), Some(123));
}
storage_single_value_kill {
Value::<T>::put(123);
}: {
Value::<T>::kill();
} verify {
assert!(!Value::<T>::exists());
}
// This benchmark and the following are testing a storage map with adjacent storage items.
//
// First a storage map is filled and a specific number of other storage items is
// created. Then the one value is read from the map. This demonstrates that the number of other
// nodes in the Trie influences the proof size. The number of inserted nodes can be interpreted
// as the number of `StorageMap`/`StorageValue` in the whole runtime.
#[pov_mode = Measured]
storage_1m_map_read_one_value_two_additional_layers {
(0..(1<<10)).for_each(|i| Map1M::<T>::insert(i, i));
// Assume there are 16-256 other storage items.
(0..(1u32<<4)).for_each(|i| {
let k = T::Hashing::hash(&i.to_be_bytes());
frame_support::storage::unhashed::put(k.as_ref(), &i);
});
}: {
assert_eq!(Map1M::<T>::get(1<<9), Some(1<<9));
}
#[pov_mode = Measured]
storage_1m_map_read_one_value_three_additional_layers {
(0..(1<<10)).for_each(|i| Map1M::<T>::insert(i, i));
// Assume there are 256-4096 other storage items.
(0..(1u32<<8)).for_each(|i| {
let k = T::Hashing::hash(&i.to_be_bytes());
frame_support::storage::unhashed::put(k.as_ref(), &i);
});
}: {
assert_eq!(Map1M::<T>::get(1<<9), Some(1<<9));
}
#[pov_mode = Measured]
storage_1m_map_read_one_value_four_additional_layers {
(0..(1<<10)).for_each(|i| Map1M::<T>::insert(i, i));
// Assume there are 4096-65536 other storage items.
(0..(1u32<<12)).for_each(|i| {
let k = T::Hashing::hash(&i.to_be_bytes());
frame_support::storage::unhashed::put(k.as_ref(), &i);
});
}: {
assert_eq!(Map1M::<T>::get(1<<9), Some(1<<9));
}
// Reads from both storage maps each `n` and `m` times. Should result in two linear components.
storage_map_read_per_component {
let n in 0 .. 100;
let m in 0 .. 100;
(0..m*10).for_each(|i| Map1M::<T>::insert(i, i));
(0..n*10).for_each(|i| Map16M::<T>::insert(i, i));
}: {
(0..m).for_each(|i|
assert_eq!(Map1M::<T>::get(i*10), Some(i*10)));
(0..n).for_each(|i|
assert_eq!(Map16M::<T>::get(i*10), Some(i*10)));
}
#[pov_mode = MaxEncodedLen {
Pov::Map1M: Ignored
}]
storage_map_read_per_component_one_ignored {
let n in 0 .. 100;
let m in 0 .. 100;
(0..m*10).for_each(|i| Map1M::<T>::insert(i, i));
(0..n*10).for_each(|i| Map16M::<T>::insert(i, i));
}: {
(0..m).for_each(|i|
assert_eq!(Map1M::<T>::get(i*10), Some(i*10)));
(0..n).for_each(|i|
assert_eq!(Map16M::<T>::get(i*10), Some(i*10)));
}
// Reads the same value from a storage map. Should not result in a component.
storage_1m_map_one_entry_repeated_read {
let n in 0 .. 100;
Map1M::<T>::insert(0, 0);
}: {
(0..n).for_each(|i|
assert_eq!(Map1M::<T>::get(0), Some(0)));
}
// Reads the same values from a storage map. Should result in a `1x` linear component.
storage_1m_map_multiple_entry_repeated_read {
let n in 0 .. 100;
(0..n).for_each(|i| Map1M::<T>::insert(i, i));
}: {
(0..n).for_each(|i| {
// Reading the same value 10 times does nothing.
(0..10).for_each(|j|
assert_eq!(Map1M::<T>::get(i), Some(i)));
});
}
storage_1m_double_map_read_per_component {
let n in 0 .. 1024;
(0..(1<<10)).for_each(|i| DoubleMap1M::<T>::insert(i, i, i));
}: {
(0..n).for_each(|i|
assert_eq!(DoubleMap1M::<T>::get(i, i), Some(i)));
}
storage_value_bounded_read {
}: {
assert!(BoundedValue::<T>::get().is_none());
}
// Reading unbounded values will produce no mathematical worst case PoV size for this component.
storage_value_unbounded_read {
}: {
assert!(UnboundedValue::<T>::get().is_none());
}
#[pov_mode = Ignored]
storage_value_unbounded_ignored_read {
}: {
assert!(UnboundedValue::<T>::get().is_none());
}
// Same as above, but we still expect a mathematical worst case PoV size for the bounded one.
storage_value_bounded_and_unbounded_read {
}: {
assert!(UnboundedValue::<T>::get().is_none());
assert!(BoundedValue::<T>::get().is_none());
}
#[pov_mode = Measured]
measured_storage_value_read_linear_size {
let l in 0 .. 1<<22;
let v: sp_runtime::BoundedVec<u8, _> = sp_std::vec![0u8; l as usize].try_into().unwrap();
LargeValue::<T>::put(&v);
}: {
assert!(LargeValue::<T>::get().is_some());
}
#[pov_mode = MaxEncodedLen]
mel_storage_value_read_linear_size {
let l in 0 .. 1<<22;
let v: sp_runtime::BoundedVec<u8, _> = sp_std::vec![0u8; l as usize].try_into().unwrap();
LargeValue::<T>::put(&v);
}: {
assert!(LargeValue::<T>::get().is_some());
}
#[pov_mode = Measured]
measured_storage_double_value_read_linear_size {
let l in 0 .. 1<<22;
let v: sp_runtime::BoundedVec<u8, _> = sp_std::vec![0u8; l as usize].try_into().unwrap();
LargeValue::<T>::put(&v);
LargeValue2::<T>::put(&v);
}: {
assert!(LargeValue::<T>::get().is_some());
assert!(LargeValue2::<T>::get().is_some());
}
#[pov_mode = MaxEncodedLen]
mel_storage_double_value_read_linear_size {
let l in 0 .. 1<<22;
let v: sp_runtime::BoundedVec<u8, _> = sp_std::vec![0u8; l as usize].try_into().unwrap();
LargeValue::<T>::put(&v);
LargeValue2::<T>::put(&v);
}: {
assert!(LargeValue::<T>::get().is_some());
assert!(LargeValue2::<T>::get().is_some());
}
#[pov_mode = MaxEncodedLen {
Pov::LargeValue2: Measured
}]
mel_mixed_storage_double_value_read_linear_size {
let l in 0 .. 1<<22;
let v: sp_runtime::BoundedVec<u8, _> = sp_std::vec![0u8; l as usize].try_into().unwrap();
LargeValue::<T>::put(&v);
LargeValue2::<T>::put(&v);
}: {
assert!(LargeValue::<T>::get().is_some());
assert!(LargeValue2::<T>::get().is_some());
}
#[pov_mode = Measured {
Pov::LargeValue2: MaxEncodedLen
}]
measured_mixed_storage_double_value_read_linear_size {
let l in 0 .. 1<<22;
let v: sp_runtime::BoundedVec<u8, _> = sp_std::vec![0u8; l as usize].try_into().unwrap();
LargeValue::<T>::put(&v);
LargeValue2::<T>::put(&v);
}: {
assert!(LargeValue::<T>::get().is_some());
assert!(LargeValue2::<T>::get().is_some());
}
#[pov_mode = Measured]
storage_map_unbounded_both_measured_read {
let i in 0 .. 1000;
UnboundedMap::<T>::insert(i, sp_std::vec![0; i as usize]);
UnboundedMap2::<T>::insert(i, sp_std::vec![0; i as usize]);
}: {
assert!(UnboundedMap::<T>::get(i).is_some());
assert!(UnboundedMap2::<T>::get(i).is_some());
}
#[pov_mode = MaxEncodedLen {
Pov::UnboundedMap: Measured
}]
storage_map_partial_unbounded_read {
let i in 0 .. 1000;
Map1M::<T>::insert(i, 0);
UnboundedMap::<T>::insert(i, sp_std::vec![0; i as usize]);
}: {
assert!(Map1M::<T>::get(i).is_some());
assert!(UnboundedMap::<T>::get(i).is_some());
}
#[pov_mode = MaxEncodedLen {
Pov::UnboundedMap: Ignored
}]
storage_map_partial_unbounded_ignored_read {
let i in 0 .. 1000;
Map1M::<T>::insert(i, 0);
UnboundedMap::<T>::insert(i, sp_std::vec![0; i as usize]);
}: {
assert!(Map1M::<T>::get(i).is_some());
assert!(UnboundedMap::<T>::get(i).is_some());
}
// Emitting an event will not incur any PoV.
emit_event {
// Emit a single event.
let call = Call::<T>::emit_event { };
}: { call.dispatch_bypass_filter(RawOrigin::Root.into()).unwrap(); }
verify {
assert_eq!(System::<T>::events().len(), 1);
}
// A No-OP will not incur any PoV.
noop {
let call = Call::<T>::noop { };
}: {
call.dispatch_bypass_filter(RawOrigin::Root.into()).unwrap();
}
impl_benchmark_test_suite!(
Pallet,
mock::new_test_ext(),
mock::Test,
);
}
#[cfg(test)]
mod mock {
use sp_runtime::testing::H256;
type AccountId = u64;
type AccountIndex = u32;
type BlockNumber = u64;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
frame_support::construct_runtime!(
pub enum Test where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Baseline: crate::{Pallet, Call, Storage, Event<T>},
}
);
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin;
type Index = AccountIndex;
type BlockNumber = BlockNumber;
type RuntimeCall = RuntimeCall;
type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Header = sp_runtime::testing::Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
impl crate::Config for Test {
type RuntimeEvent = RuntimeEvent;
}
pub fn new_test_ext() -> sp_io::TestExternalities {
frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
}
}
+131
View File
@@ -0,0 +1,131 @@
// This file is part of Substrate.
// Copyright (C) 2020-2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! End-to-end testing pallet for PoV benchmarking. Should only be deployed in a testing runtime.
#![cfg_attr(not(feature = "std"), no_std)]
mod benchmarking;
mod tests;
mod weights;
pub use pallet::*;
#[frame_support::pallet]
pub mod pallet {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use sp_std::prelude::*;
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(PhantomData<T>);
#[pallet::config]
pub trait Config: frame_system::Config {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
}
#[pallet::storage]
pub(crate) type Value<T: Config> = StorageValue<Value = u32, QueryKind = OptionQuery>;
#[pallet::storage]
pub(crate) type Value2<T: Config> = StorageValue<Value = u32, QueryKind = OptionQuery>;
/// A value without a MEL bound.
#[pallet::storage]
#[pallet::unbounded]
pub(crate) type UnboundedValue<T: Config> =
StorageValue<Value = Vec<u8>, QueryKind = OptionQuery>;
/// A value with a MEL bound of 32 byte.
#[pallet::storage]
pub(crate) type BoundedValue<T: Config> =
StorageValue<Value = BoundedVec<u8, ConstU32<32>>, QueryKind = OptionQuery>;
/// 4MiB value.
#[pallet::storage]
pub(crate) type LargeValue<T: Config> =
StorageValue<Value = BoundedVec<u8, ConstU32<{ 1 << 22 }>>, QueryKind = OptionQuery>;
#[pallet::storage]
pub(crate) type LargeValue2<T: Config> =
StorageValue<Value = BoundedVec<u8, ConstU32<{ 1 << 22 }>>, QueryKind = OptionQuery>;
/// A map with a maximum of 1M entries.
#[pallet::storage]
pub(crate) type Map1M<T: Config> = StorageMap<
Hasher = Blake2_256,
Key = u32,
Value = u32,
QueryKind = OptionQuery,
MaxValues = ConstU32<1_000_000>,
>;
/// A map with a maximum of 16M entries.
#[pallet::storage]
pub(crate) type Map16M<T: Config> = StorageMap<
Hasher = Blake2_256,
Key = u32,
Value = u32,
QueryKind = OptionQuery,
MaxValues = ConstU32<16_000_000>,
>;
#[pallet::storage]
pub(crate) type DoubleMap1M<T: Config> = StorageDoubleMap<
Hasher1 = Blake2_256,
Hasher2 = Blake2_256,
Key1 = u32,
Key2 = u32,
Value = u32,
QueryKind = OptionQuery,
MaxValues = ConstU32<1_000_000>,
>;
#[pallet::storage]
#[pallet::unbounded]
pub(crate) type UnboundedMap<T: Config> =
StorageMap<Hasher = Blake2_256, Key = u32, Value = Vec<u32>, QueryKind = OptionQuery>;
#[pallet::storage]
#[pallet::unbounded]
pub(crate) type UnboundedMap2<T: Config> =
StorageMap<Hasher = Blake2_256, Key = u32, Value = Vec<u32>, QueryKind = OptionQuery>;
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
TestEvent,
}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(0)]
pub fn emit_event(_origin: OriginFor<T>) -> DispatchResult {
Self::deposit_event(Event::TestEvent);
Ok(())
}
#[pallet::call_index(1)]
#[pallet::weight(0)]
pub fn noop(_origin: OriginFor<T>) -> DispatchResult {
Ok(())
}
}
}
@@ -0,0 +1,211 @@
// This file is part of Substrate.
// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Test the produces weight functions.
#![cfg(test)]
use super::weights::WeightInfo;
use mock::Test as T;
type W = crate::weights::SubstrateWeight<T>;
#[test]
fn writing_is_free() {
let w = W::storage_single_value_write().proof_size();
assert_eq!(w, 0, "Writing is free");
}
#[test]
fn killing_is_free() {
// NOTE: This only applies to state version 1.
let w = W::storage_single_value_kill().proof_size();
assert_eq!(w, 0, "Killing is free");
}
#[test]
fn reading_twice_is_the_same_as_once() {
let w = W::storage_single_value_read().proof_size();
let w2 = W::storage_single_value_read_twice().proof_size();
assert_eq!(w, w2, "Reading twice is the same as once");
}
#[test]
fn storage_single_value_ignored_read_no_pov() {
let w = W::storage_single_value_ignored_read();
assert_eq!(w.proof_size(), 0, "Ignored PoV does not result in PoV");
}
#[test]
fn storage_single_value_ignored_some_read_has_pov() {
let w = W::storage_single_value_ignored_some_read();
assert!(w.proof_size() != 0, "Ignored some does result in PoV");
}
/// Reading the same value from a map does not increase the PoV.
#[test]
fn storage_1m_map_one_entry_repeated_read_const() {
let weight = W::storage_1m_map_one_entry_repeated_read;
let w0 = weight(0).proof_size();
assert!(w0 > 0, "There is a base weight");
let w1 = weight(1).proof_size();
assert_eq!(w0, w1, "Component does not matter");
}
/// Reading multiple values multiple times from a map increases the PoV by the number of reads.
#[test]
fn storage_1m_map_multiple_entry_repeated_read_single_linear() {
let weight = W::storage_1m_map_multiple_entry_repeated_read;
let w0 = weight(0).proof_size();
let w1 = weight(1).proof_size() - w0;
assert!(w1 > 0, "Component matters");
let wm = weight(1000).proof_size();
assert_eq!(w1 * 1000 + w0, wm, "x scales linearly");
}
/// Check that reading two maps at once increases the PoV linearly per map.
#[test]
fn storage_map_read_per_component_double_linear() {
let weight = W::storage_map_read_per_component;
let w00 = weight(0, 0).proof_size();
let w10 = weight(1, 0).proof_size() - w00;
let w01 = weight(0, 1).proof_size() - w00;
assert!(w10 > 0 && w01 > 0, "Components matter");
assert!(w10 != w01, "Each map has its own component");
let wm0 = weight(1000, 0).proof_size();
let w0m = weight(0, 1000).proof_size();
assert_eq!(w00 + w10 * 1000, wm0, "x scales linearly");
assert_eq!(w00 + w01 * 1000, w0m, "y scales linearly");
let wmm = weight(1000, 1000).proof_size();
assert_eq!(wmm + w00, wm0 + w0m, "x + y scales linearly");
}
/// The proof size estimation takes the measured sizes into account and therefore increases with the
/// number of layers.
#[test]
fn additional_layers_do_not_matter() {
let w2 = W::storage_1m_map_read_one_value_two_additional_layers().proof_size();
let w3 = W::storage_1m_map_read_one_value_three_additional_layers().proof_size();
let w4 = W::storage_1m_map_read_one_value_four_additional_layers().proof_size();
assert!(w3 > w2 && w4 > w3, "Additional layers do matter");
}
/// Check that the measured value size instead of the MEL is used.
#[test]
fn linear_measured_size_works() {
let weight = W::measured_storage_value_read_linear_size;
let w0 = weight(0).proof_size();
let w1 = weight(1).proof_size() - w0;
assert_eq!(w1, 1, "x scales with a factor of 1");
let wm = weight(1000).proof_size();
assert_eq!(w1 * 1000 + w0, wm, "x scales linearly");
}
// vice-versa of above `linear_measured_size_works`.
#[test]
fn linear_mel_size_works() {
let weight = W::mel_storage_value_read_linear_size;
let w1 = weight(1).proof_size();
let wm = weight(1000).proof_size();
assert_eq!(w1, wm, "PoV size is const");
}
/// Although there is no estimation possible, it uses the recorded proof size as best effort.
#[test]
fn unbounded_read_best_effort() {
let w = W::storage_value_unbounded_read().proof_size();
assert!(w > 0, "There is a weight");
}
/// For mixed unbounded and bounded reads, the bounded part still increases the PoV.
#[test]
fn partial_unbounded_read_best_effort() {
let w_unbounded = W::storage_value_unbounded_read().proof_size();
let w_bounded = W::storage_value_bounded_read().proof_size();
let w_partial = W::storage_value_bounded_and_unbounded_read().proof_size();
assert_eq!(w_bounded + w_unbounded, w_partial, "The bounded part increases the PoV");
}
#[test]
fn emit_event_is_free() {
let w = W::emit_event().proof_size();
assert_eq!(w, 0, "Emitting an event is free");
}
#[test]
fn noop_is_free() {
let w = W::noop().proof_size();
assert_eq!(w, 0, "Noop is free");
}
mod mock {
use sp_runtime::testing::H256;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
frame_support::construct_runtime!(
pub enum Test where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Baseline: crate::{Pallet, Call, Storage, Event<T>},
}
);
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin;
type Index = u32;
type BlockNumber = u64;
type RuntimeCall = RuntimeCall;
type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = u32;
type Lookup = sp_runtime::traits::IdentityLookup<Self::AccountId>;
type Header = sp_runtime::testing::Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ();
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
impl crate::Config for Test {
type RuntimeEvent = RuntimeEvent;
}
}
@@ -0,0 +1,807 @@
//! Autogenerated weights for frame_benchmarking_pallet_pov
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-01-23, STEPS: `50`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `oty-parity`, CPU: `11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
// ./target/release/substrate
// benchmark
// pallet
// --dev
// --pallet
// frame-benchmarking-pallet-pov
// --extrinsic
//
// --steps
// 50
// --repeat
// 1
// --template=.maintain/frame-weight-template.hbs
// --output=frame/benchmarking/pov/src/weights.rs
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use sp_std::marker::PhantomData;
/// Weight functions needed for frame_benchmarking_pallet_pov.
pub trait WeightInfo {
fn storage_single_value_read() -> Weight;
fn storage_single_value_ignored_read() -> Weight;
fn storage_single_value_ignored_some_read() -> Weight;
fn storage_single_value_read_twice() -> Weight;
fn storage_single_value_write() -> Weight;
fn storage_single_value_kill() -> Weight;
fn storage_1m_map_read_one_value_two_additional_layers() -> Weight;
fn storage_1m_map_read_one_value_three_additional_layers() -> Weight;
fn storage_1m_map_read_one_value_four_additional_layers() -> Weight;
fn storage_map_read_per_component(n: u32, m: u32, ) -> Weight;
fn storage_map_read_per_component_one_ignored(n: u32, m: u32, ) -> Weight;
fn storage_1m_map_one_entry_repeated_read(n: u32, ) -> Weight;
fn storage_1m_map_multiple_entry_repeated_read(n: u32, ) -> Weight;
fn storage_1m_double_map_read_per_component(n: u32, ) -> Weight;
fn storage_value_bounded_read() -> Weight;
fn storage_value_unbounded_read() -> Weight;
fn storage_value_unbounded_ignored_read() -> Weight;
fn storage_value_bounded_and_unbounded_read() -> Weight;
fn measured_storage_value_read_linear_size(l: u32, ) -> Weight;
fn mel_storage_value_read_linear_size(l: u32, ) -> Weight;
fn measured_storage_double_value_read_linear_size(l: u32, ) -> Weight;
fn mel_storage_double_value_read_linear_size(l: u32, ) -> Weight;
fn mel_mixed_storage_double_value_read_linear_size(l: u32, ) -> Weight;
fn measured_mixed_storage_double_value_read_linear_size(l: u32, ) -> Weight;
fn storage_map_unbounded_both_measured_read(i: u32, ) -> Weight;
fn storage_map_partial_unbounded_read(i: u32, ) -> Weight;
fn storage_map_partial_unbounded_ignored_read(i: u32, ) -> Weight;
fn emit_event() -> Weight;
fn noop() -> Weight;
}
/// Weights for frame_benchmarking_pallet_pov using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `499`
// Minimum execution time: 3_291 nanoseconds.
Weight::from_parts(3_291_000, 499)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: Ignored)
fn storage_single_value_ignored_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `0`
// Minimum execution time: 2_918 nanoseconds.
Weight::from_ref_time(2_918_000)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Pov Value2 (r:1 w:0)
/// Proof: Pov Value2 (max_values: Some(1), max_size: Some(4), added: 499, mode: Ignored)
fn storage_single_value_ignored_some_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `160`
// Estimated: `659`
// Minimum execution time: 4_056 nanoseconds.
Weight::from_parts(4_056_000, 659)
.saturating_add(T::DbWeight::get().reads(2_u64))
}
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_read_twice() -> Weight {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `499`
// Minimum execution time: 3_552 nanoseconds.
Weight::from_parts(3_552_000, 499)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov Value (r:0 w:1)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_write() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 795 nanoseconds.
Weight::from_ref_time(795_000)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: Pov Value (r:0 w:1)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_kill() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 865 nanoseconds.
Weight::from_ref_time(865_000)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Measured)
fn storage_1m_map_read_one_value_two_additional_layers() -> Weight {
// Proof Size summary in bytes:
// Measured: `1275`
// Estimated: `3750`
// Minimum execution time: 9_571 nanoseconds.
Weight::from_parts(9_571_000, 3750)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Measured)
fn storage_1m_map_read_one_value_three_additional_layers() -> Weight {
// Proof Size summary in bytes:
// Measured: `1544`
// Estimated: `4019`
// Minimum execution time: 14_597 nanoseconds.
Weight::from_parts(14_597_000, 4019)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Measured)
fn storage_1m_map_read_one_value_four_additional_layers() -> Weight {
// Proof Size summary in bytes:
// Measured: `2044`
// Estimated: `4519`
// Minimum execution time: 19_793 nanoseconds.
Weight::from_parts(19_793_000, 4519)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:100 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// Storage: Pov Map16M (r:100 w:0)
/// Proof: Pov Map16M (max_values: Some(16000000), max_size: Some(36), added: 3006, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
/// The range of component `m` is `[0, 100]`.
fn storage_map_read_per_component(n: u32, m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `515 + n * (188 ±0) + m * (188 ±0)`
// Estimated: `0 + n * (3006 ±0) + m * (2511 ±0)`
// Minimum execution time: 266_160 nanoseconds.
Weight::from_ref_time(190_477_747)
// Standard Error: 96_405
.saturating_add(Weight::from_ref_time(1_049_993).saturating_mul(n.into()))
// Standard Error: 96_405
.saturating_add(Weight::from_ref_time(1_202_546).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(Weight::from_proof_size(3006).saturating_mul(n.into()))
.saturating_add(Weight::from_proof_size(2511).saturating_mul(m.into()))
}
/// Storage: Pov Map1M (r:100 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Ignored)
/// Storage: Pov Map16M (r:100 w:0)
/// Proof: Pov Map16M (max_values: Some(16000000), max_size: Some(36), added: 3006, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
/// The range of component `m` is `[0, 100]`.
fn storage_map_read_per_component_one_ignored(n: u32, m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `515 + n * (188 ±0) + m * (188 ±0)`
// Estimated: `695 + n * (3195 ±2) + m * (189 ±2)`
// Minimum execution time: 265_113 nanoseconds.
Weight::from_parts(215_943_973, 695)
// Standard Error: 199_907
.saturating_add(Weight::from_ref_time(988_371).saturating_mul(n.into()))
// Standard Error: 199_907
.saturating_add(Weight::from_ref_time(1_145_693).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(Weight::from_proof_size(3195).saturating_mul(n.into()))
.saturating_add(Weight::from_proof_size(189).saturating_mul(m.into()))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
fn storage_1m_map_one_entry_repeated_read(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `170`
// Estimated: `2511`
// Minimum execution time: 119 nanoseconds.
Weight::from_parts(3_649_405, 2511)
// Standard Error: 4_472
.saturating_add(Weight::from_ref_time(432_147).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:100 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
fn storage_1m_map_multiple_entry_repeated_read(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `147 + n * (40 ±0)`
// Estimated: `0 + n * (2511 ±0)`
// Minimum execution time: 106 nanoseconds.
Weight::from_ref_time(59_892_609)
// Standard Error: 418_004
.saturating_add(Weight::from_ref_time(5_919_793).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_proof_size(2511).saturating_mul(n.into()))
}
/// Storage: Pov DoubleMap1M (r:1024 w:0)
/// Proof: Pov DoubleMap1M (max_values: Some(1000000), max_size: Some(68), added: 2543, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 1024]`.
fn storage_1m_double_map_read_per_component(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `21938 + n * (57 ±0)`
// Estimated: `0 + n * (2543 ±0)`
// Minimum execution time: 550 nanoseconds.
Weight::from_ref_time(65_431_603)
// Standard Error: 66_935
.saturating_add(Weight::from_ref_time(2_825_371).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_proof_size(2543).saturating_mul(n.into()))
}
/// Storage: Pov BoundedValue (r:1 w:0)
/// Proof: Pov BoundedValue (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
fn storage_value_bounded_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `528`
// Minimum execution time: 2_541 nanoseconds.
Weight::from_parts(2_541_000, 528)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov UnboundedValue (r:1 w:0)
/// Proof Skipped: Pov UnboundedValue (max_values: Some(1), max_size: None, mode: Measured)
fn storage_value_unbounded_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `604`
// Minimum execution time: 2_226 nanoseconds.
Weight::from_parts(2_226_000, 604)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov UnboundedValue (r:1 w:0)
/// Proof Skipped: Pov UnboundedValue (max_values: Some(1), max_size: None, mode: Ignored)
fn storage_value_unbounded_ignored_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `0`
// Minimum execution time: 2_100 nanoseconds.
Weight::from_ref_time(2_100_000)
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov UnboundedValue (r:1 w:0)
/// Proof Skipped: Pov UnboundedValue (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Pov BoundedValue (r:1 w:0)
/// Proof: Pov BoundedValue (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
fn storage_value_bounded_and_unbounded_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `1132`
// Minimum execution time: 2_808 nanoseconds.
Weight::from_parts(2_808_000, 1132)
.saturating_add(T::DbWeight::get().reads(2_u64))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// The range of component `l` is `[0, 4194304]`.
fn measured_storage_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `174 + l * (1 ±0)`
// Estimated: `666 + l * (1 ±0)`
// Minimum execution time: 3_385 nanoseconds.
Weight::from_parts(3_385_000, 666)
// Standard Error: 10
.saturating_add(Weight::from_ref_time(356).saturating_mul(l.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(Weight::from_proof_size(1).saturating_mul(l.into()))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// The range of component `l` is `[0, 4194304]`.
fn mel_storage_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `174 + l * (1 ±0)`
// Estimated: `4194803`
// Minimum execution time: 3_342 nanoseconds.
Weight::from_parts(3_342_000, 4194803)
// Standard Error: 6
.saturating_add(Weight::from_ref_time(345).saturating_mul(l.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// The range of component `l` is `[0, 4194304]`.
fn measured_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `1448 + l * (4 ±0)`
// Minimum execution time: 4_519 nanoseconds.
Weight::from_parts(4_519_000, 1448)
// Standard Error: 9
.saturating_add(Weight::from_ref_time(560).saturating_mul(l.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(4).saturating_mul(l.into()))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// The range of component `l` is `[0, 4194304]`.
fn mel_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `8389606`
// Minimum execution time: 4_462 nanoseconds.
Weight::from_parts(4_462_000, 8389606)
// Standard Error: 7
.saturating_add(Weight::from_ref_time(538).saturating_mul(l.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// The range of component `l` is `[0, 4194304]`.
fn mel_mixed_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `4195527 + l * (2 ±0)`
// Minimum execution time: 4_552 nanoseconds.
Weight::from_parts(4_552_000, 4195527)
// Standard Error: 6
.saturating_add(Weight::from_ref_time(507).saturating_mul(l.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(2).saturating_mul(l.into()))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// The range of component `l` is `[0, 4194304]`.
fn measured_mixed_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `4195527 + l * (2 ±0)`
// Minimum execution time: 4_236 nanoseconds.
Weight::from_parts(4_236_000, 4195527)
// Standard Error: 8
.saturating_add(Weight::from_ref_time(517).saturating_mul(l.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(2).saturating_mul(l.into()))
}
/// Storage: Pov UnboundedMap (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap (max_values: None, max_size: None, mode: Measured)
/// Storage: Pov UnboundedMap2 (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap2 (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[0, 1000]`.
fn storage_map_unbounded_both_measured_read(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `293 + i * (8 ±0)`
// Estimated: `5524 + i * (16 ±0)`
// Minimum execution time: 5_649 nanoseconds.
Weight::from_parts(6_111_237, 5524)
// Standard Error: 1_060
.saturating_add(Weight::from_ref_time(2_693).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(16).saturating_mul(i.into()))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// Storage: Pov UnboundedMap (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[0, 1000]`.
fn storage_map_partial_unbounded_read(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `260 + i * (4 ±0)`
// Estimated: `5243 + i * (4 ±0)`
// Minimum execution time: 5_997 nanoseconds.
Weight::from_parts(7_996_508, 5243)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(4).saturating_mul(i.into()))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// Storage: Pov UnboundedMap (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap (max_values: None, max_size: None, mode: Ignored)
/// The range of component `i` is `[0, 1000]`.
fn storage_map_partial_unbounded_ignored_read(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `260 + i * (4 ±0)`
// Estimated: `2768 + i * (4 ±0)`
// Minimum execution time: 5_679 nanoseconds.
Weight::from_parts(6_496_804, 2768)
// Standard Error: 611
.saturating_add(Weight::from_ref_time(930).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(4).saturating_mul(i.into()))
}
fn emit_event() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_087 nanoseconds.
Weight::from_ref_time(7_087_000)
}
fn noop() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_719 nanoseconds.
Weight::from_ref_time(2_719_000)
}
}
// For backwards compatibility and tests
impl WeightInfo for () {
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `499`
// Minimum execution time: 3_291 nanoseconds.
Weight::from_parts(3_291_000, 499)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: Ignored)
fn storage_single_value_ignored_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `0`
// Minimum execution time: 2_918 nanoseconds.
Weight::from_ref_time(2_918_000)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Pov Value2 (r:1 w:0)
/// Proof: Pov Value2 (max_values: Some(1), max_size: Some(4), added: 499, mode: Ignored)
fn storage_single_value_ignored_some_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `160`
// Estimated: `659`
// Minimum execution time: 4_056 nanoseconds.
Weight::from_parts(4_056_000, 659)
.saturating_add(RocksDbWeight::get().reads(2_u64))
}
/// Storage: Pov Value (r:1 w:0)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_read_twice() -> Weight {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `499`
// Minimum execution time: 3_552 nanoseconds.
Weight::from_parts(3_552_000, 499)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov Value (r:0 w:1)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_write() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 795 nanoseconds.
Weight::from_ref_time(795_000)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Pov Value (r:0 w:1)
/// Proof: Pov Value (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn storage_single_value_kill() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 865 nanoseconds.
Weight::from_ref_time(865_000)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Measured)
fn storage_1m_map_read_one_value_two_additional_layers() -> Weight {
// Proof Size summary in bytes:
// Measured: `1275`
// Estimated: `3750`
// Minimum execution time: 9_571 nanoseconds.
Weight::from_parts(9_571_000, 3750)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Measured)
fn storage_1m_map_read_one_value_three_additional_layers() -> Weight {
// Proof Size summary in bytes:
// Measured: `1544`
// Estimated: `4019`
// Minimum execution time: 14_597 nanoseconds.
Weight::from_parts(14_597_000, 4019)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Measured)
fn storage_1m_map_read_one_value_four_additional_layers() -> Weight {
// Proof Size summary in bytes:
// Measured: `2044`
// Estimated: `4519`
// Minimum execution time: 19_793 nanoseconds.
Weight::from_parts(19_793_000, 4519)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:100 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// Storage: Pov Map16M (r:100 w:0)
/// Proof: Pov Map16M (max_values: Some(16000000), max_size: Some(36), added: 3006, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
/// The range of component `m` is `[0, 100]`.
fn storage_map_read_per_component(n: u32, m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `515 + n * (188 ±0) + m * (188 ±0)`
// Estimated: `0 + n * (3006 ±0) + m * (2511 ±0)`
// Minimum execution time: 266_160 nanoseconds.
Weight::from_ref_time(190_477_747)
// Standard Error: 96_405
.saturating_add(Weight::from_ref_time(1_049_993).saturating_mul(n.into()))
// Standard Error: 96_405
.saturating_add(Weight::from_ref_time(1_202_546).saturating_mul(m.into()))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(Weight::from_proof_size(3006).saturating_mul(n.into()))
.saturating_add(Weight::from_proof_size(2511).saturating_mul(m.into()))
}
/// Storage: Pov Map1M (r:100 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: Ignored)
/// Storage: Pov Map16M (r:100 w:0)
/// Proof: Pov Map16M (max_values: Some(16000000), max_size: Some(36), added: 3006, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
/// The range of component `m` is `[0, 100]`.
fn storage_map_read_per_component_one_ignored(n: u32, m: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `515 + n * (188 ±0) + m * (188 ±0)`
// Estimated: `695 + n * (3195 ±2) + m * (189 ±2)`
// Minimum execution time: 265_113 nanoseconds.
Weight::from_parts(215_943_973, 695)
// Standard Error: 199_907
.saturating_add(Weight::from_ref_time(988_371).saturating_mul(n.into()))
// Standard Error: 199_907
.saturating_add(Weight::from_ref_time(1_145_693).saturating_mul(m.into()))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(Weight::from_proof_size(3195).saturating_mul(n.into()))
.saturating_add(Weight::from_proof_size(189).saturating_mul(m.into()))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
fn storage_1m_map_one_entry_repeated_read(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `170`
// Estimated: `2511`
// Minimum execution time: 119 nanoseconds.
Weight::from_parts(3_649_405, 2511)
// Standard Error: 4_472
.saturating_add(Weight::from_ref_time(432_147).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov Map1M (r:100 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 100]`.
fn storage_1m_map_multiple_entry_repeated_read(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `147 + n * (40 ±0)`
// Estimated: `0 + n * (2511 ±0)`
// Minimum execution time: 106 nanoseconds.
Weight::from_ref_time(59_892_609)
// Standard Error: 418_004
.saturating_add(Weight::from_ref_time(5_919_793).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_proof_size(2511).saturating_mul(n.into()))
}
/// Storage: Pov DoubleMap1M (r:1024 w:0)
/// Proof: Pov DoubleMap1M (max_values: Some(1000000), max_size: Some(68), added: 2543, mode: MaxEncodedLen)
/// The range of component `n` is `[0, 1024]`.
fn storage_1m_double_map_read_per_component(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `21938 + n * (57 ±0)`
// Estimated: `0 + n * (2543 ±0)`
// Minimum execution time: 550 nanoseconds.
Weight::from_ref_time(65_431_603)
// Standard Error: 66_935
.saturating_add(Weight::from_ref_time(2_825_371).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_proof_size(2543).saturating_mul(n.into()))
}
/// Storage: Pov BoundedValue (r:1 w:0)
/// Proof: Pov BoundedValue (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
fn storage_value_bounded_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `528`
// Minimum execution time: 2_541 nanoseconds.
Weight::from_parts(2_541_000, 528)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov UnboundedValue (r:1 w:0)
/// Proof Skipped: Pov UnboundedValue (max_values: Some(1), max_size: None, mode: Measured)
fn storage_value_unbounded_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `604`
// Minimum execution time: 2_226 nanoseconds.
Weight::from_parts(2_226_000, 604)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov UnboundedValue (r:1 w:0)
/// Proof Skipped: Pov UnboundedValue (max_values: Some(1), max_size: None, mode: Ignored)
fn storage_value_unbounded_ignored_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `0`
// Minimum execution time: 2_100 nanoseconds.
Weight::from_ref_time(2_100_000)
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov UnboundedValue (r:1 w:0)
/// Proof Skipped: Pov UnboundedValue (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Pov BoundedValue (r:1 w:0)
/// Proof: Pov BoundedValue (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
fn storage_value_bounded_and_unbounded_read() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `1132`
// Minimum execution time: 2_808 nanoseconds.
Weight::from_parts(2_808_000, 1132)
.saturating_add(RocksDbWeight::get().reads(2_u64))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// The range of component `l` is `[0, 4194304]`.
fn measured_storage_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `174 + l * (1 ±0)`
// Estimated: `666 + l * (1 ±0)`
// Minimum execution time: 3_385 nanoseconds.
Weight::from_parts(3_385_000, 666)
// Standard Error: 10
.saturating_add(Weight::from_ref_time(356).saturating_mul(l.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(Weight::from_proof_size(1).saturating_mul(l.into()))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// The range of component `l` is `[0, 4194304]`.
fn mel_storage_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `174 + l * (1 ±0)`
// Estimated: `4194803`
// Minimum execution time: 3_342 nanoseconds.
Weight::from_parts(3_342_000, 4194803)
// Standard Error: 6
.saturating_add(Weight::from_ref_time(345).saturating_mul(l.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// The range of component `l` is `[0, 4194304]`.
fn measured_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `1448 + l * (4 ±0)`
// Minimum execution time: 4_519 nanoseconds.
Weight::from_parts(4_519_000, 1448)
// Standard Error: 9
.saturating_add(Weight::from_ref_time(560).saturating_mul(l.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(4).saturating_mul(l.into()))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// The range of component `l` is `[0, 4194304]`.
fn mel_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `8389606`
// Minimum execution time: 4_462 nanoseconds.
Weight::from_parts(4_462_000, 8389606)
// Standard Error: 7
.saturating_add(Weight::from_ref_time(538).saturating_mul(l.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// The range of component `l` is `[0, 4194304]`.
fn mel_mixed_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `4195527 + l * (2 ±0)`
// Minimum execution time: 4_552 nanoseconds.
Weight::from_parts(4_552_000, 4195527)
// Standard Error: 6
.saturating_add(Weight::from_ref_time(507).saturating_mul(l.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(2).saturating_mul(l.into()))
}
/// Storage: Pov LargeValue (r:1 w:0)
/// Proof: Pov LargeValue (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: Measured)
/// Storage: Pov LargeValue2 (r:1 w:0)
/// Proof: Pov LargeValue2 (max_values: Some(1), max_size: Some(4194308), added: 4194803, mode: MaxEncodedLen)
/// The range of component `l` is `[0, 4194304]`.
fn measured_mixed_storage_double_value_read_linear_size(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `235 + l * (2 ±0)`
// Estimated: `4195527 + l * (2 ±0)`
// Minimum execution time: 4_236 nanoseconds.
Weight::from_parts(4_236_000, 4195527)
// Standard Error: 8
.saturating_add(Weight::from_ref_time(517).saturating_mul(l.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(2).saturating_mul(l.into()))
}
/// Storage: Pov UnboundedMap (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap (max_values: None, max_size: None, mode: Measured)
/// Storage: Pov UnboundedMap2 (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap2 (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[0, 1000]`.
fn storage_map_unbounded_both_measured_read(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `293 + i * (8 ±0)`
// Estimated: `5524 + i * (16 ±0)`
// Minimum execution time: 5_649 nanoseconds.
Weight::from_parts(6_111_237, 5524)
// Standard Error: 1_060
.saturating_add(Weight::from_ref_time(2_693).saturating_mul(i.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(16).saturating_mul(i.into()))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// Storage: Pov UnboundedMap (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[0, 1000]`.
fn storage_map_partial_unbounded_read(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `260 + i * (4 ±0)`
// Estimated: `5243 + i * (4 ±0)`
// Minimum execution time: 5_997 nanoseconds.
Weight::from_parts(7_996_508, 5243)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(4).saturating_mul(i.into()))
}
/// Storage: Pov Map1M (r:1 w:0)
/// Proof: Pov Map1M (max_values: Some(1000000), max_size: Some(36), added: 2511, mode: MaxEncodedLen)
/// Storage: Pov UnboundedMap (r:1 w:0)
/// Proof Skipped: Pov UnboundedMap (max_values: None, max_size: None, mode: Ignored)
/// The range of component `i` is `[0, 1000]`.
fn storage_map_partial_unbounded_ignored_read(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `260 + i * (4 ±0)`
// Estimated: `2768 + i * (4 ±0)`
// Minimum execution time: 5_679 nanoseconds.
Weight::from_parts(6_496_804, 2768)
// Standard Error: 611
.saturating_add(Weight::from_ref_time(930).saturating_mul(i.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(Weight::from_proof_size(4).saturating_mul(i.into()))
}
fn emit_event() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_087 nanoseconds.
Weight::from_ref_time(7_087_000)
}
fn noop() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_719 nanoseconds.
Weight::from_ref_time(2_719_000)
}
}