From 02a09f0538a828790b9242b2d4bc4e8eda1b60ad Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Fri, 3 Jul 2020 15:35:36 +0200 Subject: [PATCH] Reduce Westend deposit requirements (#1341) * Switch branch * Return chain ops parts in new_chain_ops * Remove where param from new_chain_ops * Add task manager to new_chain_ops return * Revert branch switch * Revert "Revert branch switch" This reverts commit 7c7900c047abd794ddc759aa092811db4961a7a6. * network/test/src/lib: Adjust network worker polling Companion for https://github.com/paritytech/substrate/pull/6552. * Fix adder parachain * Fix collator tests * Revert branch switch * Bump everything - Remove old migration code - Reduce deposit requried for westend * Reapply fixes * Bump locl * Fix for #6550 * Fix message Co-authored-by: Ashley Ruglys Co-authored-by: Max Inden --- relay/kusama/Cargo.toml | 2 +- relay/kusama/src/lib.rs | 10 ++++++++-- relay/polkadot/Cargo.toml | 2 +- relay/polkadot/src/lib.rs | 23 ++++++++++++++++++++++- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/relay/kusama/Cargo.toml b/relay/kusama/Cargo.toml index dbe3934dd3..371d9fc537 100644 --- a/relay/kusama/Cargo.toml +++ b/relay/kusama/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kusama-runtime" -version = "0.8.13" +version = "0.8.14" authors = ["Parity Technologies "] edition = "2018" build = "build.rs" diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 17a5393758..f9ba963f04 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -152,8 +152,10 @@ impl system::Trait for Runtime { impl scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; + type PalletsOrigin = OriginCaller; type Call = Call; type MaximumWeight = MaximumBlockWeight; + type ScheduleOrigin = EnsureRoot; } parameter_types! { @@ -373,6 +375,7 @@ impl democracy::Trait for Runtime { type PreimageByteDeposit = PreimageByteDeposit; type Slash = Treasury; type Scheduler = Scheduler; + type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type OperationalPreimageOrigin = collective::EnsureMember; } @@ -891,8 +894,11 @@ impl proxy::Trait for Runtime { pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { - treasury::Module::::migrate_retract_tip_for_tip_new(); - 500_000_000 + if scheduler::Module::::migrate_v1_to_t2() { + ::MaximumBlockWeight::get() + } else { + ::DbWeight::get().reads(1) + 500_000_000 + } } } diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml index 96ec48d318..9df821f918 100644 --- a/relay/polkadot/Cargo.toml +++ b/relay/polkadot/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polkadot-runtime" -version = "0.8.13" +version = "0.8.14" authors = ["Parity Technologies "] edition = "2018" build = "build.rs" diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index e71d38759c..cd63dfce02 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -183,8 +183,10 @@ impl system::Trait for Runtime { impl scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; + type PalletsOrigin = OriginCaller; type Call = Call; type MaximumWeight = MaximumBlockWeight; + type ScheduleOrigin = EnsureRoot; } parameter_types! { @@ -442,6 +444,7 @@ impl democracy::Trait for Runtime { type OperationalPreimageOrigin = collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; + type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; } @@ -893,6 +896,17 @@ impl proxy::Trait for Runtime { type MaxProxies = MaxProxies; } +pub struct CustomOnRuntimeUpgrade; +impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + if scheduler::Module::::migrate_v1_to_t2() { + ::MaximumBlockWeight::get() + } else { + ::DbWeight::get().reads(1) + } + } +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -990,7 +1004,14 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = executive::Executive, Runtime, AllModules>; +pub type Executive = executive::Executive< + Runtime, + Block, + system::ChainContext, + Runtime, + AllModules, + CustomOnRuntimeUpgrade +>; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload;