Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
update dapps staking weights (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
shunsukew authored Dec 20, 2022
1 parent 94a2185 commit ce772cc
Showing 1 changed file with 63 additions and 227 deletions.
290 changes: 63 additions & 227 deletions frame/dapps-staking/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
//! Autogenerated weights for `pallet_dapps_staking`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-12-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `shiden-collator-02-ovh`, CPU: `Intel(R) Xeon(R) E-2136 CPU @ 3.30GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("astar-dev"), DB CACHE: 1024
// Executed Command:
// ./astar-collator
// benchmark
// pallet
// --chain
// astar-dev
// --execution
// wasm
// --wasm-execution
// compiled
// --heap-pages
// 4096
// --pallet
// pallet_dapps_staking
// --extrinsic
// *
// --steps
// 50
// --repeat
// 20
// --output
// pallet_dapps_staking_weights.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
Expand All @@ -10,8 +40,6 @@ pub trait WeightInfo {
fn register() -> Weight;
fn unregister() -> Weight;
fn withdraw_from_unregistered() -> Weight;
fn enable_developer_pre_approval() -> Weight;
fn developer_pre_approval() -> Weight;
fn bond_and_stake() -> Weight;
fn unbond_and_unstake() -> Weight;
fn withdraw_unbonded() -> Weight;
Expand All @@ -27,301 +55,109 @@ pub trait WeightInfo {
/// Weights for pallet_staking using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDevelopers (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:1)
fn register() -> Weight {
Weight::from_ref_time(32_139_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
Weight::from_ref_time(34_762_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: System Account (r:1 w:1)
fn unregister() -> Weight {
Weight::from_ref_time(31_929_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
Weight::from_ref_time(37_244_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking StakersInfo (r:1 w:1)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn withdraw_from_unregistered() -> Weight {
Weight::from_ref_time(46_667_000 as u64)
.saturating_add(T::DbWeight::get().reads(8 as u64))
Weight::from_ref_time(53_956_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking PreApprovalIsEnabled (r:0 w:1)
fn enable_developer_pre_approval() -> Weight {
Weight::from_ref_time(2_745_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking PreApprovedDevelopers (r:1 w:1)
fn developer_pre_approval() -> Weight {
Weight::from_ref_time(5_320_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking StakersInfo (r:1 w:1)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn bond_and_stake() -> Weight {
Weight::from_ref_time(133_638_000 as u64)
.saturating_add(T::DbWeight::get().reads(8 as u64))
Weight::from_ref_time(140_275_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking StakersInfo (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn unbond_and_unstake() -> Weight {
Weight::from_ref_time(134_480_000 as u64)
.saturating_add(T::DbWeight::get().reads(8 as u64))
Weight::from_ref_time(141_641_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn withdraw_unbonded() -> Weight {
Weight::from_ref_time(114_252_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
Weight::from_ref_time(116_564_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:2 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn claim_staker_with_restake() -> Weight {
Weight::from_ref_time(78_506_000 as u64)
.saturating_add(T::DbWeight::get().reads(11 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:2 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:2 w:2)
// Storage: DappsStaking ContractEraStake (r:2 w:2)
fn nomination_transfer() -> Weight {
Weight::from_ref_time(56_495_000 as u64)
.saturating_add(T::DbWeight::get().reads(8 as u64))
Weight::from_ref_time(43_519_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:0)
// Storage: DappsStaking GeneralEraInfo (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:0)
fn claim_staker_without_restake() -> Weight {
Weight::from_ref_time(56_575_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:0)
fn claim_dapp() -> Weight {
Weight::from_ref_time(31_619_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking ForceEra (r:0 w:1)
fn force_new_era() -> Weight {
Weight::from_ref_time(2_815_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:1)
fn maintenance_mode() -> Weight {
Weight::from_ref_time(10_970_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
fn set_reward_destination() -> Weight {
Weight::from_ref_time(15_489_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDevelopers (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:1)
// Storage: DappsStaking PreApprovalIsEnabled (r:1 w:0)
fn register() -> Weight {
Weight::from_ref_time(32_139_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: System Account (r:1 w:1)
fn unregister() -> Weight {
Weight::from_ref_time(31_929_000 as u64)
.saturating_add(RocksDbWeight::get().reads(4 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking StakersInfo (r:1 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn withdraw_from_unregistered() -> Weight {
Weight::from_ref_time(46_667_000 as u64)
.saturating_add(RocksDbWeight::get().reads(8 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking PreApprovalIsEnabled (r:0 w:1)
fn enable_developer_pre_approval() -> Weight {
Weight::from_ref_time(2_745_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking PreApprovedDevelopers (r:1 w:1)
fn developer_pre_approval() -> Weight {
Weight::from_ref_time(5_320_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking StakersInfo (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn bond_and_stake() -> Weight {
Weight::from_ref_time(133_638_000 as u64)
.saturating_add(RocksDbWeight::get().reads(8 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking StakersInfo (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn unbond_and_unstake() -> Weight {
Weight::from_ref_time(134_480_000 as u64)
.saturating_add(RocksDbWeight::get().reads(8 as u64))
.saturating_add(RocksDbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn withdraw_unbonded() -> Weight {
Weight::from_ref_time(114_252_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(3 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:2 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:2 w:2)
// Storage: DappsStaking ContractEraStake (r:2 w:2)
fn nomination_transfer() -> Weight {
Weight::from_ref_time(56_495_000 as u64)
.saturating_add(RocksDbWeight::get().reads(8 as u64))
.saturating_add(RocksDbWeight::get().writes(4 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking ContractEraStake (r:2 w:1)
// Storage: DappsStaking GeneralEraInfo (r:2 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn claim_staker_with_restake() -> Weight {
Weight::from_ref_time(78_506_000 as u64)
.saturating_add(RocksDbWeight::get().reads(11 as u64))
.saturating_add(RocksDbWeight::get().writes(6 as u64))
Weight::from_ref_time(72_500_000 as u64)
.saturating_add(T::DbWeight::get().reads(9 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:0)
// Storage: DappsStaking GeneralEraInfo (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:0)
fn claim_staker_without_restake() -> Weight {
Weight::from_ref_time(56_575_000 as u64)
.saturating_add(RocksDbWeight::get().reads(7 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
Weight::from_ref_time(45_414_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:0)
fn claim_dapp() -> Weight {
Weight::from_ref_time(31_619_000 as u64)
.saturating_add(RocksDbWeight::get().reads(5 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
Weight::from_ref_time(35_939_000 as u64)
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking ForceEra (r:0 w:1)
fn force_new_era() -> Weight {
Weight::from_ref_time(2_815_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
Weight::from_ref_time(6_910_000 as u64)
}
// Storage: DappsStaking PalletDisabled (r:1 w:1)
fn maintenance_mode() -> Weight {
Weight::from_ref_time(10_970_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
Weight::from_ref_time(14_658_000 as u64)
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
fn set_reward_destination() -> Weight {
Weight::from_ref_time(15_489_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
Weight::from_ref_time(23_412_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}
}

0 comments on commit ce772cc

Please sign in to comment.