git.delta.rocks / unique-network / refs/commits / b1908057c94d

difftreelog

fix(app-promo) benchmarks

PraetorP2023-02-15parent: #eb685d6.patch.diff
in: master

2 files changed

modifiedpallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth
65 let staker = account::<T::AccountId>("staker", index, SEED);65 let staker = account::<T::AccountId>("staker", index, SEED);
66 <T as Config>::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());66 <T as Config>::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
67 PromototionPallet::<T>::stake(RawOrigin::Signed(staker.clone()).into(), Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get())?;67 PromototionPallet::<T>::stake(RawOrigin::Signed(staker.clone()).into(), Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get())?;
68 PromototionPallet::<T>::unstake_all(RawOrigin::Signed(staker.clone()).into()).map_err(|e| e.error)?;68 PromototionPallet::<T>::unstake_all(RawOrigin::Signed(staker.clone()).into())?;
69 Result::<(), sp_runtime::DispatchError>::Ok(())69 Result::<(), sp_runtime::DispatchError>::Ok(())
70 })?;70 })?;
71 let block_number = <frame_system::Pallet<T>>::current_block_number() + T::PendingInterval::get();71 let block_number = <frame_system::Pallet<T>>::current_block_number() + T::PendingInterval::get();
modifiedpallets/app-promotion/src/weights.rsdiffbeforeafterboth
3//! Autogenerated weights for pallet_app_promotion3//! Autogenerated weights for pallet_app_promotion
4//!4//!
5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
6//! DATE: 2023-02-14, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`6//! DATE: 2023-02-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 10247//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
88
9// Executed Command:9// Executed Command:
53 // Storage: Balances Locks (r:1 w:1)53 // Storage: Balances Locks (r:1 w:1)
54 // Storage: System Account (r:1 w:1)54 // Storage: System Account (r:1 w:1)
55 fn on_initialize(b: u32, ) -> Weight {55 fn on_initialize(b: u32, ) -> Weight {
56 Weight::from_ref_time(2_562_275 as u64)56 Weight::from_ref_time(2_592_346 as u64)
57 // Standard Error: 21_95057 // Standard Error: 23_629
58 .saturating_add(Weight::from_ref_time(7_177_129 as u64).saturating_mul(b as u64))58 .saturating_add(Weight::from_ref_time(7_523_802 as u64).saturating_mul(b as u64))
59 .saturating_add(T::DbWeight::get().reads(1 as u64))59 .saturating_add(T::DbWeight::get().reads(1 as u64))
60 .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(b as u64)))60 .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(b as u64)))
61 .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(b as u64)))61 .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(b as u64)))
62 }62 }
63 // Storage: AppPromotion Admin (r:0 w:1)63 // Storage: AppPromotion Admin (r:0 w:1)
64 fn set_admin_address() -> Weight {64 fn set_admin_address() -> Weight {
65 Weight::from_ref_time(6_146_000 as u64)65 Weight::from_ref_time(6_209_000 as u64)
66 .saturating_add(T::DbWeight::get().writes(1 as u64))66 .saturating_add(T::DbWeight::get().writes(1 as u64))
67 }67 }
68 // Storage: AppPromotion Admin (r:1 w:0)68 // Storage: AppPromotion Admin (r:1 w:0)
74 // Storage: Balances Locks (r:1 w:1)74 // Storage: Balances Locks (r:1 w:1)
75 // Storage: AppPromotion TotalStaked (r:1 w:1)75 // Storage: AppPromotion TotalStaked (r:1 w:1)
76 fn payout_stakers(b: u32, ) -> Weight {76 fn payout_stakers(b: u32, ) -> Weight {
77 Weight::from_ref_time(64_035_000 as u64)77 Weight::from_ref_time(64_917_000 as u64)
78 // Standard Error: 19_43478 // Standard Error: 34_206
79 .saturating_add(Weight::from_ref_time(47_251_111 as u64).saturating_mul(b as u64))79 .saturating_add(Weight::from_ref_time(51_518_500 as u64).saturating_mul(b as u64))
80 .saturating_add(T::DbWeight::get().reads(7 as u64))80 .saturating_add(T::DbWeight::get().reads(7 as u64))
81 .saturating_add(T::DbWeight::get().reads((12 as u64).saturating_mul(b as u64)))81 .saturating_add(T::DbWeight::get().reads((12 as u64).saturating_mul(b as u64)))
82 .saturating_add(T::DbWeight::get().writes(3 as u64))82 .saturating_add(T::DbWeight::get().writes(3 as u64))
90 // Storage: AppPromotion Staked (r:1 w:1)90 // Storage: AppPromotion Staked (r:1 w:1)
91 // Storage: AppPromotion TotalStaked (r:1 w:1)91 // Storage: AppPromotion TotalStaked (r:1 w:1)
92 fn stake() -> Weight {92 fn stake() -> Weight {
93 Weight::from_ref_time(18_078_000 as u64)93 Weight::from_ref_time(18_208_000 as u64)
94 .saturating_add(T::DbWeight::get().reads(7 as u64))94 .saturating_add(T::DbWeight::get().reads(7 as u64))
95 .saturating_add(T::DbWeight::get().writes(5 as u64))95 .saturating_add(T::DbWeight::get().writes(5 as u64))
96 }96 }
100 // Storage: AppPromotion TotalStaked (r:1 w:1)100 // Storage: AppPromotion TotalStaked (r:1 w:1)
101 // Storage: AppPromotion StakesPerAccount (r:0 w:1)101 // Storage: AppPromotion StakesPerAccount (r:0 w:1)
102 fn unstake_all() -> Weight {102 fn unstake_all() -> Weight {
103 Weight::from_ref_time(45_038_000 as u64)103 Weight::from_ref_time(45_018_000 as u64)
104 .saturating_add(T::DbWeight::get().reads(14 as u64))104 .saturating_add(T::DbWeight::get().reads(14 as u64))
105 .saturating_add(T::DbWeight::get().writes(13 as u64))105 .saturating_add(T::DbWeight::get().writes(13 as u64))
106 }106 }
110 // Storage: AppPromotion TotalStaked (r:1 w:1)110 // Storage: AppPromotion TotalStaked (r:1 w:1)
111 // Storage: AppPromotion StakesPerAccount (r:1 w:1)111 // Storage: AppPromotion StakesPerAccount (r:1 w:1)
112 fn unstake_partial() -> Weight {112 fn unstake_partial() -> Weight {
113 Weight::from_ref_time(48_863_000 as u64)113 Weight::from_ref_time(49_066_000 as u64)
114 .saturating_add(T::DbWeight::get().reads(15 as u64))114 .saturating_add(T::DbWeight::get().reads(15 as u64))
115 .saturating_add(T::DbWeight::get().writes(13 as u64))115 .saturating_add(T::DbWeight::get().writes(13 as u64))
116 }116 }
117 // Storage: AppPromotion Admin (r:1 w:0)117 // Storage: AppPromotion Admin (r:1 w:0)
118 // Storage: Common CollectionById (r:1 w:1)118 // Storage: Common CollectionById (r:1 w:1)
119 fn sponsor_collection() -> Weight {119 fn sponsor_collection() -> Weight {
120 Weight::from_ref_time(14_808_000 as u64)120 Weight::from_ref_time(15_039_000 as u64)
121 .saturating_add(T::DbWeight::get().reads(2 as u64))121 .saturating_add(T::DbWeight::get().reads(2 as u64))
122 .saturating_add(T::DbWeight::get().writes(1 as u64))122 .saturating_add(T::DbWeight::get().writes(1 as u64))
123 }123 }
124 // Storage: AppPromotion Admin (r:1 w:0)124 // Storage: AppPromotion Admin (r:1 w:0)
125 // Storage: Common CollectionById (r:1 w:1)125 // Storage: Common CollectionById (r:1 w:1)
126 fn stop_sponsoring_collection() -> Weight {126 fn stop_sponsoring_collection() -> Weight {
127 Weight::from_ref_time(14_587_000 as u64)127 Weight::from_ref_time(14_692_000 as u64)
128 .saturating_add(T::DbWeight::get().reads(2 as u64))128 .saturating_add(T::DbWeight::get().reads(2 as u64))
129 .saturating_add(T::DbWeight::get().writes(1 as u64))129 .saturating_add(T::DbWeight::get().writes(1 as u64))
130 }130 }
131 // Storage: AppPromotion Admin (r:1 w:0)131 // Storage: AppPromotion Admin (r:1 w:0)
132 // Storage: EvmContractHelpers Sponsoring (r:0 w:1)132 // Storage: EvmContractHelpers Sponsoring (r:0 w:1)
133 fn sponsor_contract() -> Weight {133 fn sponsor_contract() -> Weight {
134 Weight::from_ref_time(11_791_000 as u64)134 Weight::from_ref_time(11_810_000 as u64)
135 .saturating_add(T::DbWeight::get().reads(1 as u64))135 .saturating_add(T::DbWeight::get().reads(1 as u64))
136 .saturating_add(T::DbWeight::get().writes(1 as u64))136 .saturating_add(T::DbWeight::get().writes(1 as u64))
137 }137 }
138 // Storage: AppPromotion Admin (r:1 w:0)138 // Storage: AppPromotion Admin (r:1 w:0)
139 // Storage: EvmContractHelpers Sponsoring (r:1 w:1)139 // Storage: EvmContractHelpers Sponsoring (r:1 w:1)
140 fn stop_sponsoring_contract() -> Weight {140 fn stop_sponsoring_contract() -> Weight {
141 Weight::from_ref_time(13_576_000 as u64)141 Weight::from_ref_time(13_570_000 as u64)
142 .saturating_add(T::DbWeight::get().reads(2 as u64))142 .saturating_add(T::DbWeight::get().reads(2 as u64))
143 .saturating_add(T::DbWeight::get().writes(1 as u64))143 .saturating_add(T::DbWeight::get().writes(1 as u64))
144 }144 }
150 // Storage: Balances Locks (r:1 w:1)150 // Storage: Balances Locks (r:1 w:1)
151 // Storage: System Account (r:1 w:1)151 // Storage: System Account (r:1 w:1)
152 fn on_initialize(b: u32, ) -> Weight {152 fn on_initialize(b: u32, ) -> Weight {
153 Weight::from_ref_time(2_562_275 as u64)153 Weight::from_ref_time(2_592_346 as u64)
154 // Standard Error: 21_950154 // Standard Error: 23_629
155 .saturating_add(Weight::from_ref_time(7_177_129 as u64).saturating_mul(b as u64))155 .saturating_add(Weight::from_ref_time(7_523_802 as u64).saturating_mul(b as u64))
156 .saturating_add(RocksDbWeight::get().reads(1 as u64))156 .saturating_add(RocksDbWeight::get().reads(1 as u64))
157 .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(b as u64)))157 .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(b as u64)))
158 .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(b as u64)))158 .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(b as u64)))
159 }159 }
160 // Storage: AppPromotion Admin (r:0 w:1)160 // Storage: AppPromotion Admin (r:0 w:1)
161 fn set_admin_address() -> Weight {161 fn set_admin_address() -> Weight {
162 Weight::from_ref_time(6_146_000 as u64)162 Weight::from_ref_time(6_209_000 as u64)
163 .saturating_add(RocksDbWeight::get().writes(1 as u64))163 .saturating_add(RocksDbWeight::get().writes(1 as u64))
164 }164 }
165 // Storage: AppPromotion Admin (r:1 w:0)165 // Storage: AppPromotion Admin (r:1 w:0)
171 // Storage: Balances Locks (r:1 w:1)171 // Storage: Balances Locks (r:1 w:1)
172 // Storage: AppPromotion TotalStaked (r:1 w:1)172 // Storage: AppPromotion TotalStaked (r:1 w:1)
173 fn payout_stakers(b: u32, ) -> Weight {173 fn payout_stakers(b: u32, ) -> Weight {
174 Weight::from_ref_time(64_035_000 as u64)174 Weight::from_ref_time(64_917_000 as u64)
175 // Standard Error: 19_434175 // Standard Error: 34_206
176 .saturating_add(Weight::from_ref_time(47_251_111 as u64).saturating_mul(b as u64))176 .saturating_add(Weight::from_ref_time(51_518_500 as u64).saturating_mul(b as u64))
177 .saturating_add(RocksDbWeight::get().reads(7 as u64))177 .saturating_add(RocksDbWeight::get().reads(7 as u64))
178 .saturating_add(RocksDbWeight::get().reads((12 as u64).saturating_mul(b as u64)))178 .saturating_add(RocksDbWeight::get().reads((12 as u64).saturating_mul(b as u64)))
179 .saturating_add(RocksDbWeight::get().writes(3 as u64))179 .saturating_add(RocksDbWeight::get().writes(3 as u64))
187 // Storage: AppPromotion Staked (r:1 w:1)187 // Storage: AppPromotion Staked (r:1 w:1)
188 // Storage: AppPromotion TotalStaked (r:1 w:1)188 // Storage: AppPromotion TotalStaked (r:1 w:1)
189 fn stake() -> Weight {189 fn stake() -> Weight {
190 Weight::from_ref_time(18_078_000 as u64)190 Weight::from_ref_time(18_208_000 as u64)
191 .saturating_add(RocksDbWeight::get().reads(7 as u64))191 .saturating_add(RocksDbWeight::get().reads(7 as u64))
192 .saturating_add(RocksDbWeight::get().writes(5 as u64))192 .saturating_add(RocksDbWeight::get().writes(5 as u64))
193 }193 }
197 // Storage: AppPromotion TotalStaked (r:1 w:1)197 // Storage: AppPromotion TotalStaked (r:1 w:1)
198 // Storage: AppPromotion StakesPerAccount (r:0 w:1)198 // Storage: AppPromotion StakesPerAccount (r:0 w:1)
199 fn unstake_all() -> Weight {199 fn unstake_all() -> Weight {
200 Weight::from_ref_time(45_038_000 as u64)200 Weight::from_ref_time(45_018_000 as u64)
201 .saturating_add(RocksDbWeight::get().reads(14 as u64))201 .saturating_add(RocksDbWeight::get().reads(14 as u64))
202 .saturating_add(RocksDbWeight::get().writes(13 as u64))202 .saturating_add(RocksDbWeight::get().writes(13 as u64))
203 }203 }
207 // Storage: AppPromotion TotalStaked (r:1 w:1)207 // Storage: AppPromotion TotalStaked (r:1 w:1)
208 // Storage: AppPromotion StakesPerAccount (r:1 w:1)208 // Storage: AppPromotion StakesPerAccount (r:1 w:1)
209 fn unstake_partial() -> Weight {209 fn unstake_partial() -> Weight {
210 Weight::from_ref_time(48_863_000 as u64)210 Weight::from_ref_time(49_066_000 as u64)
211 .saturating_add(RocksDbWeight::get().reads(15 as u64))211 .saturating_add(RocksDbWeight::get().reads(15 as u64))
212 .saturating_add(RocksDbWeight::get().writes(13 as u64))212 .saturating_add(RocksDbWeight::get().writes(13 as u64))
213 }213 }
214 // Storage: AppPromotion Admin (r:1 w:0)214 // Storage: AppPromotion Admin (r:1 w:0)
215 // Storage: Common CollectionById (r:1 w:1)215 // Storage: Common CollectionById (r:1 w:1)
216 fn sponsor_collection() -> Weight {216 fn sponsor_collection() -> Weight {
217 Weight::from_ref_time(14_808_000 as u64)217 Weight::from_ref_time(15_039_000 as u64)
218 .saturating_add(RocksDbWeight::get().reads(2 as u64))218 .saturating_add(RocksDbWeight::get().reads(2 as u64))
219 .saturating_add(RocksDbWeight::get().writes(1 as u64))219 .saturating_add(RocksDbWeight::get().writes(1 as u64))
220 }220 }
221 // Storage: AppPromotion Admin (r:1 w:0)221 // Storage: AppPromotion Admin (r:1 w:0)
222 // Storage: Common CollectionById (r:1 w:1)222 // Storage: Common CollectionById (r:1 w:1)
223 fn stop_sponsoring_collection() -> Weight {223 fn stop_sponsoring_collection() -> Weight {
224 Weight::from_ref_time(14_587_000 as u64)224 Weight::from_ref_time(14_692_000 as u64)
225 .saturating_add(RocksDbWeight::get().reads(2 as u64))225 .saturating_add(RocksDbWeight::get().reads(2 as u64))
226 .saturating_add(RocksDbWeight::get().writes(1 as u64))226 .saturating_add(RocksDbWeight::get().writes(1 as u64))
227 }227 }
228 // Storage: AppPromotion Admin (r:1 w:0)228 // Storage: AppPromotion Admin (r:1 w:0)
229 // Storage: EvmContractHelpers Sponsoring (r:0 w:1)229 // Storage: EvmContractHelpers Sponsoring (r:0 w:1)
230 fn sponsor_contract() -> Weight {230 fn sponsor_contract() -> Weight {
231 Weight::from_ref_time(11_791_000 as u64)231 Weight::from_ref_time(11_810_000 as u64)
232 .saturating_add(RocksDbWeight::get().reads(1 as u64))232 .saturating_add(RocksDbWeight::get().reads(1 as u64))
233 .saturating_add(RocksDbWeight::get().writes(1 as u64))233 .saturating_add(RocksDbWeight::get().writes(1 as u64))
234 }234 }
235 // Storage: AppPromotion Admin (r:1 w:0)235 // Storage: AppPromotion Admin (r:1 w:0)
236 // Storage: EvmContractHelpers Sponsoring (r:1 w:1)236 // Storage: EvmContractHelpers Sponsoring (r:1 w:1)
237 fn stop_sponsoring_contract() -> Weight {237 fn stop_sponsoring_contract() -> Weight {
238 Weight::from_ref_time(13_576_000 as u64)238 Weight::from_ref_time(13_570_000 as u64)
239 .saturating_add(RocksDbWeight::get().reads(2 as u64))239 .saturating_add(RocksDbWeight::get().reads(2 as u64))
240 .saturating_add(RocksDbWeight::get().writes(1 as u64))240 .saturating_add(RocksDbWeight::get().writes(1 as u64))
241 }241 }