diff --git a/Cargo.lock b/Cargo.lock index 7a7715aab01..736987ea46b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1860,7 +1860,6 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", - "pallet-randomness-collective-flip", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", @@ -2001,7 +2000,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.3.3", + "rustc_version", "syn", ] @@ -5580,20 +5579,6 @@ dependencies = [ "sp-std 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=master)", ] -[[package]] -name = "pallet-randomness-collective-flip" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a9465729e2c5d2ef8d87ac404da27e5e10adde8a" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "safe-mix", - "scale-info", - "sp-runtime 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=master)", - "sp-std 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=master)", -] - [[package]] name = "pallet-recovery" version = "4.0.0-dev" @@ -6024,7 +6009,6 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-collator-selection", - "pallet-randomness-collective-flip", "pallet-session", "pallet-sudo", "pallet-template", @@ -8393,7 +8377,6 @@ dependencies = [ "pallet-assets", "pallet-aura", "pallet-balances", - "pallet-randomness-collective-flip", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", @@ -8525,15 +8508,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.3.3" @@ -8585,15 +8559,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -[[package]] -name = "safe-mix" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" -dependencies = [ - "rustc_version 0.2.3", -] - [[package]] name = "salsa20" version = "0.8.1" @@ -10317,15 +10282,6 @@ dependencies = [ "semver-parser 0.7.0", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser 0.7.0", -] - [[package]] name = "semver" version = "0.11.0" @@ -10581,7 +10537,7 @@ dependencies = [ "rand 0.8.4", "rand_core 0.6.3", "ring", - "rustc_version 0.3.3", + "rustc_version", "sha2 0.9.8", "subtle", "x25519-dalek", @@ -11917,7 +11873,6 @@ dependencies = [ "pallet-collator-selection", "pallet-multisig", "pallet-proxy", - "pallet-randomness-collective-flip", "pallet-session", "pallet-sudo", "pallet-timestamp", @@ -11983,7 +11938,6 @@ dependencies = [ "pallet-collator-selection", "pallet-multisig", "pallet-proxy", - "pallet-randomness-collective-flip", "pallet-session", "pallet-sudo", "pallet-timestamp", @@ -13430,7 +13384,6 @@ dependencies = [ "pallet-collator-selection", "pallet-multisig", "pallet-proxy", - "pallet-randomness-collective-flip", "pallet-session", "pallet-sudo", "pallet-timestamp", diff --git a/parachain-template/runtime/Cargo.toml b/parachain-template/runtime/Cargo.toml index e23919db31b..abac6fe3f90 100644 --- a/parachain-template/runtime/Cargo.toml +++ b/parachain-template/runtime/Cargo.toml @@ -52,7 +52,6 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate" pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" } @@ -108,7 +107,6 @@ std = [ "pallet-authorship/std", "pallet-balances/std", "pallet-collator-selection/std", - "pallet-randomness-collective-flip/std", "pallet-session/std", "pallet-sudo/std", "pallet-template/std", diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index ed02fd12cfd..7f1f7807981 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -390,8 +390,6 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type ReservedXcmpWeight = ReservedXcmpWeight; } -impl pallet_randomness_collective_flip::Config for Runtime {} - impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} @@ -629,7 +627,6 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system::{ Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 2, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, diff --git a/polkadot-parachains/rococo/Cargo.toml b/polkadot-parachains/rococo/Cargo.toml index 1c4e12ce5f3..72cda0e06a6 100644 --- a/polkadot-parachains/rococo/Cargo.toml +++ b/polkadot-parachains/rococo/Cargo.toml @@ -32,7 +32,6 @@ frame-system = { git = "https://github.com/paritytech/substrate", default-featur frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-assets = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -85,7 +84,6 @@ std = [ "frame-system/std", "pallet-assets/std", "pallet-balances/std", - "pallet-randomness-collective-flip/std", "pallet-timestamp/std", "pallet-sudo/std", "pallet-transaction-payment/std", diff --git a/polkadot-parachains/rococo/src/lib.rs b/polkadot-parachains/rococo/src/lib.rs index 698fcaad09f..e41111c6084 100644 --- a/polkadot-parachains/rococo/src/lib.rs +++ b/polkadot-parachains/rococo/src/lib.rs @@ -188,7 +188,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); - type DbWeight = (); + type DbWeight = RocksDbWeight; type BaseCallFilter = frame_support::traits::Everything; type SystemWeightInfo = (); type BlockWeights = RuntimeBlockWeights; @@ -232,8 +232,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; } -impl pallet_randomness_collective_flip::Config for Runtime {} - parameter_types! { pub const OperationalFeeMultiplier: u8 = 5; } @@ -512,7 +510,6 @@ construct_runtime! { System: frame_system::{Pallet, Call, Storage, Config, Event}, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event}, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, ParachainSystem: cumulus_pallet_parachain_system::{ @@ -579,8 +576,19 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPallets, + RemoveCollectiveFlip, >; +pub struct RemoveCollectiveFlip; +impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { + fn on_runtime_upgrade() -> Weight { + use frame_support::storage::migration; + // Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip` + migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); + ::DbWeight::get().writes(1) + } +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { diff --git a/polkadot-parachains/statemine/Cargo.toml b/polkadot-parachains/statemine/Cargo.toml index ce1b05faadf..63f2446a983 100644 --- a/polkadot-parachains/statemine/Cargo.toml +++ b/polkadot-parachains/statemine/Cargo.toml @@ -40,7 +40,6 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -127,7 +126,6 @@ std = [ "pallet-balances/std", "pallet-multisig/std", "pallet-proxy/std", - "pallet-randomness-collective-flip/std", "pallet-session/std", "pallet-sudo/std", "pallet-timestamp/std", diff --git a/polkadot-parachains/statemine/src/lib.rs b/polkadot-parachains/statemine/src/lib.rs index c4b5ef92d00..5b0b6c9398a 100644 --- a/polkadot-parachains/statemine/src/lib.rs +++ b/polkadot-parachains/statemine/src/lib.rs @@ -457,8 +457,6 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type ReservedXcmpWeight = ReservedXcmpWeight; } -impl pallet_randomness_collective_flip::Config for Runtime {} - impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} @@ -724,7 +722,6 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system::{ Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 2, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, @@ -786,9 +783,19 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPallets, - (), + RemoveCollectiveFlip, >; +pub struct RemoveCollectiveFlip; +impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { + fn on_runtime_upgrade() -> Weight { + use frame_support::storage::migration; + // Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip` + migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); + ::DbWeight::get().writes(1) + } +} + impl_runtime_apis! { impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { diff --git a/polkadot-parachains/statemint/Cargo.toml b/polkadot-parachains/statemint/Cargo.toml index 58b3e826c08..89d796ff300 100644 --- a/polkadot-parachains/statemint/Cargo.toml +++ b/polkadot-parachains/statemint/Cargo.toml @@ -40,7 +40,6 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -127,7 +126,6 @@ std = [ "pallet-balances/std", "pallet-multisig/std", "pallet-proxy/std", - "pallet-randomness-collective-flip/std", "pallet-session/std", "pallet-sudo/std", "pallet-timestamp/std", diff --git a/polkadot-parachains/statemint/src/lib.rs b/polkadot-parachains/statemint/src/lib.rs index b42fb90b3e1..b574184eba0 100644 --- a/polkadot-parachains/statemint/src/lib.rs +++ b/polkadot-parachains/statemint/src/lib.rs @@ -224,8 +224,6 @@ impl pallet_transaction_payment::Config for Runtime { type OperationalFeeMultiplier = OperationalFeeMultiplier; } -impl pallet_randomness_collective_flip::Config for Runtime {} - parameter_types! { pub const AssetDeposit: Balance = 100 * DOLLARS; // 100 DOLLARS deposit to create asset pub const ApprovalDeposit: Balance = EXISTENTIAL_DEPOSIT; @@ -727,7 +725,6 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system::{ Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 2, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, diff --git a/polkadot-parachains/westmint/Cargo.toml b/polkadot-parachains/westmint/Cargo.toml index d4c1b5f8a96..57b570192c4 100644 --- a/polkadot-parachains/westmint/Cargo.toml +++ b/polkadot-parachains/westmint/Cargo.toml @@ -40,7 +40,6 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-proxy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -127,7 +126,6 @@ std = [ "pallet-balances/std", "pallet-multisig/std", "pallet-proxy/std", - "pallet-randomness-collective-flip/std", "pallet-session/std", "pallet-sudo/std", "pallet-timestamp/std", diff --git a/polkadot-parachains/westmint/src/lib.rs b/polkadot-parachains/westmint/src/lib.rs index a795dad3756..2454e407180 100644 --- a/polkadot-parachains/westmint/src/lib.rs +++ b/polkadot-parachains/westmint/src/lib.rs @@ -213,8 +213,6 @@ impl pallet_transaction_payment::Config for Runtime { type OperationalFeeMultiplier = OperationalFeeMultiplier; } -impl pallet_randomness_collective_flip::Config for Runtime {} - impl pallet_sudo::Config for Runtime { type Event = Event; type Call = Call; @@ -702,7 +700,6 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system::{ Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, }, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, ParachainInfo: parachain_info::{Pallet, Storage, Config}, Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, @@ -767,9 +764,19 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPallets, - (), + RemoveCollectiveFlip, >; +pub struct RemoveCollectiveFlip; +impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { + fn on_runtime_upgrade() -> Weight { + use frame_support::storage::migration; + // Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip` + migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); + ::DbWeight::get().writes(1) + } +} + impl_runtime_apis! { impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { diff --git a/test/runtime-upgrade/Cargo.toml b/test/runtime-upgrade/Cargo.toml index efe92061965..a425abc59e2 100644 --- a/test/runtime-upgrade/Cargo.toml +++ b/test/runtime-upgrade/Cargo.toml @@ -14,7 +14,6 @@ frame-executive = { git = "https://github.com/paritytech/substrate", default-fea frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -50,7 +49,6 @@ std = [ "frame-support/std", "frame-system/std", "pallet-balances/std", - "pallet-randomness-collective-flip/std", "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment/std", diff --git a/test/runtime/Cargo.toml b/test/runtime/Cargo.toml index a88d89e8e95..47cd1806349 100644 --- a/test/runtime/Cargo.toml +++ b/test/runtime/Cargo.toml @@ -14,7 +14,6 @@ frame-executive = { git = "https://github.com/paritytech/substrate", default-fea frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -50,7 +49,6 @@ std = [ "frame-support/std", "frame-system/std", "pallet-balances/std", - "pallet-randomness-collective-flip/std", "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment/std", diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index d06bb951c4a..2ed83ae8292 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -245,8 +245,6 @@ impl pallet_transaction_payment::Config for Runtime { type OperationalFeeMultiplier = OperationalFeeMultiplier; } -impl pallet_randomness_collective_flip::Config for Runtime {} - impl pallet_sudo::Config for Runtime { type Call = Call; type Event = Event; @@ -280,7 +278,6 @@ construct_runtime! { Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event}, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, } }