mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
[EPM pallet]: remove number of signed submissions (#10945)
* [EPM pallet]: remove `number of signed submissions` Closing #9229 * fix tests * remove needless assert * Update frame/election-provider-multi-phase/src/lib.rs * cargo fmt Signed-off-by: Niklas <niklasadolfsson1@gmail.com> * fix grumbles * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs * drop `num_signed_submissions` in WeightInfo too * fix build Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
@@ -310,7 +310,6 @@ frame_benchmarking::benchmarks! {
|
||||
}
|
||||
|
||||
submit {
|
||||
let c in 1 .. (T::SignedMaxSubmissions::get() - 1);
|
||||
|
||||
// the solution will be worse than all of them meaning the score need to be checked against
|
||||
// ~ log2(c)
|
||||
@@ -324,7 +323,10 @@ frame_benchmarking::benchmarks! {
|
||||
<Round<T>>::put(1);
|
||||
|
||||
let mut signed_submissions = SignedSubmissions::<T>::get();
|
||||
for i in 0..c {
|
||||
|
||||
// Insert `max - 1` submissions because the call to `submit` will insert another
|
||||
// submission and the score is worse then the previous scores.
|
||||
for i in 0..(T::SignedMaxSubmissions::get() - 1) {
|
||||
let raw_solution = RawSolution {
|
||||
score: ElectionScore { minimal_stake: 10_000_000u128 + (i as u128), ..Default::default() },
|
||||
..Default::default()
|
||||
@@ -342,9 +344,9 @@ frame_benchmarking::benchmarks! {
|
||||
let caller = frame_benchmarking::whitelisted_caller();
|
||||
T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance() * 10u32.into());
|
||||
|
||||
}: _(RawOrigin::Signed(caller), Box::new(solution), c)
|
||||
}: _(RawOrigin::Signed(caller), Box::new(solution))
|
||||
verify {
|
||||
assert!(<MultiPhase<T>>::signed_submissions().len() as u32 == c + 1);
|
||||
assert!(<MultiPhase<T>>::signed_submissions().len() as u32 == T::SignedMaxSubmissions::get());
|
||||
}
|
||||
|
||||
submit_unsigned {
|
||||
|
||||
@@ -963,25 +963,13 @@ pub mod pallet {
|
||||
///
|
||||
/// A deposit is reserved and recorded for the solution. Based on the outcome, the solution
|
||||
/// might be rewarded, slashed, or get all or a part of the deposit back.
|
||||
///
|
||||
/// # <weight>
|
||||
/// Queue size must be provided as witness data.
|
||||
/// # </weight>
|
||||
#[pallet::weight(T::WeightInfo::submit(*num_signed_submissions))]
|
||||
#[pallet::weight(T::WeightInfo::submit())]
|
||||
pub fn submit(
|
||||
origin: OriginFor<T>,
|
||||
raw_solution: Box<RawSolution<SolutionOf<T>>>,
|
||||
num_signed_submissions: u32,
|
||||
) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
|
||||
// ensure witness data is correct.
|
||||
ensure!(
|
||||
num_signed_submissions >=
|
||||
<SignedSubmissions<T>>::decode_len().unwrap_or_default() as u32,
|
||||
Error::<T>::SignedInvalidWitness,
|
||||
);
|
||||
|
||||
// ensure solution is timely.
|
||||
ensure!(Self::current_phase().is_signed(), Error::<T>::PreDispatchEarlySubmission);
|
||||
|
||||
@@ -1000,8 +988,7 @@ pub mod pallet {
|
||||
// create the submission
|
||||
let deposit = Self::deposit_for(&raw_solution, size);
|
||||
let reward = {
|
||||
let call =
|
||||
Call::submit { raw_solution: raw_solution.clone(), num_signed_submissions };
|
||||
let call = Call::submit { raw_solution: raw_solution.clone() };
|
||||
let call_fee = T::EstimateCallFee::estimate_call_fee(&call, None.into());
|
||||
T::SignedRewardBase::get().saturating_add(call_fee)
|
||||
};
|
||||
@@ -1970,11 +1957,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: (5 + s).into(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(MultiPhase::submit(
|
||||
crate::mock::Origin::signed(99),
|
||||
Box::new(solution),
|
||||
MultiPhase::signed_submissions().len() as u32
|
||||
));
|
||||
assert_ok!(MultiPhase::submit(crate::mock::Origin::signed(99), Box::new(solution)));
|
||||
}
|
||||
|
||||
// an unexpected call to elect.
|
||||
|
||||
@@ -343,11 +343,11 @@ impl multi_phase::weights::WeightInfo for DualMockWeightInfo {
|
||||
<() as multi_phase::weights::WeightInfo>::finalize_signed_phase_reject_solution()
|
||||
}
|
||||
}
|
||||
fn submit(c: u32) -> Weight {
|
||||
fn submit() -> Weight {
|
||||
if MockWeightInfo::get() {
|
||||
Zero::zero()
|
||||
} else {
|
||||
<() as multi_phase::weights::WeightInfo>::submit(c)
|
||||
<() as multi_phase::weights::WeightInfo>::submit()
|
||||
}
|
||||
}
|
||||
fn submit_unsigned(v: u32, t: u32, a: u32, d: u32) -> Weight {
|
||||
|
||||
@@ -500,18 +500,7 @@ mod tests {
|
||||
},
|
||||
Error, Phase,
|
||||
};
|
||||
use frame_support::{assert_noop, assert_ok, assert_storage_noop, dispatch::DispatchResult};
|
||||
|
||||
fn submit_with_witness(
|
||||
origin: Origin,
|
||||
solution: RawSolution<SolutionOf<Runtime>>,
|
||||
) -> DispatchResult {
|
||||
MultiPhase::submit(
|
||||
origin,
|
||||
Box::new(solution),
|
||||
MultiPhase::signed_submissions().len() as u32,
|
||||
)
|
||||
}
|
||||
use frame_support::{assert_noop, assert_ok, assert_storage_noop};
|
||||
|
||||
#[test]
|
||||
fn cannot_submit_too_early() {
|
||||
@@ -524,31 +513,12 @@ mod tests {
|
||||
let solution = raw_solution();
|
||||
|
||||
assert_noop!(
|
||||
submit_with_witness(Origin::signed(10), solution),
|
||||
MultiPhase::submit(Origin::signed(10), Box::new(solution)),
|
||||
Error::<Runtime>::PreDispatchEarlySubmission,
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wrong_witness_fails() {
|
||||
ExtBuilder::default().build_and_execute(|| {
|
||||
roll_to(15);
|
||||
assert!(MultiPhase::current_phase().is_signed());
|
||||
|
||||
let solution = raw_solution();
|
||||
// submit this once correctly
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution.clone()));
|
||||
assert_eq!(MultiPhase::signed_submissions().len(), 1);
|
||||
|
||||
// now try and cheat by passing a lower queue length
|
||||
assert_noop!(
|
||||
MultiPhase::submit(Origin::signed(99), Box::new(solution), 0),
|
||||
Error::<Runtime>::SignedInvalidWitness,
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_pay_deposit() {
|
||||
ExtBuilder::default().build_and_execute(|| {
|
||||
@@ -558,7 +528,7 @@ mod tests {
|
||||
let solution = raw_solution();
|
||||
assert_eq!(balances(&99), (100, 0));
|
||||
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
|
||||
assert_eq!(balances(&99), (95, 5));
|
||||
assert_eq!(MultiPhase::signed_submissions().iter().next().unwrap().deposit, 5);
|
||||
@@ -574,7 +544,7 @@ mod tests {
|
||||
let solution = raw_solution();
|
||||
assert_eq!(balances(&99), (100, 0));
|
||||
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
assert_eq!(balances(&99), (95, 5));
|
||||
|
||||
assert!(MultiPhase::finalize_signed_phase());
|
||||
@@ -594,7 +564,7 @@ mod tests {
|
||||
// make the solution invalid.
|
||||
solution.score.minimal_stake += 1;
|
||||
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
assert_eq!(balances(&99), (95, 5));
|
||||
|
||||
// no good solution was stored.
|
||||
@@ -615,11 +585,11 @@ mod tests {
|
||||
assert_eq!(balances(&999), (100, 0));
|
||||
|
||||
// submit as correct.
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution.clone()));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution.clone())));
|
||||
|
||||
// make the solution invalid and weaker.
|
||||
solution.score.minimal_stake -= 1;
|
||||
assert_ok!(submit_with_witness(Origin::signed(999), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(999), Box::new(solution)));
|
||||
assert_eq!(balances(&99), (95, 5));
|
||||
assert_eq!(balances(&999), (95, 5));
|
||||
|
||||
@@ -645,7 +615,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: (5 + s).into(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
}
|
||||
|
||||
// weaker.
|
||||
@@ -655,7 +625,7 @@ mod tests {
|
||||
};
|
||||
|
||||
assert_noop!(
|
||||
submit_with_witness(Origin::signed(99), solution),
|
||||
MultiPhase::submit(Origin::signed(99), Box::new(solution)),
|
||||
Error::<Runtime>::SignedQueueFull,
|
||||
);
|
||||
})
|
||||
@@ -673,7 +643,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: (5 + s).into(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
}
|
||||
|
||||
assert_eq!(
|
||||
@@ -689,7 +659,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: 20, ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
|
||||
// the one with score 5 was rejected, the new one inserted.
|
||||
assert_eq!(
|
||||
@@ -714,14 +684,14 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: (5 + s).into(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
}
|
||||
|
||||
let solution = RawSolution {
|
||||
score: ElectionScore { minimal_stake: 4, ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
|
||||
assert_eq!(
|
||||
MultiPhase::signed_submissions()
|
||||
@@ -736,7 +706,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: 5, ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
|
||||
// the one with score 5 was rejected, the new one inserted.
|
||||
assert_eq!(
|
||||
@@ -761,7 +731,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: (5 + s).into(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
}
|
||||
|
||||
assert_eq!(balances(&99).1, 2 * 5);
|
||||
@@ -772,7 +742,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: 20, ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(999), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(999), Box::new(solution)));
|
||||
|
||||
// got one bond back.
|
||||
assert_eq!(balances(&99).1, 2 * 4);
|
||||
@@ -791,7 +761,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: (5 + i).into(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
}
|
||||
assert_eq!(
|
||||
MultiPhase::signed_submissions()
|
||||
@@ -807,7 +777,7 @@ mod tests {
|
||||
..Default::default()
|
||||
};
|
||||
assert_noop!(
|
||||
submit_with_witness(Origin::signed(99), solution),
|
||||
MultiPhase::submit(Origin::signed(99), Box::new(solution)),
|
||||
Error::<Runtime>::SignedQueueFull,
|
||||
);
|
||||
})
|
||||
@@ -829,18 +799,18 @@ mod tests {
|
||||
let solution = raw_solution();
|
||||
|
||||
// submit a correct one.
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution.clone()));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution.clone())));
|
||||
|
||||
// make the solution invalidly better and submit. This ought to be slashed.
|
||||
let mut solution_999 = solution.clone();
|
||||
solution_999.score.minimal_stake += 1;
|
||||
assert_ok!(submit_with_witness(Origin::signed(999), solution_999));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(999), Box::new(solution_999)));
|
||||
|
||||
// make the solution invalidly worse and submit. This ought to be suppressed and
|
||||
// returned.
|
||||
let mut solution_9999 = solution.clone();
|
||||
solution_9999.score.minimal_stake -= 1;
|
||||
assert_ok!(submit_with_witness(Origin::signed(9999), solution_9999));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(9999), Box::new(solution_9999)));
|
||||
|
||||
assert_eq!(
|
||||
MultiPhase::signed_submissions().iter().map(|x| x.who).collect::<Vec<_>>(),
|
||||
@@ -881,14 +851,14 @@ mod tests {
|
||||
assert_eq!(raw.solution.voter_count(), 5);
|
||||
assert_eq!(<Runtime as Config>::SignedMaxWeight::get(), 40);
|
||||
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), raw.clone()));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(raw.clone())));
|
||||
|
||||
<SignedMaxWeight>::set(30);
|
||||
|
||||
// note: resubmitting the same solution is technically okay as long as the queue has
|
||||
// space.
|
||||
assert_noop!(
|
||||
submit_with_witness(Origin::signed(99), raw),
|
||||
MultiPhase::submit(Origin::signed(99), Box::new(raw)),
|
||||
Error::<Runtime>::SignedTooMuchWeight,
|
||||
);
|
||||
})
|
||||
@@ -904,7 +874,7 @@ mod tests {
|
||||
|
||||
assert_eq!(balances(&123), (0, 0));
|
||||
assert_noop!(
|
||||
submit_with_witness(Origin::signed(123), solution),
|
||||
MultiPhase::submit(Origin::signed(123), Box::new(solution)),
|
||||
Error::<Runtime>::SignedCannotPayDeposit,
|
||||
);
|
||||
|
||||
@@ -926,7 +896,7 @@ mod tests {
|
||||
score: ElectionScore { minimal_stake: (5 + s).into(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
}
|
||||
|
||||
// this solution has a higher score than any in the queue
|
||||
@@ -940,7 +910,7 @@ mod tests {
|
||||
|
||||
assert_eq!(balances(&123), (0, 0));
|
||||
assert_noop!(
|
||||
submit_with_witness(Origin::signed(123), solution),
|
||||
MultiPhase::submit(Origin::signed(123), Box::new(solution)),
|
||||
Error::<Runtime>::SignedCannotPayDeposit,
|
||||
);
|
||||
|
||||
@@ -969,7 +939,7 @@ mod tests {
|
||||
let solution = raw_solution();
|
||||
|
||||
// submit a correct one.
|
||||
assert_ok!(submit_with_witness(Origin::signed(99), solution.clone()));
|
||||
assert_ok!(MultiPhase::submit(Origin::signed(99), Box::new(solution)));
|
||||
|
||||
// _some_ good solution was stored.
|
||||
assert!(MultiPhase::finalize_signed_phase());
|
||||
|
||||
@@ -662,7 +662,7 @@ mod max_weight {
|
||||
fn finalize_signed_phase_reject_solution() -> Weight {
|
||||
unreachable!()
|
||||
}
|
||||
fn submit(c: u32) -> Weight {
|
||||
fn submit() -> Weight {
|
||||
unreachable!()
|
||||
}
|
||||
fn submit_unsigned(v: u32, t: u32, a: u32, d: u32) -> Weight {
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
//! Autogenerated weights for pallet_election_provider_multi_phase
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! DATE: 2022-03-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
|
||||
|
||||
// Executed Command:
|
||||
// ./target/production/substrate
|
||||
// target/production/substrate
|
||||
// benchmark
|
||||
// --chain=dev
|
||||
// --steps=50
|
||||
@@ -33,9 +33,7 @@
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --output=./frame/election-provider-multi-phase/src/weights.rs
|
||||
// --template=.maintain/frame-weight-template.hbs
|
||||
// --header=HEADER-APACHE2
|
||||
// --raw
|
||||
// --template=./.maintain/frame-weight-template.hbs
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
@@ -53,7 +51,7 @@ pub trait WeightInfo {
|
||||
fn finalize_signed_phase_reject_solution() -> Weight;
|
||||
fn create_snapshot_internal(v: u32, t: u32, ) -> Weight;
|
||||
fn elect_queued(a: u32, d: u32, ) -> Weight;
|
||||
fn submit(c: u32, ) -> Weight;
|
||||
fn submit() -> Weight;
|
||||
fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight;
|
||||
fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight;
|
||||
}
|
||||
@@ -70,33 +68,33 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Storage: Staking ForceEra (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
|
||||
fn on_initialize_nothing() -> Weight {
|
||||
(12_763_000 as Weight)
|
||||
(13_342_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(8 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase Round (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)
|
||||
fn on_initialize_open_signed() -> Weight {
|
||||
(13_195_000 as Weight)
|
||||
(13_503_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase Round (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)
|
||||
fn on_initialize_open_unsigned() -> Weight {
|
||||
(12_782_000 as Weight)
|
||||
(13_688_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: System Account (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase QueuedSolution (r:0 w:1)
|
||||
fn finalize_signed_phase_accept_solution() -> Weight {
|
||||
(27_421_000 as Weight)
|
||||
(29_124_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn finalize_signed_phase_reject_solution() -> Weight {
|
||||
(21_325_000 as Weight)
|
||||
(21_950_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
@@ -104,11 +102,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Storage: ElectionProviderMultiPhase DesiredTargets (r:0 w:1)
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1)
|
||||
fn create_snapshot_internal(v: u32, t: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
(17_274_000 as Weight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((216_000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add((191_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((51_000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add((53_000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
|
||||
@@ -121,24 +119,22 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)
|
||||
fn elect_queued(a: u32, d: u32, ) -> Weight {
|
||||
(38_368_000 as Weight)
|
||||
(145_826_000 as Weight)
|
||||
// Standard Error: 4_000
|
||||
.saturating_add((1_414_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 7_000
|
||||
.saturating_add((175_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add((604_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 6_000
|
||||
.saturating_add((72_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(8 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase SnapshotMetadata (r:1 w:0)
|
||||
// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionNextIndex (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionsMap (r:0 w:1)
|
||||
fn submit(c: u32, ) -> Weight {
|
||||
(39_488_000 as Weight)
|
||||
// Standard Error: 22_000
|
||||
.saturating_add((230_000 as Weight).saturating_mul(c as Weight))
|
||||
fn submit() -> Weight {
|
||||
(41_579_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
@@ -151,14 +147,14 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0)
|
||||
fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((1_544_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((60_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 9_000
|
||||
.saturating_add((6_555_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 14_000
|
||||
.saturating_add((1_318_000 as Weight).saturating_mul(d as Weight))
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((882_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 7_000
|
||||
.saturating_add((144_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 12_000
|
||||
.saturating_add((6_534_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 18_000
|
||||
.saturating_add((1_312_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
@@ -166,16 +162,14 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Storage: ElectionProviderMultiPhase DesiredTargets (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase MinimumUntrustedScore (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0)
|
||||
fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight {
|
||||
fn feasibility_check(v: u32, _t: u32, a: u32, d: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((1_527_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 6_000
|
||||
.saturating_add((151_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 10_000
|
||||
.saturating_add((5_433_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 15_000
|
||||
.saturating_add((1_420_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add((835_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 12_000
|
||||
.saturating_add((5_395_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 19_000
|
||||
.saturating_add((1_243_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
}
|
||||
}
|
||||
@@ -191,33 +185,33 @@ impl WeightInfo for () {
|
||||
// Storage: Staking ForceEra (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
|
||||
fn on_initialize_nothing() -> Weight {
|
||||
(12_763_000 as Weight)
|
||||
(13_342_000 as Weight)
|
||||
.saturating_add(RocksDbWeight::get().reads(8 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase Round (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)
|
||||
fn on_initialize_open_signed() -> Weight {
|
||||
(13_195_000 as Weight)
|
||||
(13_503_000 as Weight)
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase Round (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)
|
||||
fn on_initialize_open_unsigned() -> Weight {
|
||||
(12_782_000 as Weight)
|
||||
(13_688_000 as Weight)
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: System Account (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase QueuedSolution (r:0 w:1)
|
||||
fn finalize_signed_phase_accept_solution() -> Weight {
|
||||
(27_421_000 as Weight)
|
||||
(29_124_000 as Weight)
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn finalize_signed_phase_reject_solution() -> Weight {
|
||||
(21_325_000 as Weight)
|
||||
(21_950_000 as Weight)
|
||||
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
@@ -225,11 +219,11 @@ impl WeightInfo for () {
|
||||
// Storage: ElectionProviderMultiPhase DesiredTargets (r:0 w:1)
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1)
|
||||
fn create_snapshot_internal(v: u32, t: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
(17_274_000 as Weight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((216_000 as Weight).saturating_mul(v as Weight))
|
||||
.saturating_add((191_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((51_000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add((53_000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
|
||||
@@ -242,24 +236,22 @@ impl WeightInfo for () {
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:0 w:1)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1)
|
||||
fn elect_queued(a: u32, d: u32, ) -> Weight {
|
||||
(38_368_000 as Weight)
|
||||
(145_826_000 as Weight)
|
||||
// Standard Error: 4_000
|
||||
.saturating_add((1_414_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 7_000
|
||||
.saturating_add((175_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add((604_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 6_000
|
||||
.saturating_add((72_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(8 as Weight))
|
||||
}
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase SnapshotMetadata (r:1 w:0)
|
||||
// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionIndices (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionNextIndex (r:1 w:1)
|
||||
// Storage: ElectionProviderMultiPhase SignedSubmissionsMap (r:0 w:1)
|
||||
fn submit(c: u32, ) -> Weight {
|
||||
(39_488_000 as Weight)
|
||||
// Standard Error: 22_000
|
||||
.saturating_add((230_000 as Weight).saturating_mul(c as Weight))
|
||||
fn submit() -> Weight {
|
||||
(41_579_000 as Weight)
|
||||
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
@@ -272,14 +264,14 @@ impl WeightInfo for () {
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0)
|
||||
fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((1_544_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 5_000
|
||||
.saturating_add((60_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 9_000
|
||||
.saturating_add((6_555_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 14_000
|
||||
.saturating_add((1_318_000 as Weight).saturating_mul(d as Weight))
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((882_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 7_000
|
||||
.saturating_add((144_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 12_000
|
||||
.saturating_add((6_534_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 18_000
|
||||
.saturating_add((1_312_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
@@ -287,16 +279,14 @@ impl WeightInfo for () {
|
||||
// Storage: ElectionProviderMultiPhase DesiredTargets (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase MinimumUntrustedScore (r:1 w:0)
|
||||
// Storage: ElectionProviderMultiPhase Snapshot (r:1 w:0)
|
||||
fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight {
|
||||
fn feasibility_check(v: u32, _t: u32, a: u32, d: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((1_527_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 6_000
|
||||
.saturating_add((151_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 10_000
|
||||
.saturating_add((5_433_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 15_000
|
||||
.saturating_add((1_420_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add((835_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 12_000
|
||||
.saturating_add((5_395_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 19_000
|
||||
.saturating_add((1_243_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user