Unverified Commit 416876b1 authored by Kian Paimani's avatar Kian Paimani Committed by GitHub
Browse files

Companion for `substrate/pull/9286` (#3443)



* Fix weights

* try something to unbreak companion

* update Substrate
Co-authored-by: Andronik Ordian's avatarAndronik Ordian <write@reusable.software>
Co-authored-by: parity-processbot <>
parent e82782c6
Pipeline #146699 passed with stages
in 32 minutes and 26 seconds
This diff is collapsed.
...@@ -14,7 +14,7 @@ metered = { package = "metered-channel", path = "../../metered-channel" } ...@@ -14,7 +14,7 @@ metered = { package = "metered-channel", path = "../../metered-channel" }
polkadot-overseer-gen-proc-macro = { path = "./proc-macro" } polkadot-overseer-gen-proc-macro = { path = "./proc-macro" }
polkadot-node-network-protocol = { path = "../../network/protocol"} polkadot-node-network-protocol = { path = "../../network/protocol"}
# trait SpawnNamed # trait SpawnNamed
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-primitives = { path = "../../primitives" }
futures-timer = "3.0.2" futures-timer = "3.0.2"
pin-project = "1.0" pin-project = "1.0"
......
...@@ -67,7 +67,7 @@ pub use tracing; ...@@ -67,7 +67,7 @@ pub use tracing;
#[doc(hidden)] #[doc(hidden)]
pub use metered; pub use metered;
#[doc(hidden)] #[doc(hidden)]
pub use sp_core::traits::SpawnNamed; pub use polkadot_node_primitives::SpawnNamed;
#[doc(hidden)] #[doc(hidden)]
pub use futures::{ pub use futures::{
......
...@@ -66,3 +66,16 @@ where ...@@ -66,3 +66,16 @@ where
Zero::zero(), Zero::zero(),
)) ))
} }
/// The numbers configured here should always be more than the the maximum limits of staking pallet
/// to ensure election snapshot will not run out of memory.
pub struct BenchmarkConfig;
impl pallet_election_provider_multi_phase::BenchmarkingConfig for BenchmarkConfig {
const VOTERS: [u32; 2] = [5_000, 10_000];
const TARGETS: [u32; 2] = [1_000, 2_000];
const ACTIVE_VOTERS: [u32; 2] = [1000, 4_000];
const DESIRED_TARGETS: [u32; 2] = [400, 800];
const SNAPSHOT_MAXIMUM_VOTERS: u32 = 25_000;
const MINER_MAXIMUM_VOTERS: u32 = 15_000;
const MAXIMUM_TARGETS: u32 = 2000;
}
...@@ -411,7 +411,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { ...@@ -411,7 +411,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type CompactSolution = NposCompactSolution24; type CompactSolution = NposCompactSolution24;
type OnChainAccuracy = Perbill; type OnChainAccuracy = Perbill;
type Fallback = Fallback; type Fallback = Fallback;
type BenchmarkingConfig = (); type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureOneOf< type ForceOrigin = EnsureOneOf<
AccountId, AccountId,
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
......
...@@ -62,7 +62,7 @@ impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo f ...@@ -62,7 +62,7 @@ impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo f
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
fn elect_queued() -> Weight { fn elect_queued(_v: u32, _t: u32, _a: u32, _d: u32, ) -> Weight {
(8_641_847_000 as Weight) (8_641_847_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight))
......
...@@ -391,7 +391,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { ...@@ -391,7 +391,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type OnChainAccuracy = Perbill; type OnChainAccuracy = Perbill;
type CompactSolution = NposCompactSolution16; type CompactSolution = NposCompactSolution16;
type Fallback = Fallback; type Fallback = Fallback;
type BenchmarkingConfig = (); type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureOneOf< type ForceOrigin = EnsureOneOf<
AccountId, AccountId,
EnsureRoot<AccountId>, EnsureRoot<AccountId>,
......
...@@ -62,7 +62,7 @@ impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo f ...@@ -62,7 +62,7 @@ impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo f
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
fn elect_queued() -> Weight { fn elect_queued(_v: u32, _t: u32, _a: u32, _d: u32, ) -> Weight {
(5_408_539_000 as Weight) (5_408_539_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight))
......
...@@ -397,7 +397,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { ...@@ -397,7 +397,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type OnChainAccuracy = Perbill; type OnChainAccuracy = Perbill;
type CompactSolution = NposCompactSolution16; type CompactSolution = NposCompactSolution16;
type Fallback = Fallback; type Fallback = Fallback;
type BenchmarkingConfig = (); type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureRoot<AccountId>; type ForceOrigin = EnsureRoot<AccountId>;
type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Runtime>; type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Runtime>;
} }
......
...@@ -62,7 +62,7 @@ impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo f ...@@ -62,7 +62,7 @@ impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo f
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
fn elect_queued() -> Weight { fn elect_queued(_v: u32, _t: u32, _a: u32, _d: u32, ) -> Weight {
(5_511_380_000 as Weight) (5_511_380_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment