Skip to content
Snippets Groups Projects
Unverified Commit b6f94294 authored by bgallois's avatar bgallois
Browse files

fix pallet_identity weight::zero

parent 4a49e3c2
No related branches found
No related tags found
No related merge requests found
Pipeline #34356 failed
...@@ -21,6 +21,8 @@ use super::*; ...@@ -21,6 +21,8 @@ use super::*;
//use codec::Encode; //use codec::Encode;
use codec::Encode; use codec::Encode;
use frame_benchmarking::{account, benchmarks}; use frame_benchmarking::{account, benchmarks};
use frame_support::traits::OnInitialize;
use frame_system::pallet_prelude::BlockNumberFor;
use frame_system::RawOrigin; use frame_system::RawOrigin;
use sp_core::Get; use sp_core::Get;
use sp_io::crypto::{sr25519_generate, sr25519_sign}; use sp_io::crypto::{sr25519_generate, sr25519_sign};
...@@ -275,6 +277,28 @@ benchmarks! { ...@@ -275,6 +277,28 @@ benchmarks! {
).encode(); ).encode();
let signature = sr25519_sign(0.into(), &bob_public, &payload).unwrap().into(); let signature = sr25519_sign(0.into(), &bob_public, &payload).unwrap().into();
}: _<T::RuntimeOrigin>(alice_origin.into(), bob, signature) }: _<T::RuntimeOrigin>(alice_origin.into(), bob, signature)
// Base weight of an empty initialize
on_initialize {
}: {Pallet::<T>::on_initialize(BlockNumberFor::<T>::zero());}
do_remove_identity_noop {
let idty_index: T::IdtyIndex = 0u32.into();
assert!(Identities::<T>::get(idty_index).is_none());
}: {Pallet::<T>::do_remove_identity(idty_index, IdtyRemovalReason::Revoked);}
prune_identities_noop {
assert!(IdentitiesRemovableOn::<T>::try_get(T::BlockNumber::zero()).is_err());
}: {Pallet::<T>::prune_identities(T::BlockNumber::zero());}
prune_identities_none {
let idty_index: T::IdtyIndex = 100u32.into();
IdentitiesRemovableOn::<T>::append(T::BlockNumber::zero(), (idty_index, IdtyStatus::Created));
assert!(IdentitiesRemovableOn::<T>::try_get(T::BlockNumber::zero()).is_ok());
assert!(<Identities<T>>::try_get(idty_index).is_err());
}: {Pallet::<T>::prune_identities(T::BlockNumber::zero());}
prune_identities_err {
let idty_index: T::IdtyIndex = 100u32.into();
create_dummy_identity::<T>(100u32)?;
IdentitiesRemovableOn::<T>::append(T::BlockNumber::zero(), (idty_index, IdtyStatus::Created));
assert!(<Identities<T>>::get(idty_index).unwrap().status != IdentitiesRemovableOn::<T>::get(T::BlockNumber::zero())[0].1);
}: {Pallet::<T>::prune_identities(T::BlockNumber::zero());}
impl_benchmark_test_suite!( impl_benchmark_test_suite!(
Pallet, Pallet,
......
...@@ -225,9 +225,9 @@ pub mod pallet { ...@@ -225,9 +225,9 @@ pub mod pallet {
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> { impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(n: T::BlockNumber) -> Weight { fn on_initialize(n: T::BlockNumber) -> Weight {
if n > T::BlockNumber::zero() { if n > T::BlockNumber::zero() {
Self::prune_identities(n) Self::prune_identities(n).saturating_add(T::WeightInfo::on_initialize())
} else { } else {
Weight::zero() T::WeightInfo::on_initialize()
} }
} }
} }
...@@ -739,7 +739,7 @@ pub mod pallet { ...@@ -739,7 +739,7 @@ pub mod pallet {
}, },
); );
} }
Weight::zero() T::WeightInfo::do_remove_identity_noop()
} }
/// incremental counter for identity index /// incremental counter for identity index
fn get_next_idty_index() -> T::IdtyIndex { fn get_next_idty_index() -> T::IdtyIndex {
...@@ -752,7 +752,7 @@ pub mod pallet { ...@@ -752,7 +752,7 @@ pub mod pallet {
} }
} }
/// remove identities planned for removal at the given block if their status did not change /// remove identities planned for removal at the given block if their status did not change
fn prune_identities(block_number: T::BlockNumber) -> Weight { pub fn prune_identities(block_number: T::BlockNumber) -> Weight {
let mut total_weight = Weight::zero(); let mut total_weight = Weight::zero();
for (idty_index, idty_status) in IdentitiesRemovableOn::<T>::take(block_number) { for (idty_index, idty_status) in IdentitiesRemovableOn::<T>::take(block_number) {
...@@ -760,11 +760,17 @@ pub mod pallet { ...@@ -760,11 +760,17 @@ pub mod pallet {
if idty_val.removable_on == block_number && idty_val.status == idty_status { if idty_val.removable_on == block_number && idty_val.status == idty_status {
total_weight += total_weight +=
Self::do_remove_identity(idty_index, IdtyRemovalReason::Expired) Self::do_remove_identity(idty_index, IdtyRemovalReason::Expired)
} else {
total_weight += T::WeightInfo::prune_identities_err()
.saturating_sub(T::WeightInfo::prune_identities_none())
} }
} else {
total_weight += T::WeightInfo::prune_identities_none()
.saturating_sub(T::WeightInfo::prune_identities_noop())
} }
} }
total_weight total_weight.saturating_add(T::WeightInfo::prune_identities_noop())
} }
/// link account /// link account
......
...@@ -29,6 +29,11 @@ pub trait WeightInfo { ...@@ -29,6 +29,11 @@ pub trait WeightInfo {
fn prune_item_identities_names(i: u32) -> Weight; fn prune_item_identities_names(i: u32) -> Weight;
fn fix_sufficients() -> Weight; fn fix_sufficients() -> Weight;
fn link_account() -> Weight; fn link_account() -> Weight;
fn on_initialize() -> Weight;
fn do_remove_identity_noop() -> Weight;
fn prune_identities_noop() -> Weight;
fn prune_identities_none() -> Weight;
fn prune_identities_err() -> Weight;
} }
// Insecure weights implementation, use it for tests only! // Insecure weights implementation, use it for tests only!
...@@ -152,4 +157,54 @@ impl WeightInfo for () { ...@@ -152,4 +157,54 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().reads(3)) .saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(1)) .saturating_add(RocksDbWeight::get().writes(1))
} }
fn on_initialize() -> Weight {
// Proof Size summary in bytes:
// Measured: `359`
// Estimated: `3824`
// Minimum execution time: 543_046_000 picoseconds.
Weight::from_parts(544_513_000, 0)
.saturating_add(Weight::from_parts(0, 3824))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(1))
}
fn do_remove_identity_noop() -> Weight {
// Proof Size summary in bytes:
// Measured: `359`
// Estimated: `3824`
// Minimum execution time: 543_046_000 picoseconds.
Weight::from_parts(544_513_000, 0)
.saturating_add(Weight::from_parts(0, 3824))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(1))
}
fn prune_identities_noop() -> Weight {
// Proof Size summary in bytes:
// Measured: `359`
// Estimated: `3824`
// Minimum execution time: 543_046_000 picoseconds.
Weight::from_parts(544_513_000, 0)
.saturating_add(Weight::from_parts(0, 3824))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(1))
}
fn prune_identities_none() -> Weight {
// Proof Size summary in bytes:
// Measured: `359`
// Estimated: `3824`
// Minimum execution time: 543_046_000 picoseconds.
Weight::from_parts(544_513_000, 0)
.saturating_add(Weight::from_parts(0, 3824))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(1))
}
fn prune_identities_err() -> Weight {
// Proof Size summary in bytes:
// Measured: `359`
// Estimated: `3824`
// Minimum execution time: 543_046_000 picoseconds.
Weight::from_parts(544_513_000, 0)
.saturating_add(Weight::from_parts(0, 3824))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(1))
}
} }
// Copyright 2021-2022 Axiom-Team
//
// This file is part of Duniter-v2S.
//
// Duniter-v2S is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Duniter-v2S is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_identity` //! Autogenerated weights for `pallet_identity`
//! //!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-08, STEPS: `5`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! DATE: 2023-11-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000` //! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `benjamin-xps139380`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz` //! HOSTNAME: `bgallois-ms7d43`, CPU: `12th Gen Intel(R) Core(TM) i3-12100F`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gdev-benchmark"), DB CACHE: 1024 //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command: // Executed Command:
// target/release/duniter // ./target/release/duniter
// benchmark // benchmark
// pallet // pallet
// --chain=gdev-benchmark // --chain
// --steps=5 // dev
// --repeat=2
// --pallet=*
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled // --wasm-execution=compiled
// --heap-pages=4096 // --pallet
// --header=./file_header.txt // pallet-identity
// --output=./runtime/common/src/weights/ // --extrinsic
// *
// --steps
// 50
// --repeat
// 20
// --output=runtime/common/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)] #![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)] #![allow(unused_parens)]
...@@ -57,7 +44,7 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -57,7 +44,7 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Storage: Parameters ParametersStorage (r:1 w:0) /// Storage: Parameters ParametersStorage (r:1 w:0)
/// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: System Account (r:1 w:1) /// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(161), added: 2636, mode: MaxEncodedLen) /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen)
/// Storage: Identity NextIdtyIndex (r:1 w:1) /// Storage: Identity NextIdtyIndex (r:1 w:1)
/// Proof Skipped: Identity NextIdtyIndex (max_values: Some(1), max_size: None, mode: Measured) /// Proof Skipped: Identity NextIdtyIndex (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Identity CounterForIdentities (r:1 w:1) /// Storage: Identity CounterForIdentities (r:1 w:1)
...@@ -68,15 +55,17 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -68,15 +55,17 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Proof Skipped: Cert StorageCertsRemovableOn (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Cert StorageCertsRemovableOn (max_values: None, max_size: None, mode: Measured)
/// Storage: Cert CertsByReceiver (r:1 w:1) /// Storage: Cert CertsByReceiver (r:1 w:1)
/// Proof Skipped: Cert CertsByReceiver (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Cert CertsByReceiver (max_values: None, max_size: None, mode: Measured)
/// Storage: Quota IdtyQuota (r:0 w:1)
/// Proof: Quota IdtyQuota (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen)
fn create_identity() -> Weight { fn create_identity() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `910` // Measured: `982`
// Estimated: `6850` // Estimated: `6922`
// Minimum execution time: 229_558_000 picoseconds. // Minimum execution time: 37_343_000 picoseconds.
Weight::from_parts(261_641_000, 0) Weight::from_parts(38_374_000, 0)
.saturating_add(Weight::from_parts(0, 6850)) .saturating_add(Weight::from_parts(0, 6922))
.saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().reads(13))
.saturating_add(T::DbWeight::get().writes(11)) .saturating_add(T::DbWeight::get().writes(12))
} }
/// Storage: Identity IdentityIndexOf (r:1 w:0) /// Storage: Identity IdentityIndexOf (r:1 w:0)
/// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured)
...@@ -94,11 +83,11 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -94,11 +83,11 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Proof Skipped: Membership PendingMembershipsExpireOn (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Membership PendingMembershipsExpireOn (max_values: None, max_size: None, mode: Measured)
fn confirm_identity() -> Weight { fn confirm_identity() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `815` // Measured: `955`
// Estimated: `4280` // Estimated: `4420`
// Minimum execution time: 143_659_000 picoseconds. // Minimum execution time: 23_567_000 picoseconds.
Weight::from_parts(158_354_000, 0) Weight::from_parts(24_519_000, 0)
.saturating_add(Weight::from_parts(0, 4280)) .saturating_add(Weight::from_parts(0, 4420))
.saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes(4))
} }
...@@ -110,6 +99,8 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -110,6 +99,8 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Proof Skipped: Cert StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Cert StorageIdtyCertMeta (max_values: None, max_size: None, mode: Measured)
/// Storage: Parameters ParametersStorage (r:1 w:0) /// Storage: Parameters ParametersStorage (r:1 w:0)
/// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Distance IdentityDistanceStatus (r:1 w:0)
/// Proof Skipped: Distance IdentityDistanceStatus (max_values: None, max_size: None, mode: Measured)
/// Storage: Membership Membership (r:1 w:1) /// Storage: Membership Membership (r:1 w:1)
/// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Membership Membership (max_values: None, max_size: None, mode: Measured)
/// Storage: Membership CounterForMembership (r:1 w:1) /// Storage: Membership CounterForMembership (r:1 w:1)
...@@ -120,12 +111,12 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -120,12 +111,12 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Proof: UniversalDividend CurrentUdIndex (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) /// Proof: UniversalDividend CurrentUdIndex (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
fn validate_identity() -> Weight { fn validate_identity() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `955` // Measured: `1948`
// Estimated: `4420` // Estimated: `5413`
// Minimum execution time: 171_418_000 picoseconds. // Minimum execution time: 37_244_000 picoseconds.
Weight::from_parts(190_580_000, 0) Weight::from_parts(40_560_000, 0)
.saturating_add(Weight::from_parts(0, 4420)) .saturating_add(Weight::from_parts(0, 5413))
.saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes(5))
} }
/// Storage: Identity IdentityIndexOf (r:2 w:2) /// Storage: Identity IdentityIndexOf (r:2 w:2)
...@@ -137,16 +128,16 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -137,16 +128,16 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Storage: System BlockHash (r:1 w:0) /// Storage: System BlockHash (r:1 w:0)
/// Proof: System BlockHash (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Proof: System BlockHash (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen)
/// Storage: System Account (r:2 w:2) /// Storage: System Account (r:2 w:2)
/// Proof: System Account (max_values: None, max_size: Some(161), added: 2636, mode: MaxEncodedLen) /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen)
/// Storage: AuthorityMembers Members (r:1 w:0) /// Storage: AuthorityMembers Members (r:1 w:0)
/// Proof Skipped: AuthorityMembers Members (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: AuthorityMembers Members (max_values: None, max_size: None, mode: Measured)
fn change_owner_key() -> Weight { fn change_owner_key() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `1077` // Measured: `1115`
// Estimated: `7017` // Estimated: `7055`
// Minimum execution time: 406_461_000 picoseconds. // Minimum execution time: 78_496_000 picoseconds.
Weight::from_parts(636_569_000, 0) Weight::from_parts(85_171_000, 0)
.saturating_add(Weight::from_parts(0, 7017)) .saturating_add(Weight::from_parts(0, 7055))
.saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes(5))
} }
...@@ -161,7 +152,7 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -161,7 +152,7 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Storage: Identity CounterForIdentities (r:1 w:1) /// Storage: Identity CounterForIdentities (r:1 w:1)
/// Proof: Identity CounterForIdentities (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Proof: Identity CounterForIdentities (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: System Account (r:2 w:2) /// Storage: System Account (r:2 w:2)
/// Proof: System Account (max_values: None, max_size: Some(161), added: 2636, mode: MaxEncodedLen) /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen)
/// Storage: Cert CertsByReceiver (r:1 w:1) /// Storage: Cert CertsByReceiver (r:1 w:1)
/// Proof Skipped: Cert CertsByReceiver (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Cert CertsByReceiver (max_values: None, max_size: None, mode: Measured)
/// Storage: Cert StorageIdtyCertMeta (r:2 w:2) /// Storage: Cert StorageIdtyCertMeta (r:2 w:2)
...@@ -170,15 +161,17 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -170,15 +161,17 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured) /// Proof Skipped: Parameters ParametersStorage (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Identity IdentityIndexOf (r:0 w:1) /// Storage: Identity IdentityIndexOf (r:0 w:1)
/// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured)
/// Storage: Quota IdtyQuota (r:0 w:1)
/// Proof: Quota IdtyQuota (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen)
fn revoke_identity() -> Weight { fn revoke_identity() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `1547` // Measured: `1498`
// Estimated: `7487` // Estimated: `7438`
// Minimum execution time: 404_569_000 picoseconds. // Minimum execution time: 86_488_000 picoseconds.
Weight::from_parts(420_040_000, 0) Weight::from_parts(89_856_000, 0)
.saturating_add(Weight::from_parts(0, 7487)) .saturating_add(Weight::from_parts(0, 7438))
.saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(9)) .saturating_add(T::DbWeight::get().writes(10))
} }
/// Storage: Identity Identities (r:1 w:1) /// Storage: Identity Identities (r:1 w:1)
/// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured)
...@@ -189,7 +182,7 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -189,7 +182,7 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Storage: Identity CounterForIdentities (r:1 w:1) /// Storage: Identity CounterForIdentities (r:1 w:1)
/// Proof: Identity CounterForIdentities (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Proof: Identity CounterForIdentities (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1) /// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(161), added: 2636, mode: MaxEncodedLen) /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen)
/// Storage: Cert CertsByReceiver (r:1 w:1) /// Storage: Cert CertsByReceiver (r:1 w:1)
/// Proof Skipped: Cert CertsByReceiver (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Cert CertsByReceiver (max_values: None, max_size: None, mode: Measured)
/// Storage: Cert StorageIdtyCertMeta (r:2 w:2) /// Storage: Cert StorageIdtyCertMeta (r:2 w:2)
...@@ -200,39 +193,41 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -200,39 +193,41 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured)
/// Storage: Identity IdentitiesNames (r:0 w:1) /// Storage: Identity IdentitiesNames (r:0 w:1)
/// Proof Skipped: Identity IdentitiesNames (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Identity IdentitiesNames (max_values: None, max_size: None, mode: Measured)
/// Storage: Quota IdtyQuota (r:0 w:1)
/// Proof: Quota IdtyQuota (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen)
fn remove_identity() -> Weight { fn remove_identity() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `1352` // Measured: `1343`
// Estimated: `7292` // Estimated: `7283`
// Minimum execution time: 221_063_000 picoseconds. // Minimum execution time: 38_570_000 picoseconds.
Weight::from_parts(261_413_000, 0) Weight::from_parts(39_625_000, 0)
.saturating_add(Weight::from_parts(0, 7292)) .saturating_add(Weight::from_parts(0, 7283))
.saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(9)) .saturating_add(T::DbWeight::get().writes(10))
} }
/// Storage: Identity IdentitiesNames (r:0 w:999) /// Storage: Identity IdentitiesNames (r:0 w:998)
/// Proof Skipped: Identity IdentitiesNames (max_values: None, max_size: None, mode: Measured) /// Proof Skipped: Identity IdentitiesNames (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[1, 1000]`. /// The range of component `i` is `[1, 1000]`.
fn prune_item_identities_names(i: u32, ) -> Weight { fn prune_item_identities_names(i: u32, ) -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `0` // Measured: `0`
// Estimated: `0` // Estimated: `0`
// Minimum execution time: 11_247_000 picoseconds. // Minimum execution time: 874_000 picoseconds.
Weight::from_parts(11_247_000, 0) Weight::from_parts(946_000, 0)
.saturating_add(Weight::from_parts(0, 0)) .saturating_add(Weight::from_parts(0, 0))
// Standard Error: 20_366 // Standard Error: 865
.saturating_add(Weight::from_parts(3_802_802, 0).saturating_mul(i.into())) .saturating_add(Weight::from_parts(640_555, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
} }
/// Storage: System Account (r:1 w:1) /// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(161), added: 2636, mode: MaxEncodedLen) /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen)
fn fix_sufficients() -> Weight { fn fix_sufficients() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `103` // Measured: `67`
// Estimated: `3626` // Estimated: `3591`
// Minimum execution time: 30_488_000 picoseconds. // Minimum execution time: 3_954_000 picoseconds.
Weight::from_parts(32_424_000, 0) Weight::from_parts(4_176_000, 0)
.saturating_add(Weight::from_parts(0, 3626)) .saturating_add(Weight::from_parts(0, 3591))
.saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes(1))
} }
...@@ -244,12 +239,70 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> { ...@@ -244,12 +239,70 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
/// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen) /// Proof: System Account (max_values: None, max_size: Some(126), added: 2601, mode: MaxEncodedLen)
fn link_account() -> Weight { fn link_account() -> Weight {
// Proof Size summary in bytes: // Proof Size summary in bytes:
// Measured: `359` // Measured: `307`
// Estimated: `3824` // Estimated: `3772`
// Minimum execution time: 543_046_000 picoseconds. // Minimum execution time: 45_049_000 picoseconds.
Weight::from_parts(544_513_000, 0) Weight::from_parts(46_758_000, 0)
.saturating_add(Weight::from_parts(0, 3824)) .saturating_add(Weight::from_parts(0, 3772))
.saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes(1))
} }
fn on_initialize() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 28_000 picoseconds.
Weight::from_parts(29_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: Identity Identities (r:1 w:0)
/// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured)
fn do_remove_identity_noop() -> Weight {
// Proof Size summary in bytes:
// Measured: `269`
// Estimated: `3734`
// Minimum execution time: 3_447_000 picoseconds.
Weight::from_parts(3_570_000, 0)
.saturating_add(Weight::from_parts(0, 3734))
.saturating_add(T::DbWeight::get().reads(1))
}
/// Storage: Identity IdentitiesRemovableOn (r:1 w:0)
/// Proof Skipped: Identity IdentitiesRemovableOn (max_values: None, max_size: None, mode: Measured)
fn prune_identities_noop() -> Weight {
// Proof Size summary in bytes:
// Measured: `108`
// Estimated: `3573`
// Minimum execution time: 1_213_000 picoseconds.
Weight::from_parts(1_314_000, 0)
.saturating_add(Weight::from_parts(0, 3573))
.saturating_add(T::DbWeight::get().reads(1))
}
/// Storage: Identity IdentitiesRemovableOn (r:1 w:1)
/// Proof Skipped: Identity IdentitiesRemovableOn (max_values: None, max_size: None, mode: Measured)
/// Storage: Identity Identities (r:1 w:0)
/// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured)
fn prune_identities_none() -> Weight {
// Proof Size summary in bytes:
// Measured: `293`
// Estimated: `3758`
// Minimum execution time: 4_540_000 picoseconds.
Weight::from_parts(4_681_000, 0)
.saturating_add(Weight::from_parts(0, 3758))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Identity IdentitiesRemovableOn (r:1 w:1)
/// Proof Skipped: Identity IdentitiesRemovableOn (max_values: None, max_size: None, mode: Measured)
/// Storage: Identity Identities (r:1 w:0)
/// Proof Skipped: Identity Identities (max_values: None, max_size: None, mode: Measured)
fn prune_identities_err() -> Weight {
// Proof Size summary in bytes:
// Measured: `360`
// Estimated: `3825`
// Minimum execution time: 5_511_000 picoseconds.
Weight::from_parts(5_784_000, 0)
.saturating_add(Weight::from_parts(0, 3825))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment