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 all commits
Commits
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
28 changes: 0 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-support-test = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
3 changes: 0 additions & 3 deletions runtime/common/src/slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ mod tests {
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Slots: slots::{Pallet, Call, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage},
}
);

Expand Down Expand Up @@ -484,8 +483,6 @@ mod tests {
type OnSetCode = ();
}

impl pallet_randomness_collective_flip::Config for Test {}

parameter_types! {
pub const ExistentialDeposit: u64 = 1;
}
Expand Down
3 changes: 0 additions & 3 deletions runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "m
pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -155,7 +154,6 @@ std = [
"pallet-utility/std",
"pallet-vesting/std",
"pallet-babe/std",
"pallet-randomness-collective-flip/std",
"pallet-xcm/std",
"sp-runtime/std",
"sp-staking/std",
Expand Down Expand Up @@ -249,7 +247,6 @@ try-runtime = [
"pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"pallet-babe/try-runtime",
"pallet-randomness-collective-flip/try-runtime",
"runtime-common/try-runtime",
]
# When enabled, the runtime api will not be build.
Expand Down
27 changes: 7 additions & 20 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ impl frame_system::Config for Runtime {
type OnSetCode = ();
}

impl pallet_randomness_collective_flip::Config for Runtime {}

parameter_types! {
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
BlockWeights::get().max_block;
Expand Down Expand Up @@ -1388,7 +1386,6 @@ construct_runtime! {
{
// Basic stuff; balances is uncallable initially.
System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 0,
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 32,

// Must be before session.
Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned} = 1,
Expand Down Expand Up @@ -1509,28 +1506,18 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
SetStakingLimits,
RemoveCollectiveFlip,
>;
/// The payload being signed in the transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

pub struct SetStakingLimits;
impl frame_support::traits::OnRuntimeUpgrade for SetStakingLimits {
pub struct RemoveCollectiveFlip;
impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip {
fn on_runtime_upgrade() -> Weight {
// This will be the threshold needed henceforth to become a nominator. All nominators will
// less than this amount bonded are at the risk of being chilled by another reporter.
let min_nominator_bond = UNITS / 10;
// The absolute maximum number of nominators. This number is set rather conservatively, and
// is expected to increase soon after this runtime upgrade via another governance proposal.
// The current Polkadot state has more than 30_000 nominators, therefore no other nominator
// can join.
let max_nominators = 20_000;
<pallet_staking::MinNominatorBond<Runtime>>::put(min_nominator_bond);
<pallet_staking::MaxNominatorsCount<Runtime>>::put(max_nominators);

// we set no limits on validators for now.

<Runtime as frame_system::Config>::DbWeight::get().writes(2)
use frame_support::storage::migration;
// Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip`
migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b"");
<Runtime as frame_system::Config>::DbWeight::get().writes(1)
}
}

Expand Down
1 change: 0 additions & 1 deletion runtime/parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substra
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-support-test = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
3 changes: 0 additions & 3 deletions runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "m
pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -139,7 +138,6 @@ std = [
"pallet-treasury/std",
"pallet-tips/std",
"pallet-babe/std",
"pallet-randomness-collective-flip/std",
"pallet-vesting/std",
"pallet-utility/std",
"sp-runtime/std",
Expand Down Expand Up @@ -222,7 +220,6 @@ try-runtime = [
"pallet-treasury/try-runtime",
"pallet-tips/try-runtime",
"pallet-babe/try-runtime",
"pallet-randomness-collective-flip/try-runtime",
"pallet-vesting/try-runtime",
"pallet-utility/try-runtime",
"runtime-common/try-runtime",
Expand Down
52 changes: 7 additions & 45 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ impl frame_system::Config for Runtime {
type OnSetCode = ();
}

impl pallet_randomness_collective_flip::Config for Runtime {}

parameter_types! {
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
BlockWeights::get().max_block;
Expand Down Expand Up @@ -987,7 +985,6 @@ construct_runtime! {
{
// Basic stuff; balances is uncallable initially.
System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 0,
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>} = 1,

// Must be before session.
Expand Down Expand Up @@ -1044,31 +1041,6 @@ construct_runtime! {
}
}

pub struct GrandpaStoragePrefixMigration;
impl frame_support::traits::OnRuntimeUpgrade for GrandpaStoragePrefixMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
use frame_support::traits::PalletInfo;
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
pallet_grandpa::migrations::v3_1::migrate::<Runtime, Grandpa, _>(name)
}

#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
use frame_support::traits::PalletInfo;
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
pallet_grandpa::migrations::v3_1::pre_migration::<Runtime, Grandpa, _>(name);
Ok(())
}

#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
pallet_grandpa::migrations::v3_1::post_migration::<Grandpa>();
Ok(())
}
}

/// The address format for describing accounts.
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
/// Block header type as expected by this runtime.
Expand Down Expand Up @@ -1099,28 +1071,18 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
(GrandpaStoragePrefixMigration, SetStakingLimits),
RemoveCollectiveFlip,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

pub struct SetStakingLimits;
impl frame_support::traits::OnRuntimeUpgrade for SetStakingLimits {
pub struct RemoveCollectiveFlip;
impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip {
fn on_runtime_upgrade() -> Weight {
// This will be the threshold needed henceforth to become a nominator. All nominators will
// less than this amount bonded are at the risk of being chilled by another reporter.
let min_nominator_bond = 20 * UNITS;
// The absolute maximum number of nominators. This number is set rather conservatively, and
// is expected to increase soon after this runtime upgrade via another governance proposal.
// The current Polkadot state has more than 30_000 nominators, therefore no other nominator
// can join.
let max_nominators = 20_000;
<pallet_staking::MinNominatorBond<Runtime>>::put(min_nominator_bond);
<pallet_staking::MaxNominatorsCount<Runtime>>::put(max_nominators);

// we set no limits on validators for now.

<Runtime as frame_system::Config>::DbWeight::get().writes(2)
use frame_support::storage::migration;
// Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip`
migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b"");
<Runtime as frame_system::Config>::DbWeight::get().writes(1)
}
}

Expand Down
2 changes: 0 additions & 2 deletions runtime/test-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "ma
pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -114,7 +113,6 @@ std = [
"pallet-babe/std",
"babe-primitives/std",
"sp-session/std",
"pallet-randomness-collective-flip/std",
"runtime-common/std",
"log/std",
"frame-election-provider-support/std",
Expand Down
3 changes: 0 additions & 3 deletions runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
type Extrinsic = UncheckedExtrinsic;
}

impl pallet_randomness_collective_flip::Config for Runtime {}

parameter_types! {
pub storage EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64;
pub storage ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
Expand Down Expand Up @@ -504,7 +502,6 @@ construct_runtime! {
{
// Basic stuff; balances is uncallable initially.
System: frame_system::{Pallet, Call, Storage, Config, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage},

// Must be before session.
Babe: pallet_babe::{Pallet, Call, Storage, Config},
Expand Down
3 changes: 0 additions & 3 deletions runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "m
pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -152,7 +151,6 @@ std = [
"pallet-vesting/std",
"pallet-xcm/std",
"pallet-babe/std",
"pallet-randomness-collective-flip/std",
"frame-executive/std",
"sp-runtime/std",
"sp-staking/std",
Expand Down Expand Up @@ -239,7 +237,6 @@ try-runtime = [
"pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"pallet-babe/try-runtime",
"pallet-randomness-collective-flip/try-runtime",
"runtime-common/try-runtime",
]
# When enabled, the runtime api will not be build.
Expand Down
Loading