diff --git a/CHANGELOG.md b/CHANGELOG.md index 1742a2daab..a968daee7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Bump parachains runtime API to v10 in Kusama to enable the `approval-voting-params` function [polkadot-fellows/runtimes#204](https://github.com/polkadot-fellows/runtimes/pull/204) - Use Relay Chain's Treasury Pallet account as a destination for XCM fees on System Parachain ([polkadot-fellows/runtimes#191](https://github.com/polkadot-fellows/runtimes/pull/191)) - Bump parachains runtime API to v10 in Polkadot to enable async-backing subsystems(still in backwards compatible mode) [polkadot-fellows/runtimes#222](https://github.com/polkadot-fellows/runtimes/pull/222) +- Prepared system parachain runtimes for async backing enabling ([polkadot-fellows/runtimes#228](https://github.com/polkadot-fellows/runtimes/pull/228)) ### Removed diff --git a/Cargo.lock b/Cargo.lock index 3de19219e2..4ed11ea462 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -476,6 +476,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "frame-benchmarking", @@ -602,6 +603,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "frame-benchmarking", @@ -1364,6 +1366,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "frame-benchmarking", @@ -1484,6 +1487,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "frame-benchmarking", @@ -1995,6 +1999,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "frame-benchmarking", @@ -2572,6 +2577,21 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "cumulus-primitives-aura" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f07d6177692154043d7ddcc0b87ca5365ae8e4d94b90d9931f6b2f76e162f09" +dependencies = [ + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-primitives", + "sp-api", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + [[package]] name = "cumulus-primitives-core" version = "0.8.0" @@ -3168,6 +3188,7 @@ dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "encointer-balances-tx-payment", diff --git a/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml b/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml index 63f26d7552..4cf672b77c 100644 --- a/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml @@ -17,7 +17,7 @@ frame-support = { version = "29.0.0" } parachains-common = { version = "8.0.0" } cumulus-primitives-core = { version = "0.8.0" } emulated-integration-tests-common = { version = "4.0.0" } -penpal-runtime = { version = "0.15.0" } +penpal-runtime = { version = "0.15.0", features = ["experimental"] } # Runtimes kusama-emulated-chain = { path = "../../../relays/kusama" } diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 4e062aed53..9ccc291686 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -33,7 +33,7 @@ frame-try-runtime = { default-features = false, optional = true, version = "0.35 pallet-asset-conversion-tx-payment = { default-features = false, version = "11.0.0" } pallet-assets = { default-features = false, version = "30.0.0" } pallet-asset-conversion = { default-features = false, version = "11.0.0" } -pallet-aura = { default-features = false, version = "28.0.0" } +pallet-aura = { default-features = false, version = "28.0.0", features = ["experimental"] } pallet-authorship = { default-features = false, version = "29.0.0" } pallet-balances = { default-features = false, version = "29.0.0" } pallet-message-queue = { default-features = false , version = "32.0.0" } @@ -83,6 +83,7 @@ cumulus-pallet-parachain-system = { default-features = false, features = ["param cumulus-pallet-session-benchmarking = { default-features = false, version = "10.0.0" } cumulus-pallet-xcm = { default-features = false , version = "0.8.0" } cumulus-pallet-xcmp-queue = { default-features = false , features = ["bridging"] , version = "0.8.0" } +cumulus-primitives-aura = { default-features = false , version = "0.8.0" } cumulus-primitives-core = { default-features = false , version = "0.8.0" } cumulus-primitives-utility = { default-features = false , version = "0.8.1" } pallet-collator-selection = { default-features = false , version = "10.0.0" } @@ -192,6 +193,7 @@ std = [ "cumulus-pallet-session-benchmarking/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", "cumulus-primitives-core/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", @@ -254,8 +256,6 @@ std = [ "xcm/std", ] -experimental = [ "pallet-aura/experimental" ] - # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 6e981deb6f..6898330ae5 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -33,7 +33,7 @@ use assets_common::{ matching::FromSiblingParachain, AssetIdForTrustBackedAssetsConvert, }; -use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -631,16 +631,18 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; - type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, - >; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = ConsensusHook; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; } +type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + impl parachain_info::Config for Runtime {} parameter_types! { @@ -741,8 +743,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "experimental")] - type SlotDuration = pallet_aura::MinimumPeriodTimesTwo; + type SlotDuration = ConstU64; } parameter_types! { @@ -1036,7 +1037,7 @@ mod benches { impl_runtime_apis! { impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) + sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) } fn authorities() -> Vec { @@ -1044,6 +1045,15 @@ impl_runtime_apis! { } } + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { + fn can_build_upon( + included_hash: ::Hash, + slot: cumulus_primitives_aura::Slot, + ) -> bool { + ConsensusHook::can_build_upon(included_hash, slot) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml index 1bc9e18891..4f3c38fe3f 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml @@ -33,7 +33,7 @@ frame-system-rpc-runtime-api = { default-features = false, version = "27.0.0" } frame-try-runtime = { default-features = false, optional = true, version = "0.35.0" } pallet-asset-tx-payment = { default-features = false , version = "29.0.0" } pallet-assets = { default-features = false, version = "30.0.0" } -pallet-aura = { default-features = false, version = "28.0.0" } +pallet-aura = { default-features = false, version = "28.0.0", features = ["experimental"] } pallet-authorship = { default-features = false, version = "29.0.0" } pallet-balances = { default-features = false, version = "29.0.0" } pallet-message-queue = { default-features = false , version = "32.0.0" } @@ -79,6 +79,7 @@ cumulus-pallet-parachain-system = { default-features = false, features = ["param cumulus-pallet-session-benchmarking = { default-features = false, version = "10.0.0" } cumulus-pallet-xcm = { default-features = false , version = "0.8.0" } cumulus-pallet-xcmp-queue = { default-features = false , features = ["bridging"] , version = "0.8.0" } +cumulus-primitives-aura = { default-features = false , version = "0.8.0" } cumulus-primitives-core = { default-features = false , version = "0.8.0" } cumulus-primitives-utility = { default-features = false , version = "0.8.1" } pallet-collator-selection = { default-features = false , version = "10.0.0" } @@ -177,6 +178,7 @@ std = [ "cumulus-pallet-session-benchmarking/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", "cumulus-primitives-core/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", @@ -236,8 +238,6 @@ std = [ "xcm/std", ] -experimental = [ "pallet-aura/experimental" ] - # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 408e0cd641..0629d6cf00 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -63,7 +63,7 @@ mod weights; pub mod xcm_config; use assets_common::{foreign_creators::ForeignCreators, matching::FromSiblingParachain}; -use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -556,16 +556,18 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; - type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, - >; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = ConsensusHook; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; } +type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + impl parachain_info::Config for Runtime {} parameter_types! { @@ -666,8 +668,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "experimental")] - type SlotDuration = pallet_aura::MinimumPeriodTimesTwo; + type SlotDuration = ConstU64; } parameter_types! { @@ -932,7 +933,7 @@ mod benches { impl_runtime_apis! { impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) + sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) } fn authorities() -> Vec { @@ -940,6 +941,15 @@ impl_runtime_apis! { } } + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { + fn can_build_upon( + included_hash: ::Hash, + slot: cumulus_primitives_aura::Slot, + ) -> bool { + ConsensusHook::can_build_upon(included_hash, slot) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index 6b5ba3f8c1..fa9a46a914 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -34,7 +34,7 @@ frame-system = { default-features = false, version = "29.0.0" } frame-system-benchmarking = { default-features = false, optional = true, version = "29.0.0" } frame-system-rpc-runtime-api = { default-features = false, version = "27.0.0" } frame-try-runtime = { default-features = false, optional = true, version = "0.35.0" } -pallet-aura = { default-features = false, version = "28.0.0" } +pallet-aura = { default-features = false, version = "28.0.0", features = ["experimental"] } pallet-authorship = { default-features = false, version = "29.0.0" } pallet-balances = { default-features = false, version = "29.0.0" } pallet-message-queue = { default-features = false , version = "32.0.0" } @@ -76,6 +76,7 @@ cumulus-pallet-parachain-system = { default-features = false, features = ["param cumulus-pallet-session-benchmarking = { default-features = false, version = "10.0.0" } cumulus-pallet-xcm = { default-features = false , version = "0.8.0" } cumulus-pallet-xcmp-queue = { default-features = false , features = ["bridging"] , version = "0.8.0" } +cumulus-primitives-aura = { default-features = false , version = "0.8.0" } cumulus-primitives-core = { default-features = false , version = "0.8.0" } cumulus-primitives-utility = { default-features = false , version = "0.8.1" } pallet-collator-selection = { default-features = false , version = "10.0.0" } @@ -128,6 +129,7 @@ std = [ "cumulus-pallet-session-benchmarking/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", "cumulus-primitives-core/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", @@ -249,8 +251,6 @@ try-runtime = [ "sp-runtime/try-runtime", ] -experimental = [ "pallet-aura/experimental" ] - # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 030acd6925..0fb464ac36 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -26,7 +26,7 @@ pub mod bridge_to_polkadot_config; mod weights; pub mod xcm_config; -use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -304,16 +304,18 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type ReservedDmpWeight = ReservedDmpWeight; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; - type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, - >; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = ConsensusHook; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; } +type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + impl parachain_info::Config for Runtime {} parameter_types! { @@ -415,8 +417,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "experimental")] - type SlotDuration = pallet_aura::MinimumPeriodTimesTwo; + type SlotDuration = ConstU64; } parameter_types! { @@ -551,7 +552,7 @@ mod benches { impl_runtime_apis! { impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) + sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) } fn authorities() -> Vec { @@ -559,6 +560,15 @@ impl_runtime_apis! { } } + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { + fn can_build_upon( + included_hash: ::Hash, + slot: cumulus_primitives_aura::Slot, + ) -> bool { + ConsensusHook::can_build_upon(included_hash, slot) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 9299cd55b3..59bf734dc4 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -34,7 +34,7 @@ frame-system = { default-features = false, version = "29.0.0" } frame-system-benchmarking = { default-features = false, optional = true, version = "29.0.0" } frame-system-rpc-runtime-api = { default-features = false, version = "27.0.0" } frame-try-runtime = { default-features = false, optional = true, version = "0.35.0" } -pallet-aura = { default-features = false, version = "28.0.0" } +pallet-aura = { default-features = false, version = "28.0.0", features = ["experimental"] } pallet-authorship = { default-features = false, version = "29.0.0" } pallet-balances = { default-features = false, version = "29.0.0" } pallet-message-queue = { default-features = false , version = "32.0.0" } @@ -76,6 +76,7 @@ cumulus-pallet-parachain-system = { default-features = false, features = ["param cumulus-pallet-session-benchmarking = { default-features = false, version = "10.0.0" } cumulus-pallet-xcm = { default-features = false , version = "0.8.0" } cumulus-pallet-xcmp-queue = { default-features = false , features = ["bridging"] , version = "0.8.0" } +cumulus-primitives-aura = { default-features = false , version = "0.8.0" } cumulus-primitives-core = { default-features = false , version = "0.8.0" } cumulus-primitives-utility = { default-features = false , version = "0.8.1" } pallet-collator-selection = { default-features = false , version = "10.0.0" } @@ -128,6 +129,7 @@ std = [ "cumulus-pallet-session-benchmarking/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", "cumulus-primitives-core/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", @@ -248,8 +250,6 @@ try-runtime = [ "sp-runtime/try-runtime", ] -experimental = [ "pallet-aura/experimental" ] - # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 7cd69afae9..b79af8f02c 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -26,7 +26,7 @@ pub mod bridge_to_kusama_config; mod weights; pub mod xcm_config; -use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -305,16 +305,18 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type ReservedDmpWeight = ReservedDmpWeight; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; - type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, - >; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = ConsensusHook; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; } +type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + impl parachain_info::Config for Runtime {} parameter_types! { @@ -416,8 +418,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "experimental")] - type SlotDuration = pallet_aura::MinimumPeriodTimesTwo; + type SlotDuration = ConstU64; } parameter_types! { @@ -552,7 +553,7 @@ mod benches { impl_runtime_apis! { impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) + sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) } fn authorities() -> Vec { @@ -560,6 +561,15 @@ impl_runtime_apis! { } } + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { + fn can_build_upon( + included_hash: ::Hash, + slot: cumulus_primitives_aura::Slot, + ) -> bool { + ConsensusHook::can_build_upon(included_hash, slot) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/system-parachains/collectives/collectives-polkadot/Cargo.toml b/system-parachains/collectives/collectives-polkadot/Cargo.toml index 270ffb4433..c1d9d020c9 100644 --- a/system-parachains/collectives/collectives-polkadot/Cargo.toml +++ b/system-parachains/collectives/collectives-polkadot/Cargo.toml @@ -24,7 +24,7 @@ frame-system-rpc-runtime-api = { default-features = false, version = "27.0.0" } frame-try-runtime = { default-features = false, optional = true, version = "0.35.0" } pallet-asset-rate = { default-features = false , version = "8.0.0" } pallet-alliance = { default-features = false, version = "28.0.0" } -pallet-aura = { default-features = false, version = "28.0.0" } +pallet-aura = { default-features = false, version = "28.0.0", features = ["experimental"] } pallet-authorship = { default-features = false, version = "29.0.0" } pallet-balances = { default-features = false, version = "29.0.0" } pallet-collective = { default-features = false, version = "29.0.0" } @@ -75,6 +75,7 @@ cumulus-pallet-parachain-system = { default-features = false, features = ["param cumulus-pallet-session-benchmarking = { default-features = false, version = "10.0.0" } cumulus-pallet-xcm = { default-features = false , version = "0.8.0" } cumulus-pallet-xcmp-queue = { default-features = false , version = "0.8.0" } +cumulus-primitives-aura = { default-features = false , version = "0.8.0" } cumulus-primitives-core = { default-features = false , version = "0.8.0" } cumulus-primitives-utility = { default-features = false , version = "0.8.1" } pallet-collator-selection = { default-features = false , version = "10.0.0" } @@ -168,6 +169,7 @@ std = [ "cumulus-pallet-session-benchmarking/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", "cumulus-primitives-core/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", @@ -229,8 +231,6 @@ std = [ "xcm/std", ] -experimental = [ "pallet-aura/experimental" ] - # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index 4931e773d4..b9a2ead3a9 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -42,7 +42,7 @@ pub mod xcm_config; // Fellowship configurations. pub mod fellowship; -use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use fellowship::{pallet_fellowship_origins, Fellows}; use impls::{AllianceProposalProvider, EqualOrGreatestRootCmp, ToParentTreasury}; @@ -375,16 +375,18 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; - type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, - >; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = ConsensusHook; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; } +type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + impl parachain_info::Config for Runtime {} parameter_types! { @@ -479,8 +481,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "experimental")] - type SlotDuration = pallet_aura::MinimumPeriodTimesTwo; + type SlotDuration = ConstU64; } parameter_types! { @@ -763,7 +764,7 @@ mod benches { impl_runtime_apis! { impl sp_consensus_aura::AuraApi for Runtime { fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) + sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) } fn authorities() -> Vec { @@ -771,6 +772,15 @@ impl_runtime_apis! { } } + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { + fn can_build_upon( + included_hash: ::Hash, + slot: cumulus_primitives_aura::Slot, + ) -> bool { + ConsensusHook::can_build_upon(included_hash, slot) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/system-parachains/encointer/Cargo.toml b/system-parachains/encointer/Cargo.toml index 65f9785d19..f658831959 100644 --- a/system-parachains/encointer/Cargo.toml +++ b/system-parachains/encointer/Cargo.toml @@ -53,7 +53,7 @@ frame-system-benchmarking = { default-features = false, optional = true, version frame-system-rpc-runtime-api = { default-features = false, version = "27.0.0" } frame-try-runtime = { default-features = false, optional = true, version = "0.35.0" } pallet-asset-tx-payment = { default-features = false, version = "29.0.0" } -pallet-aura = { default-features = false, version = "28.0.0" } +pallet-aura = { default-features = false, version = "28.0.0", features = ["experimental"] } pallet-balances = { default-features = false, version = "29.0.0" } pallet-collective = { default-features = false, version = "29.0.0" } pallet-insecure-randomness-collective-flip = { default-features = false, version = "17.0.0" } @@ -95,6 +95,7 @@ cumulus-pallet-parachain-system = { default-features = false, features = [ ], version = "0.8.1" } cumulus-pallet-xcm = { default-features = false, version = "0.8.0" } cumulus-pallet-xcmp-queue = { default-features = false, version = "0.8.0" } +cumulus-primitives-aura = { default-features = false, version = "0.8.0" } cumulus-primitives-core = { default-features = false, version = "0.8.0" } cumulus-primitives-utility = { default-features = false, version = "0.8.1" } parachain-info = { package = "staging-parachain-info", default-features = false, version = "0.8.0" } @@ -152,6 +153,7 @@ std = [ "cumulus-pallet-parachain-system/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", "cumulus-primitives-core/std", "cumulus-primitives-utility/std", "encointer-balances-tx-payment-rpc-runtime-api/std", @@ -243,8 +245,6 @@ try-runtime = [ "parachain-info/try-runtime", ] -experimental = ["pallet-aura/experimental"] - # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index e3c393b480..9abb68d443 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -58,7 +58,7 @@ use frame_support::{ parameter_types, traits::{ tokens::{pay::PayFromAccount, ConversionFromAssetBalance, ConversionToAssetBalance}, - ConstBool, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, + ConstBool, ConstU64, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, }, weights::{ConstantMultiplier, Weight}, PalletId, @@ -421,15 +421,17 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; - type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, - >; + type ConsensusHook = ConsensusHook; type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; } +type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + impl pallet_insecure_randomness_collective_flip::Config for Runtime {} impl parachain_info::Config for Runtime {} @@ -579,7 +581,6 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "experimental")] type SlotDuration = ConstU64; } @@ -769,6 +770,15 @@ impl_runtime_apis! { } } + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { + fn can_build_upon( + included_hash: ::Hash, + slot: cumulus_primitives_aura::Slot, + ) -> bool { + ConsensusHook::can_build_upon(included_hash, slot) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION