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

Companion for substrate/pull/9442 (#3594)

* Fix compact build

* Fix again

* fix staking miner

* fmt

* update Substrate

Co-authored-by: parity-processbot <>
parent 05de9ef1
Pipeline #152333 passed with stages
in 48 minutes and 39 seconds
This diff is collapsed.
...@@ -392,7 +392,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { ...@@ -392,7 +392,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type OffchainRepeat = OffchainRepeat; type OffchainRepeat = OffchainRepeat;
type MinerTxPriority = NposSolutionPriority; type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking; type DataProvider = Staking;
type CompactSolution = NposCompactSolution24; type Solution = NposCompactSolution24;
type OnChainAccuracy = Perbill; type OnChainAccuracy = Perbill;
type Fallback = Fallback; type Fallback = Fallback;
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
...@@ -484,7 +484,7 @@ type SlashCancelOrigin = EnsureOneOf< ...@@ -484,7 +484,7 @@ type SlashCancelOrigin = EnsureOneOf<
impl pallet_staking::Config for Runtime { impl pallet_staking::Config for Runtime {
const MAX_NOMINATIONS: u32 = const MAX_NOMINATIONS: u32 =
<NposCompactSolution24 as sp_npos_elections::CompactSolution>::LIMIT as u32; <NposCompactSolution24 as sp_npos_elections::NposSolution>::LIMIT as u32;
type Currency = Balances; type Currency = Balances;
type UnixTime = Timestamp; type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote; type CurrencyToVote = CurrencyToVote;
...@@ -1044,14 +1044,16 @@ impl InstanceFilter<Call> for ProxyType { ...@@ -1044,14 +1044,16 @@ impl InstanceFilter<Call> for ProxyType {
Call::Treasury(..) | Call::Bounties(..) | Call::Treasury(..) | Call::Bounties(..) |
Call::Tips(..) | Call::Utility(..) Call::Tips(..) | Call::Utility(..)
), ),
ProxyType::Staking => ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..)), matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
},
ProxyType::IdentityJudgement => matches!( ProxyType::IdentityJudgement => matches!(
c, c,
Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..) Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..)
), ),
ProxyType::CancelProxy => ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..))), matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..)))
},
} }
} }
fn is_superset(&self, o: &Self) -> bool { fn is_superset(&self, o: &Self) -> bool {
......
...@@ -398,7 +398,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { ...@@ -398,7 +398,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type MinerTxPriority = NposSolutionPriority; type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking; type DataProvider = Staking;
type OnChainAccuracy = Perbill; type OnChainAccuracy = Perbill;
type CompactSolution = NposCompactSolution16; type Solution = NposCompactSolution16;
type Fallback = Fallback; type Fallback = Fallback;
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureOneOf< type ForceOrigin = EnsureOneOf<
...@@ -443,7 +443,7 @@ type SlashCancelOrigin = EnsureOneOf< ...@@ -443,7 +443,7 @@ type SlashCancelOrigin = EnsureOneOf<
impl pallet_staking::Config for Runtime { impl pallet_staking::Config for Runtime {
const MAX_NOMINATIONS: u32 = const MAX_NOMINATIONS: u32 =
<NposCompactSolution16 as sp_npos_elections::CompactSolution>::LIMIT as u32; <NposCompactSolution16 as sp_npos_elections::NposSolution>::LIMIT as u32;
type Currency = Balances; type Currency = Balances;
type UnixTime = Timestamp; type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote; type CurrencyToVote = CurrencyToVote;
...@@ -994,14 +994,16 @@ impl InstanceFilter<Call> for ProxyType { ...@@ -994,14 +994,16 @@ impl InstanceFilter<Call> for ProxyType {
Call::Treasury(..) | Call::Bounties(..) | Call::Treasury(..) | Call::Bounties(..) |
Call::Tips(..) | Call::Utility(..) Call::Tips(..) | Call::Utility(..)
), ),
ProxyType::Staking => ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..)), matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
},
ProxyType::IdentityJudgement => matches!( ProxyType::IdentityJudgement => matches!(
c, c,
Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..) Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..)
), ),
ProxyType::CancelProxy => ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..))), matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..)))
},
} }
} }
fn is_superset(&self, o: &Self) -> bool { fn is_superset(&self, o: &Self) -> bool {
......
...@@ -380,7 +380,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { ...@@ -380,7 +380,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type MinerTxPriority = NposSolutionPriority; type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking; type DataProvider = Staking;
type OnChainAccuracy = Perbill; type OnChainAccuracy = Perbill;
type CompactSolution = NposCompactSolution16; type Solution = NposCompactSolution16;
type Fallback = Fallback; type Fallback = Fallback;
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureRoot<AccountId>; type ForceOrigin = EnsureRoot<AccountId>;
...@@ -411,7 +411,7 @@ parameter_types! { ...@@ -411,7 +411,7 @@ parameter_types! {
impl pallet_staking::Config for Runtime { impl pallet_staking::Config for Runtime {
const MAX_NOMINATIONS: u32 = const MAX_NOMINATIONS: u32 =
<NposCompactSolution16 as sp_npos_elections::CompactSolution>::LIMIT as u32; <NposCompactSolution16 as sp_npos_elections::NposSolution>::LIMIT as u32;
type Currency = Balances; type Currency = Balances;
type UnixTime = Timestamp; type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote; type CurrencyToVote = CurrencyToVote;
...@@ -708,11 +708,13 @@ impl InstanceFilter<Call> for ProxyType { ...@@ -708,11 +708,13 @@ impl InstanceFilter<Call> for ProxyType {
Call::Slots(..) | Call::Slots(..) |
Call::Auctions(..) // Specifically omitting the entire XCM Pallet Call::Auctions(..) // Specifically omitting the entire XCM Pallet
), ),
ProxyType::Staking => ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..)), matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
},
ProxyType::SudoBalances => match c { ProxyType::SudoBalances => match c {
Call::Sudo(pallet_sudo::Call::sudo(ref x)) => Call::Sudo(pallet_sudo::Call::sudo(ref x)) => {
matches!(x.as_ref(), &Call::Balances(..)), matches!(x.as_ref(), &Call::Balances(..))
},
Call::Utility(..) => true, Call::Utility(..) => true,
_ => false, _ => false,
}, },
...@@ -720,8 +722,9 @@ impl InstanceFilter<Call> for ProxyType { ...@@ -720,8 +722,9 @@ impl InstanceFilter<Call> for ProxyType {
c, c,
Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..) Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..)
), ),
ProxyType::CancelProxy => ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..))), matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..)))
},
} }
} }
fn is_superset(&self, o: &Self) -> bool { fn is_superset(&self, o: &Self) -> bool {
......
...@@ -65,7 +65,7 @@ macro_rules! construct_runtime_prelude { ...@@ -65,7 +65,7 @@ macro_rules! construct_runtime_prelude {
mod private { mod private {
use super::*; use super::*;
pub(crate) fn [<create_uxt_ $runtime>]( pub(crate) fn [<create_uxt_ $runtime>](
raw_solution: EPM::RawSolution<EPM::CompactOf<Runtime>>, raw_solution: EPM::RawSolution<EPM::SolutionOf<Runtime>>,
witness: u32, witness: u32,
signer: crate::signer::Signer, signer: crate::signer::Signer,
nonce: crate::prelude::Index, nonce: crate::prelude::Index,
...@@ -334,7 +334,7 @@ fn mine_unchecked<T: EPM::Config>( ...@@ -334,7 +334,7 @@ fn mine_unchecked<T: EPM::Config>(
ext: &mut Ext, ext: &mut Ext,
iterations: usize, iterations: usize,
do_feasibility: bool, do_feasibility: bool,
) -> Result<(EPM::RawSolution<EPM::CompactOf<T>>, u32), Error> { ) -> Result<(EPM::RawSolution<EPM::SolutionOf<T>>, u32), Error> {
ext.execute_with(|| { ext.execute_with(|| {
let (solution, _) = <EPM::Pallet<T>>::mine_solution(iterations)?; let (solution, _) = <EPM::Pallet<T>>::mine_solution(iterations)?;
if do_feasibility { if do_feasibility {
......
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