Companion for sub/8176 (#2622)

* Merge

* Fixes

* Fix build

* remove dep.

* undo dep.

* upadte substrate

* cargo run --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/

* Fix lock

* revert lock; cargo update -p sp-io

* from_rational_approx -> from_rational

* Silence more warnings

Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
Kian Paimani
2021-03-16 15:05:47 +01:00
committed by GitHub
parent b65ca6bab6
commit 6b0c56b8ab
19 changed files with 307 additions and 240 deletions
@@ -214,4 +214,23 @@ impl<T: frame_system::Config> pallet_staking::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 113_000
.saturating_add((26_614_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 113_000
.saturating_add((64_299_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 1_547_000
.saturating_add((20_092_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
}
fn get_npos_targets(v: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 29_000
.saturating_add((10_228_000 as Weight).saturating_mul(v as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(v as Weight)))
}
}