Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e067a17
don't read slashing spans when taking election snapshot
kianenigma Oct 4, 2022
6ba277b
update cargo.toml
kianenigma Oct 4, 2022
df5cbe2
bring back remote test
kianenigma Oct 4, 2022
6a9ad83
undo doc changes
kianenigma Oct 6, 2022
88f8470
fix merge stuff
kianenigma Oct 6, 2022
cc184dc
fix npos-voters function sig
kianenigma Oct 6, 2022
f86e368
remove as much redundant diff as you can
kianenigma Oct 6, 2022
c67961d
Update frame/staking/src/pallet/mod.rs
kianenigma Nov 1, 2022
d23326f
update'
kianenigma Nov 8, 2022
87b488c
Merge branch 'kiz-slashing-spans-snapshot-fix' of github.com:parityte…
kianenigma Nov 8, 2022
d644f8f
fix
kianenigma Nov 8, 2022
1f64829
Update frame/staking/src/pallet/impls.rs
kianenigma Nov 8, 2022
67ef21d
update lock
kianenigma Nov 10, 2022
ceccee2
Merge branch 'kiz-slashing-spans-snapshot-fix' of github.com:parityte…
kianenigma Nov 10, 2022
32abede
Master.into()
kianenigma Nov 10, 2022
a89dce4
Merge branch 'master' into kiz-slashing-spans-snapshot-fix
Ank4n Dec 9, 2022
4871296
Master.into()
kianenigma Dec 10, 2022
d045394
Merge branch 'kiz-slashing-spans-snapshot-fix' of github.com:parityte…
kianenigma Dec 10, 2022
fd03b10
fix all tests
kianenigma Dec 10, 2022
1525744
review comments
kianenigma Dec 10, 2022
a254b23
fmt
kianenigma Dec 10, 2022
99396f3
fix offence bench
kianenigma Dec 10, 2022
df93a94
clippy
kianenigma Dec 12, 2022
9354b6b
Merge branch 'master' of https://github.com/paritytech/substrate into…
Dec 12, 2022
6b61c24
".git/.scripts/bench-bot.sh" pallet dev pallet_staking
Dec 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix npos-voters function sig
  • Loading branch information
kianenigma committed Oct 6, 2022
commit cc184dc1649ee343c50e4bd625036d0aab7cc477
1 change: 0 additions & 1 deletion frame/staking/src/pallet/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ impl<T: Config> Pallet<T> {
Self::register_weight(T::WeightInfo::get_npos_voters(
validators_taken,
nominators_taken,
0,
));

log!(
Expand Down
4 changes: 1 addition & 3 deletions frame/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4388,11 +4388,9 @@ mod election_data_provider {
// we assume a network only wants up to 1000 validators in most cases, thus having 2000
// candidates is as high as it gets.
let validators = 2000;
// we assume the worse case: each validator also has a slashing span.
let slashing_spans = validators;
let mut nominators = 1000;

while <Test as Config>::WeightInfo::get_npos_voters(validators, nominators, slashing_spans)
while <Test as Config>::WeightInfo::get_npos_voters(validators, nominators)
.all_lt(2u64 * frame_support::weights::constants::WEIGHT_PER_SECOND)
{
nominators += 1;
Expand Down
8 changes: 4 additions & 4 deletions frame/staking/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ pub trait WeightInfo {
fn rebond(l: u32, ) -> Weight;
fn reap_stash(s: u32, ) -> Weight;
fn new_era(v: u32, n: u32, ) -> Weight;
fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight;
fn get_npos_targets(v: u32, ) -> Weight;
fn get_npos_voters(v: u32, n: u32) -> Weight;
fn get_npos_targets(v: u32) -> Weight;
fn set_staking_configs_all_set() -> Weight;
fn set_staking_configs_all_remove() -> Weight;
fn chill_other() -> Weight;
Expand Down Expand Up @@ -397,7 +397,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// The range of component `v` is `[500, 1000]`.
/// The range of component `n` is `[500, 1000]`.
/// The range of component `s` is `[1, 20]`.
fn get_npos_voters(v: u32, n: u32, _s: u32, ) -> Weight {
fn get_npos_voters(v: u32, n: u32) -> Weight {
Weight::from_ref_time(24_930_788_000 as u64)
// Standard Error: 266_386
.saturating_add(Weight::from_ref_time(6_687_552 as u64).saturating_mul(v as u64))
Expand Down Expand Up @@ -779,7 +779,7 @@ impl WeightInfo for () {
/// The range of component `v` is `[500, 1000]`.
/// The range of component `n` is `[500, 1000]`.
/// The range of component `s` is `[1, 20]`.
fn get_npos_voters(v: u32, n: u32, _s: u32, ) -> Weight {
fn get_npos_voters(v: u32, n: u32) -> Weight {
Weight::from_ref_time(24_930_788_000 as u64)
// Standard Error: 266_386
.saturating_add(Weight::from_ref_time(6_687_552 as u64).saturating_mul(v as u64))
Expand Down