From 757ae372f7f07d9a7a4f62f646baa5e388ec5531 Mon Sep 17 00:00:00 2001 From: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Date: Mon, 22 Jan 2024 08:15:53 +0100 Subject: [PATCH 001/207] Switch All `construct_runtime`s to New Syntax (#2979) Clean up all the old syntax. --------- Co-authored-by: command-bot <> Co-authored-by: gupnik Co-authored-by: Nikhil Gupta <17176722+gupnik@users.noreply.github.com> Co-authored-by: Maksym H <1177472+mordamax@users.noreply.github.com> --- cumulus/parachain-template/runtime/src/lib.rs | 2 +- .../assets/asset-hub-rococo/src/lib.rs | 57 ++++---- .../assets/asset-hub-westend/src/lib.rs | 58 ++++---- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 72 +++++----- .../bridge-hubs/bridge-hub-westend/src/lib.rs | 46 +++--- .../collectives-westend/src/lib.rs | 72 +++++----- .../contracts/contracts-rococo/src/lib.rs | 42 +++--- .../glutton/glutton-westend/src/lib.rs | 22 ++- .../runtimes/people/people-rococo/src/lib.rs | 40 +++--- .../runtimes/people/people-westend/src/lib.rs | 40 +++--- .../runtimes/starters/seedling/src/lib.rs | 20 ++- .../runtimes/starters/shell/src/lib.rs | 18 ++- .../runtimes/testing/penpal/src/lib.rs | 40 +++--- .../testing/rococo-parachain/src/lib.rs | 32 ++--- docs/sdk/src/guides/your_first_pallet/mod.rs | 6 +- docs/sdk/src/polkadot_sdk/cumulus.rs | 2 +- docs/sdk/src/polkadot_sdk/frame_runtime.rs | 4 +- .../runtime/common/src/assigned_slots/mod.rs | 14 +- polkadot/runtime/common/src/auctions.rs | 6 +- polkadot/runtime/common/src/claims.rs | 8 +- polkadot/runtime/common/src/crowdloan/mod.rs | 6 +- polkadot/runtime/common/src/impls.rs | 8 +- .../runtime/common/src/integration_tests.rs | 26 ++-- .../runtime/common/src/paras_registrar/mod.rs | 14 +- polkadot/runtime/common/src/purchase.rs | 8 +- polkadot/runtime/common/src/slots/mod.rs | 6 +- polkadot/runtime/rococo/src/lib.rs | 132 +++++++++--------- polkadot/runtime/test-runtime/src/lib.rs | 70 +++++----- polkadot/runtime/westend/src/lib.rs | 120 ++++++++-------- .../src/fungible/mock.rs | 6 +- .../pallet-xcm-benchmarks/src/generic/mock.rs | 6 +- polkadot/xcm/pallet-xcm/src/mock.rs | 12 +- .../xcm/xcm-builder/src/tests/pay/mock.rs | 2 +- polkadot/xcm/xcm-builder/tests/mock/mod.rs | 8 +- .../xcm-simulator/example/src/parachain.rs | 10 +- .../xcm-simulator/example/src/relay_chain.rs | 12 +- .../xcm/xcm-simulator/fuzzer/src/parachain.rs | 8 +- .../xcm-simulator/fuzzer/src/relay_chain.rs | 10 +- substrate/bin/minimal/runtime/src/lib.rs | 2 +- .../bin/node-template/runtime/src/lib.rs | 2 +- substrate/bin/node/runtime/src/lib.rs | 11 +- substrate/frame/assets/src/mock.rs | 6 +- substrate/frame/atomic-swap/src/tests.rs | 6 +- substrate/frame/aura/src/mock.rs | 6 +- .../frame/authority-discovery/src/lib.rs | 6 +- substrate/frame/authorship/src/lib.rs | 4 +- substrate/frame/bags-list/src/mock.rs | 7 +- substrate/frame/balances/src/tests/mod.rs | 9 +- substrate/frame/beefy-mmr/src/mock.rs | 10 +- .../benchmarking/pov/src/benchmarking.rs | 4 +- substrate/frame/benchmarking/pov/src/tests.rs | 4 +- substrate/frame/benchmarking/src/baseline.rs | 2 +- substrate/frame/benchmarking/src/tests.rs | 4 +- .../frame/benchmarking/src/tests_instance.rs | 4 +- substrate/frame/bounties/src/tests.rs | 12 +- substrate/frame/child-bounties/src/tests.rs | 10 +- substrate/frame/collective/src/tests.rs | 11 +- .../contracts/mock-network/src/relay_chain.rs | 10 +- substrate/frame/contracts/src/tests.rs | 14 +- .../frame/conviction-voting/src/tests.rs | 6 +- substrate/frame/core-fellowship/src/tests.rs | 4 +- substrate/frame/democracy/src/tests.rs | 8 +- .../election-provider-multi-phase/src/mock.rs | 9 +- .../election-provider-support/src/onchain.rs | 5 +- substrate/frame/elections-phragmen/src/lib.rs | 7 +- substrate/frame/examples/basic/src/tests.rs | 6 +- .../frame/examples/default-config/src/lib.rs | 2 +- .../frame/examples/dev-mode/src/tests.rs | 6 +- .../frame/examples/frame-crate/src/lib.rs | 2 +- .../examples/offchain-worker/src/tests.rs | 4 +- substrate/frame/examples/tasks/src/mock.rs | 2 +- substrate/frame/executive/src/lib.rs | 11 +- substrate/frame/fast-unstake/src/mock.rs | 2 +- substrate/frame/glutton/src/mock.rs | 4 +- substrate/frame/identity/src/tests.rs | 6 +- substrate/frame/im-online/src/mock.rs | 11 +- substrate/frame/indices/src/mock.rs | 6 +- .../src/lib.rs | 4 +- substrate/frame/lottery/src/mock.rs | 6 +- substrate/frame/membership/src/lib.rs | 4 +- .../frame/merkle-mountain-range/src/mock.rs | 4 +- .../message-queue/src/integration_test.rs | 4 +- substrate/frame/message-queue/src/mock.rs | 4 +- substrate/frame/multisig/src/tests.rs | 6 +- substrate/frame/nfts/src/mock.rs | 6 +- .../frame/node-authorization/src/mock.rs | 6 +- .../nomination-pools/benchmarking/src/mock.rs | 15 +- substrate/frame/nomination-pools/src/mock.rs | 9 +- .../nomination-pools/test-staking/src/mock.rs | 15 +- .../frame/offences/benchmarking/src/mock.rs | 6 +- substrate/frame/offences/src/mock.rs | 7 +- substrate/frame/proxy/src/tests.rs | 8 +- .../frame/ranked-collective/src/tests.rs | 4 +- substrate/frame/recovery/src/mock.rs | 6 +- substrate/frame/remark/src/mock.rs | 4 +- substrate/frame/root-offences/src/mock.rs | 14 +- substrate/frame/salary/src/tests.rs | 4 +- substrate/frame/scheduler/src/mock.rs | 8 +- substrate/frame/scored-pool/src/mock.rs | 6 +- .../frame/session/benchmarking/src/mock.rs | 8 +- substrate/frame/session/src/mock.rs | 10 +- substrate/frame/society/src/mock.rs | 6 +- .../frame/state-trie-migration/src/lib.rs | 6 +- substrate/frame/sudo/src/mock.rs | 6 +- .../procedural/src/construct_runtime/mod.rs | 6 +- substrate/frame/support/src/lib.rs | 2 +- substrate/frame/support/src/migrations.rs | 6 +- .../support/test/compile_pass/src/lib.rs | 2 +- .../support/test/stg_frame_crate/src/lib.rs | 4 +- .../missing_system_module.stderr | 2 +- .../pass/composite_enum_instance.rs | 2 +- .../frame/support/test/tests/final_keys.rs | 1 - .../frame/support/test/tests/instance.rs | 27 ++-- .../frame/support/test/tests/issue2219.rs | 2 +- .../pallet_ui/pass/no_std_genesis_config.rs | 4 +- .../support/test/tests/storage_layers.rs | 2 +- .../support/test/tests/versioned_migration.rs | 4 +- substrate/frame/system/benches/bench.rs | 7 +- .../frame/system/benchmarking/src/mock.rs | 2 +- substrate/frame/system/src/mock.rs | 2 +- substrate/frame/timestamp/src/mock.rs | 4 +- substrate/frame/tips/src/tests.rs | 12 +- .../asset-tx-payment/src/mock.rs | 2 +- .../skip-feeless-payment/src/mock.rs | 2 +- .../frame/transaction-payment/src/mock.rs | 4 +- .../frame/transaction-storage/src/mock.rs | 8 +- substrate/frame/treasury/src/tests.rs | 6 +- substrate/frame/uniques/src/mock.rs | 6 +- substrate/frame/utility/src/tests.rs | 14 +- substrate/frame/vesting/src/mock.rs | 6 +- substrate/primitives/api/src/lib.rs | 4 +- .../api/test/tests/decl_and_impl.rs | 2 +- substrate/utils/frame/rpc/support/src/lib.rs | 4 +- 133 files changed, 795 insertions(+), 850 deletions(-) diff --git a/cumulus/parachain-template/runtime/src/lib.rs b/cumulus/parachain-template/runtime/src/lib.rs index 1ef018a8ca3..0ab36eba315 100644 --- a/cumulus/parachain-template/runtime/src/lib.rs +++ b/cumulus/parachain-template/runtime/src/lib.rs @@ -493,7 +493,7 @@ impl pallet_parachain_template::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub struct Runtime { + pub enum Runtime { // System support stuff. System: frame_system = 0, ParachainSystem: cumulus_pallet_parachain_system = 1, diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 0f379a6f7bc..a812e747f00 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -895,48 +895,45 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 3, + ParachainInfo: parachain_info = 4, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, - AssetTxPayment: pallet_asset_conversion_tx_payment::{Pallet, Event} = 13, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, + AssetTxPayment: pallet_asset_conversion_tx_payment = 13, // Collator support. the order of these 5 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 34, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + MessageQueue: pallet_message_queue = 34, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 40, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 42, + Utility: pallet_utility = 40, + Multisig: pallet_multisig = 41, + Proxy: pallet_proxy = 42, // Bridge utilities. - ToWestendXcmRouter: pallet_xcm_bridge_hub_router::::{Pallet, Storage, Call} = 45, + ToWestendXcmRouter: pallet_xcm_bridge_hub_router:: = 45, // The main stage. - Assets: pallet_assets::::{Pallet, Call, Storage, Event} = 50, - Uniques: pallet_uniques::{Pallet, Call, Storage, Event} = 51, - Nfts: pallet_nfts::{Pallet, Call, Storage, Event} = 52, - ForeignAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 53, - NftFractionalization: pallet_nft_fractionalization::{Pallet, Call, Storage, Event, HoldReason} = 54, - - PoolAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 55, - AssetConversion: pallet_asset_conversion::{Pallet, Call, Storage, Event} = 56, + Assets: pallet_assets:: = 50, + Uniques: pallet_uniques = 51, + Nfts: pallet_nfts = 52, + ForeignAssets: pallet_assets:: = 53, + NftFractionalization: pallet_nft_fractionalization = 54, + PoolAssets: pallet_assets:: = 55, + AssetConversion: pallet_asset_conversion = 56, #[cfg(feature = "state-trie-version-1")] StateTrieMigration: pallet_state_trie_migration = 70, diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 310726349fa..b4bcc716513 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -870,48 +870,46 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, // RandomnessCollectiveFlip = 2 removed - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + Timestamp: pallet_timestamp = 3, + ParachainInfo: parachain_info = 4, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, - // AssetTxPayment: pallet_asset_tx_payment::{Pallet, Event} = 12, - AssetTxPayment: pallet_asset_conversion_tx_payment::{Pallet, Event} = 13, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, + // AssetTxPayment: pallet_asset_tx_payment = 12, + AssetTxPayment: pallet_asset_conversion_tx_payment = 13, // Collator support. the order of these 5 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, // Bridge utilities. - ToRococoXcmRouter: pallet_xcm_bridge_hub_router::::{Pallet, Storage, Call} = 34, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 35, + ToRococoXcmRouter: pallet_xcm_bridge_hub_router:: = 34, + MessageQueue: pallet_message_queue = 35, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 40, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 42, + Utility: pallet_utility = 40, + Multisig: pallet_multisig = 41, + Proxy: pallet_proxy = 42, // The main stage. - Assets: pallet_assets::::{Pallet, Call, Storage, Event} = 50, - Uniques: pallet_uniques::{Pallet, Call, Storage, Event} = 51, - Nfts: pallet_nfts::{Pallet, Call, Storage, Event} = 52, - ForeignAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 53, - NftFractionalization: pallet_nft_fractionalization::{Pallet, Call, Storage, Event, HoldReason} = 54, - PoolAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 55, - AssetConversion: pallet_asset_conversion::{Pallet, Call, Storage, Event} = 56, + Assets: pallet_assets:: = 50, + Uniques: pallet_uniques = 51, + Nfts: pallet_nfts = 52, + ForeignAssets: pallet_assets:: = 53, + NftFractionalization: pallet_nft_fractionalization = 54, + PoolAssets: pallet_assets:: = 55, + AssetConversion: pallet_asset_conversion = 56, } ); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index f84ff0799b9..4a3ef8ac4e8 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -666,68 +666,66 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 2, + ParachainInfo: parachain_info = 3, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. The order of these 4 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 40, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 36, + Utility: pallet_utility = 40, + Multisig: pallet_multisig = 36, // Bridge relayers pallet, used by several bridges here. - BridgeRelayers: pallet_bridge_relayers::{Pallet, Call, Storage, Event} = 47, + BridgeRelayers: pallet_bridge_relayers = 47, // With-Westend GRANDPA bridge module. - BridgeWestendGrandpa: pallet_bridge_grandpa::::{Pallet, Call, Storage, Event, Config} = 48, + BridgeWestendGrandpa: pallet_bridge_grandpa:: = 48, // With-Westend parachain bridge module. - BridgeWestendParachains: pallet_bridge_parachains::::{Pallet, Call, Storage, Event} = 49, + BridgeWestendParachains: pallet_bridge_parachains:: = 49, // With-Westend messaging bridge module. - BridgeWestendMessages: pallet_bridge_messages::::{Pallet, Call, Storage, Event, Config} = 51, + BridgeWestendMessages: pallet_bridge_messages:: = 51, // With-Westend bridge hub pallet. - XcmOverBridgeHubWestend: pallet_xcm_bridge_hub::::{Pallet} = 52, + XcmOverBridgeHubWestend: pallet_xcm_bridge_hub:: = 52, // With-Rococo Bulletin GRANDPA bridge module. // - // we can't use `BridgeRococoBulletinGrandpa` name here, because the same Bulletin runtime will be - // used for both Rococo and Polkadot Bulletin chains AND this name affects runtime storage keys, used - // by the relayer process - BridgePolkadotBulletinGrandpa: pallet_bridge_grandpa::::{Pallet, Call, Storage, Event, Config} = 60, + // we can't use `BridgeRococoBulletinGrandpa` name here, because the same Bulletin runtime + // will be used for both Rococo and Polkadot Bulletin chains AND this name affects runtime + // storage keys, used by the relayer process. + BridgePolkadotBulletinGrandpa: pallet_bridge_grandpa:: = 60, // With-Rococo Bulletin messaging bridge module. // - // we can't use `BridgeRococoBulletinMessages` name here, because the same Bulletin runtime will be - // used for both Rococo and Polkadot Bulletin chains AND this name affects runtime storage keys, used - // by this runtime and the relayer process - BridgePolkadotBulletinMessages: pallet_bridge_messages::::{Pallet, Call, Storage, Event, Config} = 61, + // we can't use `BridgeRococoBulletinMessages` name here, because the same Bulletin runtime + // will be used for both Rococo and Polkadot Bulletin chains AND this name affects runtime + // storage keys, used by this runtime and the relayer process. + BridgePolkadotBulletinMessages: pallet_bridge_messages:: = 61, // With-Rococo Bulletin bridge hub pallet. - XcmOverPolkadotBulletin: pallet_xcm_bridge_hub::::{Pallet} = 62, + XcmOverPolkadotBulletin: pallet_xcm_bridge_hub:: = 62, - EthereumInboundQueue: snowbridge_pallet_inbound_queue::{Pallet, Call, Storage, Event} = 80, - EthereumOutboundQueue: snowbridge_pallet_outbound_queue::{Pallet, Call, Storage, Event} = 81, - EthereumBeaconClient: snowbridge_pallet_ethereum_client::{Pallet, Call, Storage, Event} = 82, - EthereumSystem: snowbridge_pallet_system::{Pallet, Call, Storage, Config, Event} = 83, + EthereumInboundQueue: snowbridge_pallet_inbound_queue = 80, + EthereumOutboundQueue: snowbridge_pallet_outbound_queue = 81, + EthereumBeaconClient: snowbridge_pallet_ethereum_client = 82, + EthereumSystem: snowbridge_pallet_system = 83, // Message Queue. Importantly, is registered last so that messages are processed after // the `on_initialize` hooks of bridging pallets. - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 250, + MessageQueue: pallet_message_queue = 250, } ); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs index e90b5668c03..08dd129d84b 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs @@ -460,43 +460,41 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 2, + ParachainInfo: parachain_info = 3, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. The order of these 4 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 40, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 36, + Utility: pallet_utility = 40, + Multisig: pallet_multisig = 36, // Bridging stuff. - BridgeRelayers: pallet_bridge_relayers::{Pallet, Call, Storage, Event} = 41, - BridgeRococoGrandpa: pallet_bridge_grandpa::::{Pallet, Call, Storage, Event, Config} = 42, - BridgeRococoParachains: pallet_bridge_parachains::::{Pallet, Call, Storage, Event} = 43, - BridgeRococoMessages: pallet_bridge_messages::::{Pallet, Call, Storage, Event, Config} = 44, - XcmOverBridgeHubRococo: pallet_xcm_bridge_hub::::{Pallet} = 45, + BridgeRelayers: pallet_bridge_relayers = 41, + BridgeRococoGrandpa: pallet_bridge_grandpa:: = 42, + BridgeRococoParachains: pallet_bridge_parachains:: = 43, + BridgeRococoMessages: pallet_bridge_messages:: = 44, + XcmOverBridgeHubRococo: pallet_xcm_bridge_hub:: = 45, // Message Queue. Importantly, is registered last so that messages are processed after // the `on_initialize` hooks of bridging pallets. - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 250, + MessageQueue: pallet_message_queue = 250, } ); diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index 3aff4671636..be7beafc89a 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -635,64 +635,62 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 2, + ParachainInfo: parachain_info = 3, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. the order of these 5 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 34, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + MessageQueue: pallet_message_queue = 34, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 40, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 42, - Preimage: pallet_preimage::{Pallet, Call, Storage, Event, HoldReason} = 43, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 44, - AssetRate: pallet_asset_rate::{Pallet, Call, Storage, Event} = 45, + Utility: pallet_utility = 40, + Multisig: pallet_multisig = 41, + Proxy: pallet_proxy = 42, + Preimage: pallet_preimage = 43, + Scheduler: pallet_scheduler = 44, + AssetRate: pallet_asset_rate = 45, // The main stage. // The Alliance. - Alliance: pallet_alliance::{Pallet, Call, Storage, Event, Config} = 50, - AllianceMotion: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 51, + Alliance: pallet_alliance = 50, + AllianceMotion: pallet_collective:: = 51, // The Fellowship. // pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; - FellowshipCollective: pallet_ranked_collective::::{Pallet, Call, Storage, Event} = 60, + FellowshipCollective: pallet_ranked_collective:: = 60, // pub type FellowshipReferendaInstance = pallet_referenda::Instance1; - FellowshipReferenda: pallet_referenda::::{Pallet, Call, Storage, Event} = 61, - FellowshipOrigins: pallet_fellowship_origins::{Origin} = 62, + FellowshipReferenda: pallet_referenda:: = 61, + FellowshipOrigins: pallet_fellowship_origins = 62, // pub type FellowshipCoreInstance = pallet_core_fellowship::Instance1; - FellowshipCore: pallet_core_fellowship::::{Pallet, Call, Storage, Event} = 63, + FellowshipCore: pallet_core_fellowship:: = 63, // pub type FellowshipSalaryInstance = pallet_salary::Instance1; - FellowshipSalary: pallet_salary::::{Pallet, Call, Storage, Event} = 64, + FellowshipSalary: pallet_salary:: = 64, // pub type FellowshipTreasuryInstance = pallet_treasury::Instance1; - FellowshipTreasury: pallet_treasury::::{Pallet, Call, Storage, Event} = 65, + FellowshipTreasury: pallet_treasury:: = 65, // Ambassador Program. - AmbassadorCollective: pallet_ranked_collective::::{Pallet, Call, Storage, Event} = 70, - AmbassadorReferenda: pallet_referenda::::{Pallet, Call, Storage, Event} = 71, - AmbassadorOrigins: pallet_ambassador_origins::{Origin} = 72, - AmbassadorCore: pallet_core_fellowship::::{Pallet, Call, Storage, Event} = 73, - AmbassadorSalary: pallet_salary::::{Pallet, Call, Storage, Event} = 74, - AmbassadorContent: pallet_collective_content::::{Pallet, Call, Storage, Event} = 75, + AmbassadorCollective: pallet_ranked_collective:: = 70, + AmbassadorReferenda: pallet_referenda:: = 71, + AmbassadorOrigins: pallet_ambassador_origins = 72, + AmbassadorCore: pallet_core_fellowship:: = 73, + AmbassadorSalary: pallet_salary:: = 74, + AmbassadorContent: pallet_collective_content:: = 75, } ); diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 707766ca226..f1c5acb4952 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -376,40 +376,38 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage} = 2, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip = 2, + Timestamp: pallet_timestamp = 3, + ParachainInfo: parachain_info = 4, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. The order of these 5 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 34, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + MessageQueue: pallet_message_queue = 34, // Smart Contracts. - Contracts: pallet_contracts::{Pallet, Call, Storage, Event, HoldReason} = 40, + Contracts: pallet_contracts = 40, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 50, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 51, + Utility: pallet_utility = 50, + Multisig: pallet_multisig = 51, // Sudo - Sudo: pallet_sudo::{Pallet, Call, Config, Event, Storage} = 100, + Sudo: pallet_sudo = 100, } ); diff --git a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs index 15899e49195..9fbbdc61fea 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs @@ -274,26 +274,24 @@ impl pallet_sudo::Config for Runtime { construct_runtime! { pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 2, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + ParachainInfo: parachain_info = 2, + Timestamp: pallet_timestamp = 3, // DMP handler. - CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Storage, Event, Origin} = 10, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 11, + CumulusXcm: cumulus_pallet_xcm = 10, + MessageQueue: pallet_message_queue = 11, // The main stage. - Glutton: pallet_glutton::{Pallet, Call, Storage, Event, Config} = 20, + Glutton: pallet_glutton = 20, // Collator support - Aura: pallet_aura::{Pallet, Storage, Config} = 30, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 31, + Aura: pallet_aura = 30, + AuraExt: cumulus_pallet_aura_ext = 31, // Sudo. - Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config} = 255, + Sudo: pallet_sudo = 255, } } diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs index 21c24086cbe..7836208eb62 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs @@ -400,39 +400,37 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 2, + ParachainInfo: parachain_info = 3, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. The order of these 5 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM & related - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 34, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + MessageQueue: pallet_message_queue = 34, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 40, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, + Utility: pallet_utility = 40, + Multisig: pallet_multisig = 41, // The main stage. - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 50, + Identity: pallet_identity = 50, // To migrate deposits - IdentityMigrator: identity_migrator::{Pallet, Call, Event} = 248, + IdentityMigrator: identity_migrator = 248, } ); diff --git a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs index 4015d841b81..750bf5b2c3e 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs @@ -408,39 +408,37 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 2, + ParachainInfo: parachain_info = 3, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, // Collator support. The order of these 5 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 34, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + MessageQueue: pallet_message_queue = 34, // Handy utilities. - Utility: pallet_utility::{Pallet, Call, Event} = 40, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, + Utility: pallet_utility = 40, + Multisig: pallet_multisig = 41, // The main stage. - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 50, + Identity: pallet_identity = 50, // To migrate deposits - IdentityMigrator: identity_migrator::{Pallet, Call, Event} = 248, + IdentityMigrator: identity_migrator = 248, } ); diff --git a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs index cb868627e79..ba077ef8879 100644 --- a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs @@ -230,17 +230,15 @@ impl pallet_timestamp::Config for Runtime { construct_runtime! { pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - }, - ParachainInfo: parachain_info::{Pallet, Storage, Config}, - SoloToPara: cumulus_pallet_solo_to_para::{Pallet, Call, Storage, Event}, - Aura: pallet_aura::{Pallet, Storage, Config}, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config}, + System: frame_system, + Sudo: pallet_sudo, + Timestamp: pallet_timestamp, + + ParachainSystem: cumulus_pallet_parachain_system, + ParachainInfo: parachain_info, + SoloToPara: cumulus_pallet_solo_to_para, + Aura: pallet_aura, + AuraExt: cumulus_pallet_aura_ext, } } diff --git a/cumulus/parachains/runtimes/starters/shell/src/lib.rs b/cumulus/parachains/runtimes/starters/shell/src/lib.rs index de95969f71d..457394760d9 100644 --- a/cumulus/parachains/runtimes/starters/shell/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/shell/src/lib.rs @@ -258,19 +258,17 @@ impl pallet_timestamp::Config for Runtime { construct_runtime! { pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - }, - ParachainInfo: parachain_info::{Pallet, Storage, Config}, + ParachainSystem: cumulus_pallet_parachain_system, + ParachainInfo: parachain_info, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Storage, Event, Origin}, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, + CumulusXcm: cumulus_pallet_xcm, + MessageQueue: pallet_message_queue, - Aura: pallet_aura::{Pallet, Storage, Config}, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config}, + Aura: pallet_aura, + AuraExt: cumulus_pallet_aura_ext, } } diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index 37a8454d62a..d33f51df5a9 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -634,36 +634,34 @@ construct_runtime!( pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system = 1, + Timestamp: pallet_timestamp = 2, + ParachainInfo: parachain_info = 3, // Monetary stuff. - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, - AssetTxPayment: pallet_asset_tx_payment::{Pallet, Event} = 12, + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, + AssetTxPayment: pallet_asset_tx_payment = 12, // Collator support. The order of these 4 are important and shall not change. - Authorship: pallet_authorship::{Pallet, Storage} = 20, - CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, - Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + Authorship: pallet_authorship = 20, + CollatorSelection: pallet_collator_selection = 21, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 34, + XcmpQueue: cumulus_pallet_xcmp_queue = 30, + PolkadotXcm: pallet_xcm = 31, + CumulusXcm: cumulus_pallet_xcm = 32, + MessageQueue: pallet_message_queue = 34, // The main stage. - Assets: pallet_assets::::{Pallet, Call, Storage, Event} = 50, - ForeignAssets: pallet_assets::::{Pallet, Call, Storage, Event} = 51, + Assets: pallet_assets:: = 50, + ForeignAssets: pallet_assets:: = 51, - Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config} = 255, + Sudo: pallet_sudo = 255, } ); diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 795efa39247..999cc480ce0 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -603,30 +603,28 @@ impl pallet_aura::Config for Runtime { construct_runtime! { pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, + System: frame_system, + Timestamp: pallet_timestamp, + Sudo: pallet_sudo, + TransactionPayment: pallet_transaction_payment, - ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, - } = 20, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, + ParachainSystem: cumulus_pallet_parachain_system = 20, + ParachainInfo: parachain_info = 21, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, - Assets: pallet_assets::{Pallet, Call, Storage, Event} = 31, + Balances: pallet_balances = 30, + Assets: pallet_assets = 31, - Aura: pallet_aura::{Pallet, Config}, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Config}, + Aura: pallet_aura, + AuraExt: cumulus_pallet_aura_ext, // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 51, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 52, + XcmpQueue: cumulus_pallet_xcmp_queue = 50, + PolkadotXcm: pallet_xcm = 51, + CumulusXcm: cumulus_pallet_xcm = 52, // RIP DmpQueue 53 - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 54, + MessageQueue: pallet_message_queue = 54, - Spambot: cumulus_ping::{Pallet, Call, Storage, Event} = 99, + Spambot: cumulus_ping = 99, } } diff --git a/docs/sdk/src/guides/your_first_pallet/mod.rs b/docs/sdk/src/guides/your_first_pallet/mod.rs index 24eada44a83..ea23af51ec9 100644 --- a/docs/sdk/src/guides/your_first_pallet/mod.rs +++ b/docs/sdk/src/guides/your_first_pallet/mod.rs @@ -428,8 +428,8 @@ pub mod pallet { use crate::guides::your_first_pallet::pallet as pallet_currency; construct_runtime!( - pub struct Runtime { - // ---^^^^^^ This is where `struct Runtime` is defined. + pub enum Runtime { + // ---^^^^^^ This is where `enum Runtime` is defined. System: frame_system, Currency: pallet_currency, } @@ -708,7 +708,7 @@ pub mod pallet_v2 { use crate::guides::your_first_pallet::pallet_v2 as pallet_currency; construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Currency: pallet_currency, } diff --git a/docs/sdk/src/polkadot_sdk/cumulus.rs b/docs/sdk/src/polkadot_sdk/cumulus.rs index 07a48c92d80..60c4839f9e2 100644 --- a/docs/sdk/src/polkadot_sdk/cumulus.rs +++ b/docs/sdk/src/polkadot_sdk/cumulus.rs @@ -55,7 +55,7 @@ mod tests { #[docify::export(CR)] construct_runtime!( - pub struct Runtime { + pub enum Runtime { // system-level pallets. System: frame_system, Timestamp: pallet_timestamp, diff --git a/docs/sdk/src/polkadot_sdk/frame_runtime.rs b/docs/sdk/src/polkadot_sdk/frame_runtime.rs index 32dc2045e3a..c9eba7d64bd 100644 --- a/docs/sdk/src/polkadot_sdk/frame_runtime.rs +++ b/docs/sdk/src/polkadot_sdk/frame_runtime.rs @@ -156,9 +156,9 @@ mod tests { use super::pallet as pallet_example; use frame::{prelude::*, testing_prelude::*}; - // The major macro that amalgamates pallets into `struct Runtime` + // The major macro that amalgamates pallets into `enum Runtime` construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Example: pallet_example, } diff --git a/polkadot/runtime/common/src/assigned_slots/mod.rs b/polkadot/runtime/common/src/assigned_slots/mod.rs index de8c00df9dd..9976a7be548 100644 --- a/polkadot/runtime/common/src/assigned_slots/mod.rs +++ b/polkadot/runtime/common/src/assigned_slots/mod.rs @@ -658,13 +658,13 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Configuration: parachains_configuration::{Pallet, Call, Storage, Config}, - ParasShared: parachains_shared::{Pallet, Call, Storage}, - Parachains: parachains_paras::{Pallet, Call, Storage, Config, Event}, - Slots: slots::{Pallet, Call, Storage, Event}, - AssignedSlots: assigned_slots::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Configuration: parachains_configuration, + ParasShared: parachains_shared, + Parachains: parachains_paras, + Slots: slots, + AssignedSlots: assigned_slots, } ); diff --git a/polkadot/runtime/common/src/auctions.rs b/polkadot/runtime/common/src/auctions.rs index baa66d83a3f..0bd5ed1e733 100644 --- a/polkadot/runtime/common/src/auctions.rs +++ b/polkadot/runtime/common/src/auctions.rs @@ -697,9 +697,9 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Auctions: auctions::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Auctions: auctions, } ); diff --git a/polkadot/runtime/common/src/claims.rs b/polkadot/runtime/common/src/claims.rs index 4cddab969c0..5b87cc9619e 100644 --- a/polkadot/runtime/common/src/claims.rs +++ b/polkadot/runtime/common/src/claims.rs @@ -727,10 +727,10 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Vesting: pallet_vesting::{Pallet, Call, Storage, Config, Event}, - Claims: claims::{Pallet, Call, Storage, Config, Event, ValidateUnsigned}, + System: frame_system, + Balances: pallet_balances, + Vesting: pallet_vesting, + Claims: claims, } ); diff --git a/polkadot/runtime/common/src/crowdloan/mod.rs b/polkadot/runtime/common/src/crowdloan/mod.rs index 77ef406e579..b7dd06aee3a 100644 --- a/polkadot/runtime/common/src/crowdloan/mod.rs +++ b/polkadot/runtime/common/src/crowdloan/mod.rs @@ -888,9 +888,9 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Crowdloan: crowdloan::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Crowdloan: crowdloan, } ); diff --git a/polkadot/runtime/common/src/impls.rs b/polkadot/runtime/common/src/impls.rs index a9edb196627..79ace0972ad 100644 --- a/polkadot/runtime/common/src/impls.rs +++ b/polkadot/runtime/common/src/impls.rs @@ -242,10 +242,10 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Authorship: pallet_authorship::{Pallet, Storage}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Authorship: pallet_authorship, + Balances: pallet_balances, + Treasury: pallet_treasury, } ); diff --git a/polkadot/runtime/common/src/integration_tests.rs b/polkadot/runtime/common/src/integration_tests.rs index b536b80e245..2bf21bbde95 100644 --- a/polkadot/runtime/common/src/integration_tests.rs +++ b/polkadot/runtime/common/src/integration_tests.rs @@ -74,25 +74,25 @@ frame_support::construct_runtime!( pub enum Test { // System Stuff - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned}, + System: frame_system, + Balances: pallet_balances, + Babe: pallet_babe, // Parachains Runtime - Configuration: configuration::{Pallet, Call, Storage, Config}, - Paras: paras::{Pallet, Call, Storage, Event, Config}, - ParasShared: shared::{Pallet, Call, Storage}, - ParachainsOrigin: origin::{Pallet, Origin}, + Configuration: configuration, + Paras: paras, + ParasShared: shared, + ParachainsOrigin: origin, // Para Onboarding Pallets - Registrar: paras_registrar::{Pallet, Call, Storage, Event}, - Auctions: auctions::{Pallet, Call, Storage, Event}, - Crowdloan: crowdloan::{Pallet, Call, Storage, Event}, - Slots: slots::{Pallet, Call, Storage, Event}, + Registrar: paras_registrar, + Auctions: auctions, + Crowdloan: crowdloan, + Slots: slots, // Migrators - Identity: pallet_identity::{Pallet, Call, Storage, Event}, - IdentityMigrator: identity_migrator::{Pallet, Call, Event}, + Identity: pallet_identity, + IdentityMigrator: identity_migrator, } ); diff --git a/polkadot/runtime/common/src/paras_registrar/mod.rs b/polkadot/runtime/common/src/paras_registrar/mod.rs index 448490b34a7..a3bdc1b1b0f 100644 --- a/polkadot/runtime/common/src/paras_registrar/mod.rs +++ b/polkadot/runtime/common/src/paras_registrar/mod.rs @@ -724,13 +724,13 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Configuration: configuration::{Pallet, Call, Storage, Config}, - Parachains: paras::{Pallet, Call, Storage, Config, Event}, - ParasShared: shared::{Pallet, Call, Storage}, - Registrar: paras_registrar::{Pallet, Call, Storage, Event}, - ParachainsOrigin: origin::{Pallet, Origin}, + System: frame_system, + Balances: pallet_balances, + Configuration: configuration, + Parachains: paras, + ParasShared: shared, + Registrar: paras_registrar, + ParachainsOrigin: origin, } ); diff --git a/polkadot/runtime/common/src/purchase.rs b/polkadot/runtime/common/src/purchase.rs index f43f16b838c..146a90fca86 100644 --- a/polkadot/runtime/common/src/purchase.rs +++ b/polkadot/runtime/common/src/purchase.rs @@ -499,10 +499,10 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Vesting: pallet_vesting::{Pallet, Call, Storage, Config, Event}, - Purchase: purchase::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Vesting: pallet_vesting, + Purchase: purchase, } ); diff --git a/polkadot/runtime/common/src/slots/mod.rs b/polkadot/runtime/common/src/slots/mod.rs index 58bd1d53aed..be02aa9961c 100644 --- a/polkadot/runtime/common/src/slots/mod.rs +++ b/polkadot/runtime/common/src/slots/mod.rs @@ -520,9 +520,9 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Slots: slots::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Slots: slots, } ); diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 51c00336bef..2d49f0b99e9 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -1315,135 +1315,131 @@ construct_runtime! { pub enum Runtime { // Basic stuff; balances is uncallable initially. - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, + System: frame_system = 0, // Babe must be before session. - Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned} = 1, + Babe: pallet_babe = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event} = 3, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 4, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 33, + Timestamp: pallet_timestamp = 2, + Indices: pallet_indices = 3, + Balances: pallet_balances = 4, + TransactionPayment: pallet_transaction_payment = 33, // Consensus support. // Authorship must be before session in order to note author in the correct session and era. - Authorship: pallet_authorship::{Pallet, Storage} = 5, - Offences: pallet_offences::{Pallet, Storage, Event} = 7, - Historical: session_historical::{Pallet} = 34, + Authorship: pallet_authorship = 5, + Offences: pallet_offences = 7, + Historical: session_historical = 34, // BEEFY Bridges support. - Beefy: pallet_beefy::{Pallet, Call, Storage, Config, ValidateUnsigned} = 240, + Beefy: pallet_beefy = 240, // MMR leaf construction must be before session in order to have leaf contents // refer to block consistently. see substrate issue #11797 for details. - Mmr: pallet_mmr::{Pallet, Storage} = 241, - MmrLeaf: pallet_beefy_mmr::{Pallet, Storage} = 242, + Mmr: pallet_mmr = 241, + MmrLeaf: pallet_beefy_mmr = 242, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 8, - Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event, ValidateUnsigned} = 10, - AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config} = 12, + Session: pallet_session = 8, + Grandpa: pallet_grandpa = 10, + AuthorityDiscovery: pallet_authority_discovery = 12, // Governance stuff; uncallable initially. - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 18, - ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event} = 20, - Referenda: pallet_referenda::{Pallet, Call, Storage, Event} = 21, + Treasury: pallet_treasury = 18, + ConvictionVoting: pallet_conviction_voting = 20, + Referenda: pallet_referenda = 21, // pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; - FellowshipCollective: pallet_ranked_collective::::{ - Pallet, Call, Storage, Event - } = 22, + FellowshipCollective: pallet_ranked_collective:: = 22, // pub type FellowshipReferendaInstance = pallet_referenda::Instance2; - FellowshipReferenda: pallet_referenda::::{ - Pallet, Call, Storage, Event - } = 23, - Origins: pallet_custom_origins::{Origin} = 43, - Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event} = 44, + FellowshipReferenda: pallet_referenda:: = 23, + Origins: pallet_custom_origins = 43, + Whitelist: pallet_whitelist = 44, // Claims. Usable initially. - Claims: claims::{Pallet, Call, Storage, Event, Config, ValidateUnsigned} = 19, + Claims: claims = 19, // Utility module. - Utility: pallet_utility::{Pallet, Call, Event} = 24, + Utility: pallet_utility = 24, // Less simple identity module. - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 25, + Identity: pallet_identity = 25, // Society module. - Society: pallet_society::{Pallet, Call, Storage, Event} = 26, + Society: pallet_society = 26, // Social recovery module. - Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 27, + Recovery: pallet_recovery = 27, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 28, + Vesting: pallet_vesting = 28, // System scheduler. - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 29, + Scheduler: pallet_scheduler = 29, // Proxy module. Late addition. - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 30, + Proxy: pallet_proxy = 30, // Multisig module. Late addition. - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 31, + Multisig: pallet_multisig = 31, // Preimage registrar. - Preimage: pallet_preimage::{Pallet, Call, Storage, Event, HoldReason} = 32, + Preimage: pallet_preimage = 32, // Asset rate. - AssetRate: pallet_asset_rate::{Pallet, Call, Storage, Event} = 39, + AssetRate: pallet_asset_rate = 39, // Bounties modules. - Bounties: pallet_bounties::{Pallet, Call, Storage, Event} = 35, + Bounties: pallet_bounties = 35, ChildBounties: pallet_child_bounties = 40, // NIS pallet. - Nis: pallet_nis::{Pallet, Call, Storage, Event, HoldReason} = 38, + Nis: pallet_nis = 38, // pub type NisCounterpartInstance = pallet_balances::Instance2; NisCounterpartBalances: pallet_balances:: = 45, // Parachains pallets. Start indices at 50 to leave room. - ParachainsOrigin: parachains_origin::{Pallet, Origin} = 50, - Configuration: parachains_configuration::{Pallet, Call, Storage, Config} = 51, - ParasShared: parachains_shared::{Pallet, Call, Storage} = 52, - ParaInclusion: parachains_inclusion::{Pallet, Call, Storage, Event} = 53, - ParaInherent: parachains_paras_inherent::{Pallet, Call, Storage, Inherent} = 54, - ParaScheduler: parachains_scheduler::{Pallet, Storage} = 55, - Paras: parachains_paras::{Pallet, Call, Storage, Event, Config, ValidateUnsigned} = 56, - Initializer: parachains_initializer::{Pallet, Call, Storage} = 57, - Dmp: parachains_dmp::{Pallet, Storage} = 58, - Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event, Config} = 60, - ParaSessionInfo: parachains_session_info::{Pallet, Storage} = 61, - ParasDisputes: parachains_disputes::{Pallet, Call, Storage, Event} = 62, - ParasSlashing: parachains_slashing::{Pallet, Call, Storage, ValidateUnsigned} = 63, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 64, - OnDemandAssignmentProvider: parachains_assigner_on_demand::{Pallet, Call, Storage, Event} = 66, - ParachainsAssignmentProvider: parachains_assigner_parachains::{Pallet} = 67, - CoretimeAssignmentProvider: parachains_assigner_coretime::{Pallet, Storage} = 68, + ParachainsOrigin: parachains_origin = 50, + Configuration: parachains_configuration = 51, + ParasShared: parachains_shared = 52, + ParaInclusion: parachains_inclusion = 53, + ParaInherent: parachains_paras_inherent = 54, + ParaScheduler: parachains_scheduler = 55, + Paras: parachains_paras = 56, + Initializer: parachains_initializer = 57, + Dmp: parachains_dmp = 58, + Hrmp: parachains_hrmp = 60, + ParaSessionInfo: parachains_session_info = 61, + ParasDisputes: parachains_disputes = 62, + ParasSlashing: parachains_slashing = 63, + MessageQueue: pallet_message_queue = 64, + OnDemandAssignmentProvider: parachains_assigner_on_demand = 66, + ParachainsAssignmentProvider: parachains_assigner_parachains = 67, + CoretimeAssignmentProvider: parachains_assigner_coretime = 68, // Parachain Onboarding Pallets. Start indices at 70 to leave room. - Registrar: paras_registrar::{Pallet, Call, Storage, Event, Config} = 70, - Slots: slots::{Pallet, Call, Storage, Event} = 71, - Auctions: auctions::{Pallet, Call, Storage, Event} = 72, - Crowdloan: crowdloan::{Pallet, Call, Storage, Event} = 73, - Coretime: coretime::{Pallet, Call, Event} = 74, + Registrar: paras_registrar = 70, + Slots: slots = 71, + Auctions: auctions = 72, + Crowdloan: crowdloan = 73, + Coretime: coretime = 74, // Pallet for sending XCM. - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 99, + XcmPallet: pallet_xcm = 99, // Pallet for migrating Identity to a parachain. To be removed post-migration. - IdentityMigrator: identity_migrator::{Pallet, Call, Event} = 248, + IdentityMigrator: identity_migrator = 248, - ParasSudoWrapper: paras_sudo_wrapper::{Pallet, Call} = 250, - AssignedSlots: assigned_slots::{Pallet, Call, Storage, Event, Config} = 251, + ParasSudoWrapper: paras_sudo_wrapper = 250, + AssignedSlots: assigned_slots = 251, // Validator Manager pallet. - ValidatorManager: validator_manager::{Pallet, Call, Storage, Event} = 252, + ValidatorManager: validator_manager = 252, // State trie migration pallet, only temporary. StateTrieMigration: pallet_state_trie_migration = 254, // Root testing pallet. - RootTesting: pallet_root_testing::{Pallet, Call, Storage, Event} = 249, + RootTesting: pallet_root_testing = 249, // Sudo. - Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config} = 255, + Sudo: pallet_sudo = 255, } } diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 18bcb16834e..51c199b7a05 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -670,52 +670,52 @@ construct_runtime! { pub enum Runtime { // Basic stuff; balances is uncallable initially. - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system, // Must be before session. - Babe: pallet_babe::{Pallet, Call, Storage, Config}, + Babe: pallet_babe, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, + Timestamp: pallet_timestamp, + Indices: pallet_indices, + Balances: pallet_balances, + TransactionPayment: pallet_transaction_payment, // Consensus support. - Authorship: pallet_authorship::{Pallet, Storage}, - Staking: pallet_staking::{Pallet, Call, Storage, Config, Event}, - Offences: pallet_offences::{Pallet, Storage, Event}, - Historical: session_historical::{Pallet}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event}, - AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config}, + Authorship: pallet_authorship, + Staking: pallet_staking, + Offences: pallet_offences, + Historical: session_historical, + Session: pallet_session, + Grandpa: pallet_grandpa, + AuthorityDiscovery: pallet_authority_discovery, // Claims. Usable initially. - Claims: claims::{Pallet, Call, Storage, Event, Config, ValidateUnsigned}, + Claims: claims, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config}, + Vesting: pallet_vesting, // Parachains runtime modules - Configuration: parachains_configuration::{Pallet, Call, Storage, Config}, - ParaInclusion: parachains_inclusion::{Pallet, Call, Storage, Event}, - ParaInherent: parachains_paras_inherent::{Pallet, Call, Storage, Inherent}, - Initializer: parachains_initializer::{Pallet, Call, Storage}, - Paras: parachains_paras::{Pallet, Call, Storage, Event, ValidateUnsigned}, - ParasShared: parachains_shared::{Pallet, Call, Storage}, - Scheduler: parachains_scheduler::{Pallet, Storage}, - ParasSudoWrapper: paras_sudo_wrapper::{Pallet, Call}, - ParasOrigin: parachains_origin::{Pallet, Origin}, - ParaSessionInfo: parachains_session_info::{Pallet, Storage}, - Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event}, - Dmp: parachains_dmp::{Pallet, Storage}, - Xcm: pallet_xcm::{Pallet, Call, Event, Origin}, - ParasDisputes: parachains_disputes::{Pallet, Storage, Event}, - ParasSlashing: parachains_slashing::{Pallet, Call, Storage, ValidateUnsigned}, - ParaAssignmentProvider: parachains_assigner_parachains::{Pallet}, - - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event}, - - TestNotifier: pallet_test_notifier::{Pallet, Call, Event}, + Configuration: parachains_configuration, + ParaInclusion: parachains_inclusion, + ParaInherent: parachains_paras_inherent, + Initializer: parachains_initializer, + Paras: parachains_paras, + ParasShared: parachains_shared, + Scheduler: parachains_scheduler, + ParasSudoWrapper: paras_sudo_wrapper, + ParasOrigin: parachains_origin, + ParaSessionInfo: parachains_session_info, + Hrmp: parachains_hrmp, + Dmp: parachains_dmp, + Xcm: pallet_xcm, + ParasDisputes: parachains_disputes, + ParasSlashing: parachains_slashing, + ParaAssignmentProvider: parachains_assigner_parachains, + + Sudo: pallet_sudo, + + TestNotifier: pallet_test_notifier, } } diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 941193ba941..adfb2083254 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -1397,121 +1397,121 @@ construct_runtime! { pub enum Runtime { // Basic stuff; balances is uncallable initially. - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, + System: frame_system = 0, // Babe must be before session. - Babe: pallet_babe::{Pallet, Call, Storage, Config, ValidateUnsigned} = 1, + Babe: pallet_babe = 1, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event} = 3, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 4, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 26, + Timestamp: pallet_timestamp = 2, + Indices: pallet_indices = 3, + Balances: pallet_balances = 4, + TransactionPayment: pallet_transaction_payment = 26, // Consensus support. // Authorship must be before session in order to note author in the correct session and era. - Authorship: pallet_authorship::{Pallet, Storage} = 5, - Staking: pallet_staking::{Pallet, Call, Storage, Config, Event} = 6, - Offences: pallet_offences::{Pallet, Storage, Event} = 7, - Historical: session_historical::{Pallet} = 27, + Authorship: pallet_authorship = 5, + Staking: pallet_staking = 6, + Offences: pallet_offences = 7, + Historical: session_historical = 27, // BEEFY Bridges support. - Beefy: pallet_beefy::{Pallet, Call, Storage, Config, ValidateUnsigned} = 200, - // MMR leaf construction must be before session in order to have leaf contents - // refer to block consistently. see substrate issue #11797 for details. - Mmr: pallet_mmr::{Pallet, Storage} = 201, - BeefyMmrLeaf: pallet_beefy_mmr::{Pallet, Storage} = 202, + Beefy: pallet_beefy = 200, + // MMR leaf construction must be before session in order to have leaf contents refer to + // block consistently. see substrate issue #11797 for details. + Mmr: pallet_mmr = 201, + BeefyMmrLeaf: pallet_beefy_mmr = 202, - Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 8, - Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event, ValidateUnsigned} = 10, - AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config} = 12, + Session: pallet_session = 8, + Grandpa: pallet_grandpa = 10, + AuthorityDiscovery: pallet_authority_discovery = 12, // Utility module. - Utility: pallet_utility::{Pallet, Call, Event} = 16, + Utility: pallet_utility = 16, // Less simple identity module. - Identity: pallet_identity::{Pallet, Call, Storage, Event} = 17, + Identity: pallet_identity = 17, // Social recovery module. - Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 18, + Recovery: pallet_recovery = 18, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 19, + Vesting: pallet_vesting = 19, // System scheduler. - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 20, + Scheduler: pallet_scheduler = 20, // Preimage registrar. - Preimage: pallet_preimage::{Pallet, Call, Storage, Event, HoldReason} = 28, + Preimage: pallet_preimage = 28, // Sudo. - Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config} = 21, + Sudo: pallet_sudo = 21, // Proxy module. Late addition. - Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 22, + Proxy: pallet_proxy = 22, // Multisig module. Late addition. - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 23, + Multisig: pallet_multisig = 23, // Election pallet. Only works with staking, but placed here to maintain indices. - ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event, ValidateUnsigned} = 24, + ElectionProviderMultiPhase: pallet_election_provider_multi_phase = 24, // Provides a semi-sorted list of nominators for staking. - VoterList: pallet_bags_list::::{Pallet, Call, Storage, Event} = 25, + VoterList: pallet_bags_list:: = 25, // Nomination pools for staking. - NominationPools: pallet_nomination_pools::{Pallet, Call, Storage, Event, Config, FreezeReason} = 29, + NominationPools: pallet_nomination_pools = 29, // Fast unstake pallet: extension to staking. FastUnstake: pallet_fast_unstake = 30, // OpenGov - ConvictionVoting: pallet_conviction_voting::{Pallet, Call, Storage, Event} = 31, - Referenda: pallet_referenda::{Pallet, Call, Storage, Event} = 32, - Origins: pallet_custom_origins::{Origin} = 35, - Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event} = 36, + ConvictionVoting: pallet_conviction_voting = 31, + Referenda: pallet_referenda = 32, + Origins: pallet_custom_origins = 35, + Whitelist: pallet_whitelist = 36, // Treasury - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 37, + Treasury: pallet_treasury = 37, // Parachains pallets. Start indices at 40 to leave room. - ParachainsOrigin: parachains_origin::{Pallet, Origin} = 41, - Configuration: parachains_configuration::{Pallet, Call, Storage, Config} = 42, - ParasShared: parachains_shared::{Pallet, Call, Storage} = 43, - ParaInclusion: parachains_inclusion::{Pallet, Call, Storage, Event} = 44, - ParaInherent: parachains_paras_inherent::{Pallet, Call, Storage, Inherent} = 45, - ParaScheduler: parachains_scheduler::{Pallet, Storage} = 46, - Paras: parachains_paras::{Pallet, Call, Storage, Event, Config, ValidateUnsigned} = 47, - Initializer: parachains_initializer::{Pallet, Call, Storage} = 48, - Dmp: parachains_dmp::{Pallet, Storage} = 49, + ParachainsOrigin: parachains_origin = 41, + Configuration: parachains_configuration = 42, + ParasShared: parachains_shared = 43, + ParaInclusion: parachains_inclusion = 44, + ParaInherent: parachains_paras_inherent = 45, + ParaScheduler: parachains_scheduler = 46, + Paras: parachains_paras = 47, + Initializer: parachains_initializer = 48, + Dmp: parachains_dmp = 49, // RIP Ump 50 - Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event, Config} = 51, - ParaSessionInfo: parachains_session_info::{Pallet, Storage} = 52, - ParasDisputes: parachains_disputes::{Pallet, Call, Storage, Event} = 53, - ParasSlashing: parachains_slashing::{Pallet, Call, Storage, ValidateUnsigned} = 54, - ParachainsAssignmentProvider: parachains_assigner_parachains::{Pallet} = 55, + Hrmp: parachains_hrmp = 51, + ParaSessionInfo: parachains_session_info = 52, + ParasDisputes: parachains_disputes = 53, + ParasSlashing: parachains_slashing = 54, + ParachainsAssignmentProvider: parachains_assigner_parachains = 55, // Parachain Onboarding Pallets. Start indices at 60 to leave room. - Registrar: paras_registrar::{Pallet, Call, Storage, Event, Config} = 60, - Slots: slots::{Pallet, Call, Storage, Event} = 61, - ParasSudoWrapper: paras_sudo_wrapper::{Pallet, Call} = 62, - Auctions: auctions::{Pallet, Call, Storage, Event} = 63, - Crowdloan: crowdloan::{Pallet, Call, Storage, Event} = 64, - AssignedSlots: assigned_slots::{Pallet, Call, Storage, Event, Config} = 65, + Registrar: paras_registrar = 60, + Slots: slots = 61, + ParasSudoWrapper: paras_sudo_wrapper = 62, + Auctions: auctions = 63, + Crowdloan: crowdloan = 64, + AssignedSlots: assigned_slots = 65, // Pallet for sending XCM. - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 99, + XcmPallet: pallet_xcm = 99, // Generalized message queue - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 100, + MessageQueue: pallet_message_queue = 100, // Asset rate. - AssetRate: pallet_asset_rate::{Pallet, Call, Storage, Event} = 101, + AssetRate: pallet_asset_rate = 101, // Root testing pallet. - RootTesting: pallet_root_testing::{Pallet, Call, Storage, Event} = 102, + RootTesting: pallet_root_testing = 102, // Pallet for migrating Identity to a parachain. To be removed post-migration. - IdentityMigrator: identity_migrator::{Pallet, Call, Event} = 248, + IdentityMigrator: identity_migrator = 248, } } diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index bb4b7ff6276..f1d1b2fdef3 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -34,9 +34,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - XcmBalancesBenchmark: xcm_balances_benchmark::{Pallet}, + System: frame_system, + Balances: pallet_balances, + XcmBalancesBenchmark: xcm_balances_benchmark, } ); diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs index 4dd677217fc..656c675b630 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs @@ -39,9 +39,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - XcmGenericBenchmarks: generic::{Pallet}, + System: frame_system, + Balances: pallet_balances, + XcmGenericBenchmarks: generic, } ); diff --git a/polkadot/xcm/pallet-xcm/src/mock.rs b/polkadot/xcm/pallet-xcm/src/mock.rs index 3ce32fa46d3..1ca30963d59 100644 --- a/polkadot/xcm/pallet-xcm/src/mock.rs +++ b/polkadot/xcm/pallet-xcm/src/mock.rs @@ -139,12 +139,12 @@ pub mod pallet_test_notifier { construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - AssetsPallet: pallet_assets::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, - TestNotifier: pallet_test_notifier::{Pallet, Call, Event}, + System: frame_system, + Balances: pallet_balances, + AssetsPallet: pallet_assets, + ParasOrigin: origin, + XcmPallet: pallet_xcm, + TestNotifier: pallet_test_notifier, } ); diff --git a/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs b/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs index 01ff8c29f3d..76198f84ed6 100644 --- a/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs +++ b/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs @@ -40,7 +40,7 @@ pub type BlockNumber = u32; pub type AccountId = AccountId32; construct_runtime!( - pub struct Test { + pub enum Test { System: frame_system, Balances: pallet_balances, Assets: pallet_assets, diff --git a/polkadot/xcm/xcm-builder/tests/mock/mod.rs b/polkadot/xcm/xcm-builder/tests/mock/mod.rs index 2e89313a68e..73df22561d1 100644 --- a/polkadot/xcm/xcm-builder/tests/mock/mod.rs +++ b/polkadot/xcm/xcm-builder/tests/mock/mod.rs @@ -250,10 +250,10 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, + System: frame_system, + Balances: pallet_balances, + ParasOrigin: origin, + XcmPallet: pallet_xcm, } ); diff --git a/polkadot/xcm/xcm-simulator/example/src/parachain.rs b/polkadot/xcm/xcm-simulator/example/src/parachain.rs index 0b6c573f464..3adfa95d2e8 100644 --- a/polkadot/xcm/xcm-simulator/example/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/parachain.rs @@ -457,10 +457,10 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - MsgQueue: mock_msg_queue::{Pallet, Storage, Event}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, - ForeignUniques: pallet_uniques::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + MsgQueue: mock_msg_queue, + PolkadotXcm: pallet_xcm, + ForeignUniques: pallet_uniques, } ); diff --git a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs index 946b932b05e..d9ed6e800aa 100644 --- a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs @@ -281,11 +281,11 @@ impl pallet_message_queue::Config for Runtime { construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, - Uniques: pallet_uniques::{Pallet, Call, Storage, Event}, - MessageQueue: pallet_message_queue::{Pallet, Event}, + System: frame_system, + Balances: pallet_balances, + ParasOrigin: origin, + XcmPallet: pallet_xcm, + Uniques: pallet_uniques, + MessageQueue: pallet_message_queue, } ); diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs index 41fc5af9708..8a89f8cb0e7 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs @@ -360,9 +360,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - MsgQueue: mock_msg_queue::{Pallet, Storage, Event}, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, + System: frame_system, + Balances: pallet_balances, + MsgQueue: mock_msg_queue, + PolkadotXcm: pallet_xcm, } ); diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs index d3f91b01317..143f8974f3e 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs @@ -252,10 +252,10 @@ impl pallet_message_queue::Config for Runtime { construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, - MessageQueue: pallet_message_queue::{Pallet, Event}, + System: frame_system, + Balances: pallet_balances, + ParasOrigin: origin, + XcmPallet: pallet_xcm, + MessageQueue: pallet_message_queue, } ); diff --git a/substrate/bin/minimal/runtime/src/lib.rs b/substrate/bin/minimal/runtime/src/lib.rs index efee400c3f5..610289693d9 100644 --- a/substrate/bin/minimal/runtime/src/lib.rs +++ b/substrate/bin/minimal/runtime/src/lib.rs @@ -63,7 +63,7 @@ type SignedExtra = ( ); construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Timestamp: pallet_timestamp, diff --git a/substrate/bin/node-template/runtime/src/lib.rs b/substrate/bin/node-template/runtime/src/lib.rs index 5f399edda98..e9ccd5697df 100644 --- a/substrate/bin/node-template/runtime/src/lib.rs +++ b/substrate/bin/node-template/runtime/src/lib.rs @@ -258,7 +258,7 @@ impl pallet_template::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Timestamp: pallet_timestamp, Aura: pallet_aura, diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 1043e5017dc..d7598adb5a2 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -2083,8 +2083,7 @@ impl pallet_mixnet::Config for Runtime { } construct_runtime!( - pub struct Runtime - { + pub enum Runtime { System: frame_system, Utility: pallet_utility, Babe: pallet_babe, @@ -2099,11 +2098,11 @@ construct_runtime!( AssetConversionTxPayment: pallet_asset_conversion_tx_payment, ElectionProviderMultiPhase: pallet_election_provider_multi_phase, Staking: pallet_staking, - Beefy: pallet_beefy::{Pallet, Call, Storage, Config, ValidateUnsigned}, + Beefy: pallet_beefy, // MMR leaf construction must be before session in order to have leaf contents // refer to block consistently. see substrate issue #11797 for details. - Mmr: pallet_mmr::{Pallet, Storage}, - MmrLeaf: pallet_beefy_mmr::{Pallet, Storage}, + Mmr: pallet_mmr, + MmrLeaf: pallet_beefy_mmr, Session: pallet_session, Democracy: pallet_democracy, Council: pallet_collective::, @@ -2118,7 +2117,7 @@ construct_runtime!( ImOnline: pallet_im_online, AuthorityDiscovery: pallet_authority_discovery, Offences: pallet_offences, - Historical: pallet_session_historical::{Pallet}, + Historical: pallet_session_historical, RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, Identity: pallet_identity, Society: pallet_society, diff --git a/substrate/frame/assets/src/mock.rs b/substrate/frame/assets/src/mock.rs index a4d85b64922..d60f5358336 100644 --- a/substrate/frame/assets/src/mock.rs +++ b/substrate/frame/assets/src/mock.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Assets: pallet_assets::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Assets: pallet_assets, } ); diff --git a/substrate/frame/atomic-swap/src/tests.rs b/substrate/frame/atomic-swap/src/tests.rs index 7e2f22b1836..58502aa4f93 100644 --- a/substrate/frame/atomic-swap/src/tests.rs +++ b/substrate/frame/atomic-swap/src/tests.rs @@ -35,9 +35,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - AtomicSwap: pallet_atomic_swap::{Pallet, Call, Event}, + System: frame_system, + Balances: pallet_balances, + AtomicSwap: pallet_atomic_swap, } ); diff --git a/substrate/frame/aura/src/mock.rs b/substrate/frame/aura/src/mock.rs index d38a8583819..d87fea8fc81 100644 --- a/substrate/frame/aura/src/mock.rs +++ b/substrate/frame/aura/src/mock.rs @@ -35,9 +35,9 @@ const SLOT_DURATION: u64 = 2; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Aura: pallet_aura::{Pallet, Storage, Config}, + System: frame_system, + Timestamp: pallet_timestamp, + Aura: pallet_aura, } ); diff --git a/substrate/frame/authority-discovery/src/lib.rs b/substrate/frame/authority-discovery/src/lib.rs index 3044b41e31d..640c0c8759e 100644 --- a/substrate/frame/authority-discovery/src/lib.rs +++ b/substrate/frame/authority-discovery/src/lib.rs @@ -187,9 +187,9 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config}, + System: frame_system, + Session: pallet_session, + AuthorityDiscovery: pallet_authority_discovery, } ); diff --git a/substrate/frame/authorship/src/lib.rs b/substrate/frame/authorship/src/lib.rs index 56a516894de..8b38a58d8e7 100644 --- a/substrate/frame/authorship/src/lib.rs +++ b/substrate/frame/authorship/src/lib.rs @@ -108,8 +108,8 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Authorship: pallet_authorship::{Pallet, Storage}, + System: frame_system, + Authorship: pallet_authorship, } ); diff --git a/substrate/frame/bags-list/src/mock.rs b/substrate/frame/bags-list/src/mock.rs index 9946a2198ac..4282120983b 100644 --- a/substrate/frame/bags-list/src/mock.rs +++ b/substrate/frame/bags-list/src/mock.rs @@ -68,10 +68,9 @@ impl bags_list::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Storage, Event, Config}, - BagsList: bags_list::{Pallet, Call, Storage, Event}, + pub enum Runtime { + System: frame_system, + BagsList: bags_list, } ); diff --git a/substrate/frame/balances/src/tests/mod.rs b/substrate/frame/balances/src/tests/mod.rs index 8e834483cbe..708e081fe0b 100644 --- a/substrate/frame/balances/src/tests/mod.rs +++ b/substrate/frame/balances/src/tests/mod.rs @@ -75,11 +75,10 @@ impl VariantCount for TestId { } frame_support::construct_runtime!( - pub struct Test - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + TransactionPayment: pallet_transaction_payment, } ); diff --git a/substrate/frame/beefy-mmr/src/mock.rs b/substrate/frame/beefy-mmr/src/mock.rs index b85096813de..94149ac6776 100644 --- a/substrate/frame/beefy-mmr/src/mock.rs +++ b/substrate/frame/beefy-mmr/src/mock.rs @@ -49,11 +49,11 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Mmr: pallet_mmr::{Pallet, Storage}, - Beefy: pallet_beefy::{Pallet, Config, Storage}, - BeefyMmr: pallet_beefy_mmr::{Pallet, Storage}, + System: frame_system, + Session: pallet_session, + Mmr: pallet_mmr, + Beefy: pallet_beefy, + BeefyMmr: pallet_beefy_mmr, } ); diff --git a/substrate/frame/benchmarking/pov/src/benchmarking.rs b/substrate/frame/benchmarking/pov/src/benchmarking.rs index a24b772ade0..84d81890b17 100644 --- a/substrate/frame/benchmarking/pov/src/benchmarking.rs +++ b/substrate/frame/benchmarking/pov/src/benchmarking.rs @@ -350,8 +350,8 @@ mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Baseline: crate::{Pallet, Call, Storage, Event}, + System: frame_system, + Baseline: crate, } ); diff --git a/substrate/frame/benchmarking/pov/src/tests.rs b/substrate/frame/benchmarking/pov/src/tests.rs index dda29c071de..7fa2fb97dea 100644 --- a/substrate/frame/benchmarking/pov/src/tests.rs +++ b/substrate/frame/benchmarking/pov/src/tests.rs @@ -170,8 +170,8 @@ mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Baseline: crate::{Pallet, Call, Storage, Event}, + System: frame_system, + Baseline: crate, } ); diff --git a/substrate/frame/benchmarking/src/baseline.rs b/substrate/frame/benchmarking/src/baseline.rs index 6451284e012..2fd3b634ae7 100644 --- a/substrate/frame/benchmarking/src/baseline.rs +++ b/substrate/frame/benchmarking/src/baseline.rs @@ -121,7 +121,7 @@ pub mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system, } ); diff --git a/substrate/frame/benchmarking/src/tests.rs b/substrate/frame/benchmarking/src/tests.rs index 7d6cfaad609..f47a3d9f96a 100644 --- a/substrate/frame/benchmarking/src/tests.rs +++ b/substrate/frame/benchmarking/src/tests.rs @@ -70,8 +70,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - TestPallet: pallet_test::{Pallet, Call, Storage}, + System: frame_system, + TestPallet: pallet_test, } ); diff --git a/substrate/frame/benchmarking/src/tests_instance.rs b/substrate/frame/benchmarking/src/tests_instance.rs index 55010840896..c28aa694a13 100644 --- a/substrate/frame/benchmarking/src/tests_instance.rs +++ b/substrate/frame/benchmarking/src/tests_instance.rs @@ -80,8 +80,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - TestPallet: pallet_test::{Pallet, Call, Storage, Event}, + System: frame_system, + TestPallet: pallet_test, } ); diff --git a/substrate/frame/bounties/src/tests.rs b/substrate/frame/bounties/src/tests.rs index 22e608cce63..a7177393a44 100644 --- a/substrate/frame/bounties/src/tests.rs +++ b/substrate/frame/bounties/src/tests.rs @@ -44,12 +44,12 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Bounties: pallet_bounties::{Pallet, Call, Storage, Event}, - Bounties1: pallet_bounties::::{Pallet, Call, Storage, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - Treasury1: pallet_treasury::::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Bounties: pallet_bounties, + Bounties1: pallet_bounties::, + Treasury: pallet_treasury, + Treasury1: pallet_treasury::, } ); diff --git a/substrate/frame/child-bounties/src/tests.rs b/substrate/frame/child-bounties/src/tests.rs index 7de45c73127..e57721adad0 100644 --- a/substrate/frame/child-bounties/src/tests.rs +++ b/substrate/frame/child-bounties/src/tests.rs @@ -46,11 +46,11 @@ type BountiesError = pallet_bounties::Error; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Bounties: pallet_bounties::{Pallet, Call, Storage, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - ChildBounties: pallet_child_bounties::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Bounties: pallet_bounties, + Treasury: pallet_treasury, + ChildBounties: pallet_child_bounties, } ); diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 06a91cf6fe9..dbc3fbe69b3 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -38,11 +38,11 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic}, - Collective: pallet_collective::::{Pallet, Call, Event, Origin, Config}, - CollectiveMajority: pallet_collective::::{Pallet, Call, Event, Origin, Config}, - DefaultCollective: pallet_collective::{Pallet, Call, Event, Origin, Config}, - Democracy: mock_democracy::{Pallet, Call, Event}, + System: frame_system, + Collective: pallet_collective::, + CollectiveMajority: pallet_collective::, + DefaultCollective: pallet_collective, + Democracy: mock_democracy, } ); @@ -176,6 +176,7 @@ impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig { + system: frame_system::GenesisConfig::default(), collective: pallet_collective::GenesisConfig { members: self.collective_members, phantom: Default::default(), diff --git a/substrate/frame/contracts/mock-network/src/relay_chain.rs b/substrate/frame/contracts/mock-network/src/relay_chain.rs index abe907839d9..9671857fb78 100644 --- a/substrate/frame/contracts/mock-network/src/relay_chain.rs +++ b/substrate/frame/contracts/mock-network/src/relay_chain.rs @@ -233,10 +233,10 @@ impl pallet_message_queue::Config for Runtime { construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, - MessageQueue: pallet_message_queue::{Pallet, Event}, + System: frame_system, + Balances: pallet_balances, + ParasOrigin: origin, + XcmPallet: pallet_xcm, + MessageQueue: pallet_message_queue, } ); diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs index 28fe3c2af49..81539591019 100644 --- a/substrate/frame/contracts/src/tests.rs +++ b/substrate/frame/contracts/src/tests.rs @@ -71,13 +71,13 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Randomness: pallet_insecure_randomness_collective_flip::{Pallet, Storage}, - Utility: pallet_utility::{Pallet, Call, Storage, Event}, - Contracts: pallet_contracts::{Pallet, Call, Storage, Event, HoldReason}, - Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Timestamp: pallet_timestamp, + Randomness: pallet_insecure_randomness_collective_flip, + Utility: pallet_utility, + Contracts: pallet_contracts, + Proxy: pallet_proxy, Dummy: pallet_dummy } ); diff --git a/substrate/frame/conviction-voting/src/tests.rs b/substrate/frame/conviction-voting/src/tests.rs index 371d0364384..d7bac505a54 100644 --- a/substrate/frame/conviction-voting/src/tests.rs +++ b/substrate/frame/conviction-voting/src/tests.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Voting: pallet_conviction_voting::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Voting: pallet_conviction_voting, } ); diff --git a/substrate/frame/core-fellowship/src/tests.rs b/substrate/frame/core-fellowship/src/tests.rs index c9098f2171f..838bd9bbdc8 100644 --- a/substrate/frame/core-fellowship/src/tests.rs +++ b/substrate/frame/core-fellowship/src/tests.rs @@ -41,8 +41,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - CoreFellowship: pallet_core_fellowship::{Pallet, Call, Storage, Event}, + System: frame_system, + CoreFellowship: pallet_core_fellowship, } ); diff --git a/substrate/frame/democracy/src/tests.rs b/substrate/frame/democracy/src/tests.rs index 00d8fedca0c..888d7e59614 100644 --- a/substrate/frame/democracy/src/tests.rs +++ b/substrate/frame/democracy/src/tests.rs @@ -55,11 +55,11 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, Preimage: pallet_preimage, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event}, - Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event}, + Scheduler: pallet_scheduler, + Democracy: pallet_democracy, } ); diff --git a/substrate/frame/election-provider-multi-phase/src/mock.rs b/substrate/frame/election-provider-multi-phase/src/mock.rs index e7dd8acf36b..507e8f2c39b 100644 --- a/substrate/frame/election-provider-multi-phase/src/mock.rs +++ b/substrate/frame/election-provider-multi-phase/src/mock.rs @@ -54,11 +54,10 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event, Config}, - Balances: pallet_balances::{Pallet, Call, Event, Config}, - MultiPhase: multi_phase::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + MultiPhase: multi_phase, } ); diff --git a/substrate/frame/election-provider-support/src/onchain.rs b/substrate/frame/election-provider-support/src/onchain.rs index 412aac45475..d937f42cb40 100644 --- a/substrate/frame/election-provider-support/src/onchain.rs +++ b/substrate/frame/election-provider-support/src/onchain.rs @@ -194,9 +194,8 @@ mod tests { pub type Block = sp_runtime::generic::Block; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, } ); diff --git a/substrate/frame/elections-phragmen/src/lib.rs b/substrate/frame/elections-phragmen/src/lib.rs index 5e50027e344..2b599ab5292 100644 --- a/substrate/frame/elections-phragmen/src/lib.rs +++ b/substrate/frame/elections-phragmen/src/lib.rs @@ -1454,9 +1454,9 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Event, Config}, - Elections: elections_phragmen::{Pallet, Call, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Elections: elections_phragmen, } ); @@ -1507,6 +1507,7 @@ mod tests { *m.borrow_mut() = self.genesis_members.iter().map(|(m, _)| *m).collect::>() }); let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig { + system: frame_system::GenesisConfig::default(), balances: pallet_balances::GenesisConfig:: { balances: vec![ (1, 10 * self.balance_factor), diff --git a/substrate/frame/examples/basic/src/tests.rs b/substrate/frame/examples/basic/src/tests.rs index e00b1ac01b3..2a6fbf0f054 100644 --- a/substrate/frame/examples/basic/src/tests.rs +++ b/substrate/frame/examples/basic/src/tests.rs @@ -39,9 +39,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Example: pallet_example_basic::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Example: pallet_example_basic, } ); diff --git a/substrate/frame/examples/default-config/src/lib.rs b/substrate/frame/examples/default-config/src/lib.rs index f1611bca2ce..cd1653e6c76 100644 --- a/substrate/frame/examples/default-config/src/lib.rs +++ b/substrate/frame/examples/default-config/src/lib.rs @@ -143,7 +143,7 @@ pub mod tests { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, DefaultPallet: pallet_default_config_example, } diff --git a/substrate/frame/examples/dev-mode/src/tests.rs b/substrate/frame/examples/dev-mode/src/tests.rs index 3acedcd0fd1..c1501a5b4cf 100644 --- a/substrate/frame/examples/dev-mode/src/tests.rs +++ b/substrate/frame/examples/dev-mode/src/tests.rs @@ -33,9 +33,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Example: pallet_dev_mode::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Example: pallet_dev_mode, } ); diff --git a/substrate/frame/examples/frame-crate/src/lib.rs b/substrate/frame/examples/frame-crate/src/lib.rs index 0fea2c22cf5..7e286df1e32 100644 --- a/substrate/frame/examples/frame-crate/src/lib.rs +++ b/substrate/frame/examples/frame-crate/src/lib.rs @@ -49,7 +49,7 @@ mod tests { use frame::testing_prelude::*; construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, MyPallet: my_pallet, } diff --git a/substrate/frame/examples/offchain-worker/src/tests.rs b/substrate/frame/examples/offchain-worker/src/tests.rs index 48a8d86588c..ea37a2da493 100644 --- a/substrate/frame/examples/offchain-worker/src/tests.rs +++ b/substrate/frame/examples/offchain-worker/src/tests.rs @@ -41,8 +41,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Example: example_offchain_worker::{Pallet, Call, Storage, Event, ValidateUnsigned}, + System: frame_system, + Example: example_offchain_worker, } ); diff --git a/substrate/frame/examples/tasks/src/mock.rs b/substrate/frame/examples/tasks/src/mock.rs index e0fbec3eb76..5ad104b0dfa 100644 --- a/substrate/frame/examples/tasks/src/mock.rs +++ b/substrate/frame/examples/tasks/src/mock.rs @@ -26,7 +26,7 @@ pub type Balance = u32; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, TasksExample: tasks_example, } diff --git a/substrate/frame/executive/src/lib.rs b/substrate/frame/executive/src/lib.rs index f2cc3b63168..cfeb585b0fd 100644 --- a/substrate/frame/executive/src/lib.rs +++ b/substrate/frame/executive/src/lib.rs @@ -897,12 +897,11 @@ mod tests { } frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, - Custom: custom::{Pallet, Call, ValidateUnsigned, Inherent}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + TransactionPayment: pallet_transaction_payment, + Custom: custom, } ); diff --git a/substrate/frame/fast-unstake/src/mock.rs b/substrate/frame/fast-unstake/src/mock.rs index f9326919fd3..de1772264f1 100644 --- a/substrate/frame/fast-unstake/src/mock.rs +++ b/substrate/frame/fast-unstake/src/mock.rs @@ -181,7 +181,7 @@ impl fast_unstake::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Timestamp: pallet_timestamp, Balances: pallet_balances, diff --git a/substrate/frame/glutton/src/mock.rs b/substrate/frame/glutton/src/mock.rs index 31b78efc574..26863811e29 100644 --- a/substrate/frame/glutton/src/mock.rs +++ b/substrate/frame/glutton/src/mock.rs @@ -33,8 +33,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Glutton: pallet_glutton::{Pallet, Event}, + System: frame_system, + Glutton: pallet_glutton, } ); diff --git a/substrate/frame/identity/src/tests.rs b/substrate/frame/identity/src/tests.rs index e6107cda0f0..a2b26120254 100644 --- a/substrate/frame/identity/src/tests.rs +++ b/substrate/frame/identity/src/tests.rs @@ -47,9 +47,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Identity: pallet_identity::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Identity: pallet_identity, } ); diff --git a/substrate/frame/im-online/src/mock.rs b/substrate/frame/im-online/src/mock.rs index 2f4e3922026..9dad148b10f 100644 --- a/substrate/frame/im-online/src/mock.rs +++ b/substrate/frame/im-online/src/mock.rs @@ -42,12 +42,11 @@ use crate::Config; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - ImOnline: imonline::{Pallet, Call, Storage, Config, Event}, - Historical: pallet_session_historical::{Pallet}, + pub enum Runtime { + System: frame_system, + Session: pallet_session, + ImOnline: imonline, + Historical: pallet_session_historical, } ); diff --git a/substrate/frame/indices/src/mock.rs b/substrate/frame/indices/src/mock.rs index 913a37fe55b..7ea524a3167 100644 --- a/substrate/frame/indices/src/mock.rs +++ b/substrate/frame/indices/src/mock.rs @@ -32,9 +32,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Indices: pallet_indices, } ); diff --git a/substrate/frame/insecure-randomness-collective-flip/src/lib.rs b/substrate/frame/insecure-randomness-collective-flip/src/lib.rs index c7ed22d1dd5..00f1055f6f2 100644 --- a/substrate/frame/insecure-randomness-collective-flip/src/lib.rs +++ b/substrate/frame/insecure-randomness-collective-flip/src/lib.rs @@ -179,8 +179,8 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - CollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage}, + System: frame_system, + CollectiveFlip: pallet_insecure_randomness_collective_flip, } ); diff --git a/substrate/frame/lottery/src/mock.rs b/substrate/frame/lottery/src/mock.rs index 6e50529619b..884f003aada 100644 --- a/substrate/frame/lottery/src/mock.rs +++ b/substrate/frame/lottery/src/mock.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Lottery: pallet_lottery::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Lottery: pallet_lottery, } ); diff --git a/substrate/frame/membership/src/lib.rs b/substrate/frame/membership/src/lib.rs index 2f4bf4bc4ff..0e03c097d12 100644 --- a/substrate/frame/membership/src/lib.rs +++ b/substrate/frame/membership/src/lib.rs @@ -541,8 +541,8 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Membership: pallet_membership::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Membership: pallet_membership, } ); diff --git a/substrate/frame/merkle-mountain-range/src/mock.rs b/substrate/frame/merkle-mountain-range/src/mock.rs index d3cb4e57029..b3b5127db02 100644 --- a/substrate/frame/merkle-mountain-range/src/mock.rs +++ b/substrate/frame/merkle-mountain-range/src/mock.rs @@ -28,8 +28,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - MMR: pallet_mmr::{Pallet, Storage}, + System: frame_system, + MMR: pallet_mmr, } ); diff --git a/substrate/frame/message-queue/src/integration_test.rs b/substrate/frame/message-queue/src/integration_test.rs index fee5d242135..aa6f019d650 100644 --- a/substrate/frame/message-queue/src/integration_test.rs +++ b/substrate/frame/message-queue/src/integration_test.rs @@ -52,8 +52,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, + System: frame_system, + MessageQueue: pallet_message_queue, } ); diff --git a/substrate/frame/message-queue/src/mock.rs b/substrate/frame/message-queue/src/mock.rs index 89c6e862510..f1067ed961e 100644 --- a/substrate/frame/message-queue/src/mock.rs +++ b/substrate/frame/message-queue/src/mock.rs @@ -39,8 +39,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, + System: frame_system, + MessageQueue: pallet_message_queue, } ); diff --git a/substrate/frame/multisig/src/tests.rs b/substrate/frame/multisig/src/tests.rs index 17982725529..887c7f8bebc 100644 --- a/substrate/frame/multisig/src/tests.rs +++ b/substrate/frame/multisig/src/tests.rs @@ -32,9 +32,9 @@ type Block = frame_system::mocking::MockBlockU32; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Multisig: pallet_multisig, } ); diff --git a/substrate/frame/nfts/src/mock.rs b/substrate/frame/nfts/src/mock.rs index 4363eccc7ff..95443cf41c4 100644 --- a/substrate/frame/nfts/src/mock.rs +++ b/substrate/frame/nfts/src/mock.rs @@ -36,9 +36,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Nfts: pallet_nfts::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Nfts: pallet_nfts, } ); diff --git a/substrate/frame/node-authorization/src/mock.rs b/substrate/frame/node-authorization/src/mock.rs index 3c99d41b89e..bd648de2b24 100644 --- a/substrate/frame/node-authorization/src/mock.rs +++ b/substrate/frame/node-authorization/src/mock.rs @@ -36,10 +36,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - NodeAuthorization: pallet_node_authorization::{ - Pallet, Call, Storage, Config, Event, - }, + System: frame_system, + NodeAuthorization: pallet_node_authorization, } ); diff --git a/substrate/frame/nomination-pools/benchmarking/src/mock.rs b/substrate/frame/nomination-pools/benchmarking/src/mock.rs index c58a66f6163..77124ae3888 100644 --- a/substrate/frame/nomination-pools/benchmarking/src/mock.rs +++ b/substrate/frame/nomination-pools/benchmarking/src/mock.rs @@ -180,14 +180,13 @@ impl crate::Config for Runtime {} type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - VoterList: pallet_bags_list::::{Pallet, Call, Storage, Event}, - Pools: pallet_nomination_pools::{Pallet, Call, Storage, Event, FreezeReason}, + pub enum Runtime { + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + Staking: pallet_staking, + VoterList: pallet_bags_list::, + Pools: pallet_nomination_pools, } ); diff --git a/substrate/frame/nomination-pools/src/mock.rs b/substrate/frame/nomination-pools/src/mock.rs index 1bd969230da..cd91fbb33c1 100644 --- a/substrate/frame/nomination-pools/src/mock.rs +++ b/substrate/frame/nomination-pools/src/mock.rs @@ -295,11 +295,10 @@ impl pools::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Storage, Event, Config}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Pools: pools::{Pallet, Call, Storage, Event, FreezeReason}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + Pools: pools, } ); diff --git a/substrate/frame/nomination-pools/test-staking/src/mock.rs b/substrate/frame/nomination-pools/test-staking/src/mock.rs index 491cd619161..cbd7a4d0758 100644 --- a/substrate/frame/nomination-pools/test-staking/src/mock.rs +++ b/substrate/frame/nomination-pools/test-staking/src/mock.rs @@ -192,14 +192,13 @@ impl pallet_nomination_pools::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - VoterList: pallet_bags_list::::{Pallet, Call, Storage, Event}, - Pools: pallet_nomination_pools::{Pallet, Call, Storage, Event, FreezeReason}, + pub enum Runtime { + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + Staking: pallet_staking, + VoterList: pallet_bags_list::, + Pools: pallet_nomination_pools, } ); diff --git a/substrate/frame/offences/benchmarking/src/mock.rs b/substrate/frame/offences/benchmarking/src/mock.rs index 1d642b9b498..38c6fb6ea5f 100644 --- a/substrate/frame/offences/benchmarking/src/mock.rs +++ b/substrate/frame/offences/benchmarking/src/mock.rs @@ -227,9 +227,9 @@ frame_support::construct_runtime!( pub enum Test { System: system::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, + Balances: pallet_balances, + Staking: pallet_staking, + Session: pallet_session, ImOnline: pallet_im_online::{Pallet, Call, Storage, Event, ValidateUnsigned, Config}, Offences: pallet_offences::{Pallet, Storage, Event}, Historical: pallet_session_historical::{Pallet}, diff --git a/substrate/frame/offences/src/mock.rs b/substrate/frame/offences/src/mock.rs index 61f680f6db9..d97be99def1 100644 --- a/substrate/frame/offences/src/mock.rs +++ b/substrate/frame/offences/src/mock.rs @@ -68,10 +68,9 @@ pub fn with_on_offence_fractions) -> R>(f: F) -> type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Offences: offences::{Pallet, Storage, Event}, + pub enum Runtime { + System: frame_system, + Offences: offences, } ); diff --git a/substrate/frame/proxy/src/tests.rs b/substrate/frame/proxy/src/tests.rs index 89bd8b68f09..67a662e01b2 100644 --- a/substrate/frame/proxy/src/tests.rs +++ b/substrate/frame/proxy/src/tests.rs @@ -35,10 +35,10 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Proxy: proxy::{Pallet, Call, Storage, Event}, - Utility: pallet_utility::{Pallet, Call, Event}, + System: frame_system, + Balances: pallet_balances, + Proxy: proxy, + Utility: pallet_utility, } ); diff --git a/substrate/frame/ranked-collective/src/tests.rs b/substrate/frame/ranked-collective/src/tests.rs index 60c0da3d7ac..b3605169339 100644 --- a/substrate/frame/ranked-collective/src/tests.rs +++ b/substrate/frame/ranked-collective/src/tests.rs @@ -37,8 +37,8 @@ type Class = Rank; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Club: pallet_ranked_collective::{Pallet, Call, Storage, Event}, + System: frame_system, + Club: pallet_ranked_collective, } ); diff --git a/substrate/frame/recovery/src/mock.rs b/substrate/frame/recovery/src/mock.rs index 44cbeec0986..9adb2b80931 100644 --- a/substrate/frame/recovery/src/mock.rs +++ b/substrate/frame/recovery/src/mock.rs @@ -35,9 +35,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Recovery: recovery::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Recovery: recovery, } ); diff --git a/substrate/frame/remark/src/mock.rs b/substrate/frame/remark/src/mock.rs index 0a385c30eac..5a5e6a3ccdf 100644 --- a/substrate/frame/remark/src/mock.rs +++ b/substrate/frame/remark/src/mock.rs @@ -34,8 +34,8 @@ pub type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Remark: pallet_remark::{ Pallet, Call, Event }, + System: frame_system, + Remark: pallet_remark, } ); diff --git a/substrate/frame/root-offences/src/mock.rs b/substrate/frame/root-offences/src/mock.rs index c0c83dd08d2..583ba5b92fb 100644 --- a/substrate/frame/root-offences/src/mock.rs +++ b/substrate/frame/root-offences/src/mock.rs @@ -48,13 +48,13 @@ pub const BLOCK_TIME: u64 = 1000; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - RootOffences: root_offences::{Pallet, Call, Storage, Event}, - Historical: pallet_session::historical::{Pallet, Storage}, + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + Staking: pallet_staking, + Session: pallet_session, + RootOffences: root_offences, + Historical: pallet_session::historical, } ); diff --git a/substrate/frame/salary/src/tests.rs b/substrate/frame/salary/src/tests.rs index fbca1be1188..f25acd93452 100644 --- a/substrate/frame/salary/src/tests.rs +++ b/substrate/frame/salary/src/tests.rs @@ -40,8 +40,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Salary: pallet_salary::{Pallet, Call, Storage, Event}, + System: frame_system, + Salary: pallet_salary, } ); diff --git a/substrate/frame/scheduler/src/mock.rs b/substrate/frame/scheduler/src/mock.rs index 4edcfa0a7bf..d22b9fcf8d9 100644 --- a/substrate/frame/scheduler/src/mock.rs +++ b/substrate/frame/scheduler/src/mock.rs @@ -97,10 +97,10 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Logger: logger::{Pallet, Call, Event}, - Scheduler: scheduler::{Pallet, Call, Storage, Event}, - Preimage: pallet_preimage::{Pallet, Call, Storage, Event, HoldReason}, + System: frame_system, + Logger: logger, + Scheduler: scheduler, + Preimage: pallet_preimage, } ); diff --git a/substrate/frame/scored-pool/src/mock.rs b/substrate/frame/scored-pool/src/mock.rs index 6c032ab808c..00818f4aad0 100644 --- a/substrate/frame/scored-pool/src/mock.rs +++ b/substrate/frame/scored-pool/src/mock.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ScoredPool: pallet_scored_pool::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + ScoredPool: pallet_scored_pool, } ); diff --git a/substrate/frame/session/benchmarking/src/mock.rs b/substrate/frame/session/benchmarking/src/mock.rs index e1744fa43ab..c305641e185 100644 --- a/substrate/frame/session/benchmarking/src/mock.rs +++ b/substrate/frame/session/benchmarking/src/mock.rs @@ -38,10 +38,10 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Staking: pallet_staking, + Session: pallet_session, } ); diff --git a/substrate/frame/session/src/mock.rs b/substrate/frame/session/src/mock.rs index f3f18fde168..eb9eddfd847 100644 --- a/substrate/frame/session/src/mock.rs +++ b/substrate/frame/session/src/mock.rs @@ -82,9 +82,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Historical: pallet_session_historical::{Pallet}, + System: frame_system, + Session: pallet_session, + Historical: pallet_session_historical, } ); @@ -92,8 +92,8 @@ frame_support::construct_runtime!( frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Session: pallet_session, } ); diff --git a/substrate/frame/society/src/mock.rs b/substrate/frame/society/src/mock.rs index 3e29d01ca8e..749d196b6e1 100644 --- a/substrate/frame/society/src/mock.rs +++ b/substrate/frame/society/src/mock.rs @@ -39,9 +39,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Society: pallet_society::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Society: pallet_society, } ); diff --git a/substrate/frame/state-trie-migration/src/lib.rs b/substrate/frame/state-trie-migration/src/lib.rs index ea28d712605..c71002f420c 100644 --- a/substrate/frame/state-trie-migration/src/lib.rs +++ b/substrate/frame/state-trie-migration/src/lib.rs @@ -1071,9 +1071,9 @@ mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Config, Storage, Event}, - StateTrieMigration: pallet_state_trie_migration::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + StateTrieMigration: pallet_state_trie_migration, } ); diff --git a/substrate/frame/sudo/src/mock.rs b/substrate/frame/sudo/src/mock.rs index 878e9239080..9ad14804524 100644 --- a/substrate/frame/sudo/src/mock.rs +++ b/substrate/frame/sudo/src/mock.rs @@ -98,9 +98,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Sudo: sudo::{Pallet, Call, Config, Storage, Event}, - Logger: logger::{Pallet, Call, Storage, Event}, + System: frame_system, + Sudo: sudo, + Logger: logger, } ); diff --git a/substrate/frame/support/procedural/src/construct_runtime/mod.rs b/substrate/frame/support/procedural/src/construct_runtime/mod.rs index 7a9c4d89a74..54ed15f7b1d 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/mod.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/mod.rs @@ -21,7 +21,7 @@ //! order to get all the pallet parts for each pallet. //! //! Pallets can define their parts: -//! - Implicitely: `System: frame_system` +//! - Implicitly: `System: frame_system` //! - Explicitly: `System: frame_system::{Pallet, Call}` //! //! The `construct_runtime` transitions from the implicit definition to the explict one. @@ -172,7 +172,7 @@ //! //! This call has no implicit pallet parts, thus it will expand to the runtime construction: //! ```ignore -//! pub struct Runtime { ... } +//! pub enum Runtime { ... } //! pub struct Call { ... } //! impl Call ... //! pub enum Origin { ... } @@ -342,7 +342,7 @@ fn construct_runtime_final_expansion( syn::Error::new( pallets_token.span.join(), "`System` pallet declaration is missing. \ - Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event},`", + Please add this line: `System: frame_system,`", ) })?; if !system_pallet.cfg_pattern.is_empty() { diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index af1f99be103..95478d1a8cc 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -2291,7 +2291,7 @@ pub mod pallet_macros { /// # type Block = frame_system::mocking::MockBlock; /// # } /// construct_runtime! { - /// pub struct Runtime { + /// pub enum Runtime { /// System: frame_system, /// Custom: custom_pallet /// } diff --git a/substrate/frame/support/src/migrations.rs b/substrate/frame/support/src/migrations.rs index bfd62c8611c..d059a992a86 100644 --- a/substrate/frame/support/src/migrations.rs +++ b/substrate/frame/support/src/migrations.rs @@ -254,10 +254,10 @@ pub fn migrate_from_pallet_version_to_storage_version< /// construct_runtime! { /// pub enum Runtime /// { -/// System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, +/// System: frame_system = 0, /// -/// SomePalletToRemove: pallet_something::{Pallet, Call, Storage, Event} = 1, -/// AnotherPalletToRemove: pallet_something_else::{Pallet, Call, Storage, Event} = 2, +/// SomePalletToRemove: pallet_something = 1, +/// AnotherPalletToRemove: pallet_something_else = 2, /// /// YourOtherPallets... /// } diff --git a/substrate/frame/support/test/compile_pass/src/lib.rs b/substrate/frame/support/test/compile_pass/src/lib.rs index b304dfcb282..575322df760 100644 --- a/substrate/frame/support/test/compile_pass/src/lib.rs +++ b/substrate/frame/support/test/compile_pass/src/lib.rs @@ -83,7 +83,7 @@ pub type Block = generic::Block; pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: renamed_frame_system, } ); diff --git a/substrate/frame/support/test/stg_frame_crate/src/lib.rs b/substrate/frame/support/test/stg_frame_crate/src/lib.rs index 501fcf6a70d..59a66851f23 100644 --- a/substrate/frame/support/test/stg_frame_crate/src/lib.rs +++ b/substrate/frame/support/test/stg_frame_crate/src/lib.rs @@ -68,8 +68,8 @@ mod tests { construct_runtime! { pub struct Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Pallet: pallet::{Pallet, Config}, + System: frame_system, + Pallet: pallet, } } } diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr index 11ec6f33d20..0f74553f7ec 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr @@ -1,4 +1,4 @@ -error: `System` pallet declaration is missing. Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event},` +error: `System` pallet declaration is missing. Please add this line: `System: frame_system,` --> tests/construct_runtime_ui/missing_system_module.rs:22:2 | 22 | / { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs b/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs index ad637087476..5cde4a9beba 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs @@ -64,7 +64,7 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; frame_support::construct_runtime!( - pub struct Runtime + pub enum Runtime { // Exclude part `Storage` in order not to check its metadata in tests. System: frame_system, diff --git a/substrate/frame/support/test/tests/final_keys.rs b/substrate/frame/support/test/tests/final_keys.rs index 765afaf1e66..38240830daa 100644 --- a/substrate/frame/support/test/tests/final_keys.rs +++ b/substrate/frame/support/test/tests/final_keys.rs @@ -201,7 +201,6 @@ pub type Block = generic::Block; frame_support::construct_runtime!( pub enum Runtime - { System: frame_system, FinalKeysNone: no_instance, diff --git a/substrate/frame/support/test/tests/instance.rs b/substrate/frame/support/test/tests/instance.rs index 43a93df9dea..7a888e5685d 100644 --- a/substrate/frame/support/test/tests/instance.rs +++ b/substrate/frame/support/test/tests/instance.rs @@ -278,24 +278,14 @@ pub type Block = generic::Block; frame_support::construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Event}, - Module1_1: module1::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module1_2: module1::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module2: module2::{Pallet, Call, Storage, Event, Config, Origin, Inherent}, - Module2_1: module2::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module2_2: module2::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module2_3: module2::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module3: module3::{Pallet, Call}, + System: frame_system, + Module1_1: module1::, + Module1_2: module1::, + Module2: module2, + Module2_1: module2::, + Module2_2: module2::, + Module2_3: module2::, + Module3: module3, } ); @@ -350,6 +340,7 @@ impl module3::Config for Runtime { fn new_test_ext() -> sp_io::TestExternalities { RuntimeGenesisConfig { + system: Default::default(), module_1_1: module1::GenesisConfig { value: 3, test: 2 }, module_1_2: module1::GenesisConfig { value: 4, test: 5 }, module_2: module2::GenesisConfig { diff --git a/substrate/frame/support/test/tests/issue2219.rs b/substrate/frame/support/test/tests/issue2219.rs index 4016707b51a..4c384f43276 100644 --- a/substrate/frame/support/test/tests/issue2219.rs +++ b/substrate/frame/support/test/tests/issue2219.rs @@ -176,7 +176,7 @@ impl frame_system::Config for Runtime { impl module::Config for Runtime {} frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Module: module, } diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs b/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs index de856ddcd3e..7e67193cc76 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs @@ -57,8 +57,8 @@ impl frame_system::Config for Runtime { construct_runtime! { pub struct Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Pallet: test_pallet::{Pallet, Config}, + System: frame_system, + Pallet: test_pallet, } } diff --git a/substrate/frame/support/test/tests/storage_layers.rs b/substrate/frame/support/test/tests/storage_layers.rs index a6d16e0d66d..88edd7de6ca 100644 --- a/substrate/frame/support/test/tests/storage_layers.rs +++ b/substrate/frame/support/test/tests/storage_layers.rs @@ -94,7 +94,7 @@ impl frame_system::Config for Runtime { impl Config for Runtime {} frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, MyPallet: pallet, } diff --git a/substrate/frame/support/test/tests/versioned_migration.rs b/substrate/frame/support/test/tests/versioned_migration.rs index 03dbd948df9..dab5e06dc85 100644 --- a/substrate/frame/support/test/tests/versioned_migration.rs +++ b/substrate/frame/support/test/tests/versioned_migration.rs @@ -66,8 +66,8 @@ impl dummy_pallet::Config for Test {} construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - DummyPallet: dummy_pallet::{Pallet, Config, Storage} = 1, + System: frame_system = 0, + DummyPallet: dummy_pallet = 1, } ); diff --git a/substrate/frame/system/benches/bench.rs b/substrate/frame/system/benches/bench.rs index 79d5a2d8689..a0c567bf852 100644 --- a/substrate/frame/system/benches/bench.rs +++ b/substrate/frame/system/benches/bench.rs @@ -47,10 +47,9 @@ mod module { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Module: module::{Pallet, Event}, + pub enum Runtime { + System: frame_system, + Module: module, } ); diff --git a/substrate/frame/system/benchmarking/src/mock.rs b/substrate/frame/system/benchmarking/src/mock.rs index 9a81cddca14..edbf74a9a51 100644 --- a/substrate/frame/system/benchmarking/src/mock.rs +++ b/substrate/frame/system/benchmarking/src/mock.rs @@ -31,7 +31,7 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system, } ); diff --git a/substrate/frame/system/src/mock.rs b/substrate/frame/system/src/mock.rs index e33ac2f56c8..06527a9bb29 100644 --- a/substrate/frame/system/src/mock.rs +++ b/substrate/frame/system/src/mock.rs @@ -31,7 +31,7 @@ type Block = mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system, } ); diff --git a/substrate/frame/timestamp/src/mock.rs b/substrate/frame/timestamp/src/mock.rs index b75bcaeb0e0..5cbc5211368 100644 --- a/substrate/frame/timestamp/src/mock.rs +++ b/substrate/frame/timestamp/src/mock.rs @@ -37,8 +37,8 @@ type Moment = u64; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, } ); diff --git a/substrate/frame/tips/src/tests.rs b/substrate/frame/tips/src/tests.rs index 63ac8e37cdd..b8e528bbe7a 100644 --- a/substrate/frame/tips/src/tests.rs +++ b/substrate/frame/tips/src/tests.rs @@ -44,12 +44,12 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - Treasury1: pallet_treasury::::{Pallet, Call, Storage, Config, Event}, - Tips: pallet_tips::{Pallet, Call, Storage, Event}, - Tips1: pallet_tips::::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Treasury: pallet_treasury, + Treasury1: pallet_treasury::, + Tips: pallet_tips, + Tips1: pallet_tips::, } ); diff --git a/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs b/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs index c9b00be8e2c..03142d6ae37 100644 --- a/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs @@ -37,7 +37,7 @@ type Balance = u64; type AccountId = u64; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: system, Balances: pallet_balances, TransactionPayment: pallet_transaction_payment, diff --git a/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs b/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs index 5c540c3e459..17c4c773997 100644 --- a/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs @@ -84,7 +84,7 @@ pub mod pallet_dummy { impl pallet_dummy::Config for Runtime {} frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: system, SkipFeeless: pallet_skip_feeless_payment, DummyPallet: pallet_dummy, diff --git a/substrate/frame/transaction-payment/src/mock.rs b/substrate/frame/transaction-payment/src/mock.rs index d6686d44c80..2f025ae81d2 100644 --- a/substrate/frame/transaction-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/src/mock.rs @@ -36,8 +36,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub struct Runtime { - System: system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + System: system, + Balances: pallet_balances, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, } ); diff --git a/substrate/frame/transaction-storage/src/mock.rs b/substrate/frame/transaction-storage/src/mock.rs index a8da19a382d..4b2fe5a2a8c 100644 --- a/substrate/frame/transaction-storage/src/mock.rs +++ b/substrate/frame/transaction-storage/src/mock.rs @@ -33,11 +33,9 @@ pub type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Config, Storage, Event}, - TransactionStorage: pallet_transaction_storage::{ - Pallet, Call, Storage, Config, Inherent, Event, HoldReason - }, + System: frame_system, + Balances: pallet_balances, + TransactionStorage: pallet_transaction_storage, } ); diff --git a/substrate/frame/treasury/src/tests.rs b/substrate/frame/treasury/src/tests.rs index 093757b2770..602159262e4 100644 --- a/substrate/frame/treasury/src/tests.rs +++ b/substrate/frame/treasury/src/tests.rs @@ -47,9 +47,9 @@ type TreasuryCall = crate::Call; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Treasury: treasury::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Treasury: treasury, Utility: pallet_utility, } ); diff --git a/substrate/frame/uniques/src/mock.rs b/substrate/frame/uniques/src/mock.rs index 056c19ec559..9120108e0d4 100644 --- a/substrate/frame/uniques/src/mock.rs +++ b/substrate/frame/uniques/src/mock.rs @@ -35,9 +35,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Uniques: pallet_uniques::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Uniques: pallet_uniques, } ); diff --git a/substrate/frame/utility/src/tests.rs b/substrate/frame/utility/src/tests.rs index 7b42fa511d1..cfdbd6faf0d 100644 --- a/substrate/frame/utility/src/tests.rs +++ b/substrate/frame/utility/src/tests.rs @@ -129,14 +129,14 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Call, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - RootTesting: pallet_root_testing::{Pallet, Call, Storage, Event}, + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + RootTesting: pallet_root_testing, Council: pallet_collective::, - Utility: utility::{Pallet, Call, Event}, - Example: example::{Pallet, Call}, - Democracy: mock_democracy::{Pallet, Call, Event}, + Utility: utility, + Example: example, + Democracy: mock_democracy, } ); diff --git a/substrate/frame/vesting/src/mock.rs b/substrate/frame/vesting/src/mock.rs index 3af4a9c962d..420edd5e17a 100644 --- a/substrate/frame/vesting/src/mock.rs +++ b/substrate/frame/vesting/src/mock.rs @@ -33,9 +33,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Vesting: pallet_vesting, } ); diff --git a/substrate/primitives/api/src/lib.rs b/substrate/primitives/api/src/lib.rs index 1b8b7c40ae0..0a9b334a96f 100644 --- a/substrate/primitives/api/src/lib.rs +++ b/substrate/primitives/api/src/lib.rs @@ -282,7 +282,7 @@ pub use sp_api_proc_macro::decl_runtime_apis; /// # /// # /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro /// # /// in a real runtime. -/// # pub struct Runtime {} +/// # pub enum Runtime {} /// # /// # sp_api::decl_runtime_apis! { /// # /// Declare the api trait. @@ -361,7 +361,7 @@ pub use sp_api_proc_macro::decl_runtime_apis; /// let's say you want to implement a staging version of the runtime api and put it behind a /// feature flag. You can do it this way: /// ```ignore -/// pub struct Runtime {} +/// pub enum Runtime {} /// sp_api::decl_runtime_apis! { /// pub trait ApiWithStagingMethod { /// fn stable_one(data: u64); diff --git a/substrate/primitives/api/test/tests/decl_and_impl.rs b/substrate/primitives/api/test/tests/decl_and_impl.rs index 6e895680e41..d68470551d2 100644 --- a/substrate/primitives/api/test/tests/decl_and_impl.rs +++ b/substrate/primitives/api/test/tests/decl_and_impl.rs @@ -24,7 +24,7 @@ use substrate_test_runtime_client::runtime::{Block, Hash}; /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. -pub struct Runtime {} +pub enum Runtime {} decl_runtime_apis! { pub trait Api { diff --git a/substrate/utils/frame/rpc/support/src/lib.rs b/substrate/utils/frame/rpc/support/src/lib.rs index bb5098293c2..e3ccbd69658 100644 --- a/substrate/utils/frame/rpc/support/src/lib.rs +++ b/substrate/utils/frame/rpc/support/src/lib.rs @@ -42,8 +42,8 @@ use sp_storage::{StorageData, StorageKey}; /// # construct_runtime!( /// # pub enum TestRuntime /// # { -/// # System: frame_system::{Pallet, Call, Config, Storage, Event}, -/// # Test: pallet_test::{Pallet, Storage}, +/// # System: frame_system, +/// # Test: pallet_test, /// # } /// # ); /// # -- GitLab From e2caa813bfd2973e7a7a74aa5292433397dbc787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 22 Jan 2024 10:12:58 +0100 Subject: [PATCH 002/207] Review: Remove audit rules (#3010) Srlabs review is most of the times just blocking the merge, especially when the changes do not require any audit. This pr removes the requirement of srlabs to approve these prs. --- .github/review-bot.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/review-bot.yml b/.github/review-bot.yml index aa4ab8a69e0..ed719cefec8 100644 --- a/.github/review-bot.yml +++ b/.github/review-bot.yml @@ -20,23 +20,6 @@ rules: teams: - core-devs - - name: Audit rules - type: basic - condition: - include: - - ^polkadot/runtime/common/.* - - ^polkadot/primitives/src\/.+\.rs$ - - ^substrate/primitives/.* - - ^substrate/frame/.* - exclude: - - ^substrate\/frame\/.+\.md$ - minApprovals: 1 - allowedToSkipRule: - teams: - - core-devs - teams: - - srlabs - - name: Core developers countAuthor: true condition: -- GitLab From d53534c49e0f649e8b6b8219df5e65893ea9511d Mon Sep 17 00:00:00 2001 From: Marcin S Date: Mon, 22 Jan 2024 11:29:13 +0100 Subject: [PATCH 003/207] Enable async backing on asset-hub-rococo (#2826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The goal is to move all system chains on Rococo (+ other testnets?) to use async backing. Starting with `asset-hub-rococo` to get feedback, before I do the rest. ## Related Example: https://github.com/paritytech/polkadot-sdk/pull/1619/ Guide: https://github.com/w3f/polkadot-wiki/blob/master/docs/maintain/maintain-guides-async-backing.md --------- Co-authored-by: Branislav Kontur Co-authored-by: Dónal Murray --- Cargo.lock | 1 + cumulus/client/collator/src/lib.rs | 22 +-- .../consensus/aura/src/collators/lookahead.rs | 3 + .../assets/asset-hub-rococo/Cargo.toml | 2 + .../assets/asset-hub-rococo/src/lib.rs | 63 +++++-- .../assets/asset-hub-rococo/tests/tests.rs | 19 ++- .../assets/asset-hub-westend/src/lib.rs | 1 - .../assets/asset-hub-westend/tests/tests.rs | 19 ++- .../assets/test-utils/src/test_cases.rs | 13 +- .../test-utils/src/test_cases_over_bridge.rs | 4 +- .../bridge-hub-rococo/tests/tests.rs | 21 ++- .../bridge-hub-westend/tests/tests.rs | 19 ++- .../src/test_cases/from_grandpa_chain.rs | 6 +- .../src/test_cases/from_parachain.rs | 6 +- .../test-utils/src/test_cases/helpers.rs | 4 +- .../test-utils/src/test_cases/mod.rs | 4 +- .../parachains/runtimes/test-utils/src/lib.rs | 14 +- cumulus/polkadot-parachain/src/command.rs | 13 +- cumulus/polkadot-parachain/src/service.rs | 157 +++++++++++++++++- polkadot/node/collation-generation/src/lib.rs | 10 ++ polkadot/node/subsystem-types/src/messages.rs | 4 +- prdoc/pr_2826.prdoc | 10 ++ 22 files changed, 366 insertions(+), 49 deletions(-) create mode 100644 prdoc/pr_2826.prdoc diff --git a/Cargo.lock b/Cargo.lock index 1d404a2c231..15e3022bfb6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -864,6 +864,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "frame-benchmarking", diff --git a/cumulus/client/collator/src/lib.rs b/cumulus/client/collator/src/lib.rs index f17ae488310..83249186f62 100644 --- a/cumulus/client/collator/src/lib.rs +++ b/cumulus/client/collator/src/lib.rs @@ -242,17 +242,19 @@ pub async fn initialize_collator_subsystems( overseer_handle: &mut OverseerHandle, key: CollatorPair, para_id: ParaId, + reinitialize: bool, ) { - overseer_handle - .send_msg( - CollationGenerationMessage::Initialize(CollationGenerationConfig { - key, - para_id, - collator: None, - }), - "StartCollator", - ) - .await; + let config = CollationGenerationConfig { key, para_id, collator: None }; + + if reinitialize { + overseer_handle + .send_msg(CollationGenerationMessage::Reinitialize(config), "StartCollator") + .await; + } else { + overseer_handle + .send_msg(CollationGenerationMessage::Initialize(config), "StartCollator") + .await; + } overseer_handle .send_msg(CollatorProtocolMessage::CollateOn(para_id), "StartCollator") diff --git a/cumulus/client/consensus/aura/src/collators/lookahead.rs b/cumulus/client/consensus/aura/src/collators/lookahead.rs index 5d62094e4aa..e24b7f6f1c9 100644 --- a/cumulus/client/consensus/aura/src/collators/lookahead.rs +++ b/cumulus/client/consensus/aura/src/collators/lookahead.rs @@ -105,6 +105,8 @@ pub struct Params { pub collator_service: CS, /// The amount of time to spend authoring each block. pub authoring_duration: Duration, + /// Whether we should reinitialize the collator config (i.e. we are transitioning to aura). + pub reinitialize: bool, } /// Run async-backing-friendly Aura. @@ -149,6 +151,7 @@ where &mut params.overseer_handle, params.collator_key, params.para_id, + params.reinitialize, ) .await; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml index 5d0cb41395f..254aca90078 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml @@ -77,6 +77,7 @@ cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system cumulus-pallet-session-benchmarking = { path = "../../../../pallets/session-benchmarking", default-features = false } cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false } cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false, features = ["bridging"] } +cumulus-primitives-aura = { path = "../../../../primitives/aura", default-features = false } cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false } cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false } pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } @@ -188,6 +189,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", diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index a812e747f00..983e250d0cc 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -33,7 +33,7 @@ use assets_common::{ matching::{FromNetwork, FromSiblingParachain}, AssetIdForTrustBackedAssetsConvert, }; -use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::AggregateMessageOrigin; use parachains_common::rococo::snowbridge::EthereumNetwork; use sp_api::impl_runtime_apis; @@ -62,7 +62,7 @@ use frame_support::{ ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Equals, InstanceFilter, TransformOrigin, }, - weights::{ConstantMultiplier, Weight}, + weights::{constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight}, BoundedVec, PalletId, }; use frame_system::{ @@ -71,14 +71,13 @@ use frame_system::{ }; use pallet_asset_conversion_tx_payment::AssetConversionAdapter; use pallet_nfts::PalletFeatures; -pub use parachains_common as common; use parachains_common::{ impls::DealWithFees, message_queue::{NarrowOriginToSibling, ParaIdToSibling}, rococo::{consensus::*, currency::*, fee::WeightToFee}, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, CollectionId, Hash, Header, ItemId, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, - MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, + NORMAL_DISPATCH_RATIO, }; use sp_runtime::{Perbill, RuntimeDebug}; use xcm_config::{ @@ -141,6 +140,28 @@ pub fn native_version() -> NativeVersion { NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } } +/// We allow for 2 seconds of compute with a 6 second average block. +const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( + WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), + cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, +); + +/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included +/// into the relay chain. +const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3; +/// How many parachain blocks are processed by the relay chain per parent. Limits the +/// number of blocks authored per slot. +const BLOCK_PROCESSING_VELOCITY: u32 = 1; + +/// This determines the average expected block time that we are targeting. +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. +/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked +/// up by `pallet_aura` to implement `fn slot_duration()`. +/// +/// Change this to adjust the block time. +pub const MILLISECS_PER_BLOCK: u64 = 6000; +pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; + parameter_types! { pub const Version: RuntimeVersion = VERSION; pub RuntimeBlockLength: BlockLength = @@ -189,6 +210,9 @@ impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = Aura; + #[cfg(feature = "experimental")] + type MinimumPeriod = ConstU64<0>; + #[cfg(not(feature = "experimental"))] type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } @@ -630,15 +654,17 @@ 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 ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; } @@ -722,9 +748,9 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; - type AllowMultipleBlocksPerSlot = ConstBool; + type AllowMultipleBlocksPerSlot = ConstBool; #[cfg(feature = "experimental")] - type SlotDuration = pallet_aura::MinimumPeriodTimesTwo; + type SlotDuration = ConstU64; } parameter_types! { @@ -1067,7 +1093,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 { @@ -1075,6 +1101,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/cumulus/parachains/runtimes/assets/asset-hub-rococo/tests/tests.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/tests/tests.rs index cb7ea34a057..e7ac37b2d5c 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/tests/tests.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/tests/tests.rs @@ -28,10 +28,11 @@ use asset_hub_rococo_runtime::{ AllPalletsWithoutSystem, AssetConversion, AssetDeposit, Assets, Balances, CollatorSelection, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime, RuntimeCall, RuntimeEvent, SessionKeys, - ToWestendXcmRouterInstance, TrustBackedAssetsInstance, XcmpQueue, + ToWestendXcmRouterInstance, TrustBackedAssetsInstance, XcmpQueue, SLOT_DURATION, }; use asset_test_utils::{ - test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys, ExtBuilder, + test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys, + ExtBuilder, SlotDurations, }; use codec::{Decode, Encode}; use cumulus_primitives_utility::ChargeWeightInFungibles; @@ -46,9 +47,10 @@ use frame_support::{ weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{ - rococo::{currency::UNITS, fee::WeightToFee}, + rococo::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, currency::UNITS, fee::WeightToFee}, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, }; +use sp_consensus_aura::SlotDuration; use sp_runtime::traits::MaybeEquivalence; use std::convert::Into; use xcm::latest::prelude::{Assets as XcmAssets, *}; @@ -78,6 +80,13 @@ fn collator_session_keys() -> CollatorSessionKeys { CollatorSessionKeys::default().add(collator_session_key(ALICE)) } +fn slot_durations() -> SlotDurations { + SlotDurations { + relay: SlotDuration::from_millis(RELAY_CHAIN_SLOT_DURATION_MILLIS.into()), + para: SlotDuration::from_millis(SLOT_DURATION), + } +} + #[test] fn test_buy_and_refund_weight_in_native() { ExtBuilder::::default() @@ -892,6 +901,7 @@ asset_test_utils::include_teleports_for_native_asset_works!( WeightToFee, ParachainSystem, collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { @@ -912,6 +922,7 @@ asset_test_utils::include_teleports_for_foreign_assets_works!( ForeignCreatorsSovereignAccountOf, ForeignAssetsInstance, collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { @@ -1023,6 +1034,7 @@ fn limited_reserve_transfer_assets_for_native_asset_over_bridge_works( LocationToAccountId, >( collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), AccountId::from(ALICE), Box::new(|runtime_event_encoded: Vec| { @@ -1194,6 +1206,7 @@ mod asset_hub_rococo_tests { LocationToAccountId, >( collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), AccountId::from(ALICE), Box::new(|runtime_event_encoded: Vec| { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index b4bcc716513..e642475698e 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -55,7 +55,6 @@ use frame_system::{ use pallet_asset_conversion_tx_payment::AssetConversionAdapter; use pallet_nfts::{DestroyWitness, PalletFeatures}; use pallet_xcm::EnsureXcm; -pub use parachains_common as common; use parachains_common::{ impls::DealWithFees, message_queue::*, diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs index 3fc9f4a9658..381b2867c9c 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs @@ -32,7 +32,8 @@ use asset_hub_westend_runtime::{ }; pub use asset_hub_westend_runtime::{AssetConversion, AssetDeposit, CollatorSelection, System}; use asset_test_utils::{ - test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys, ExtBuilder, + test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys, + ExtBuilder, SlotDurations, }; use codec::{Decode, Encode}; use cumulus_primitives_utility::ChargeWeightInFungibles; @@ -47,9 +48,10 @@ use frame_support::{ weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{ - westend::{currency::UNITS, fee::WeightToFee}, - AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, + westend::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, currency::UNITS, fee::WeightToFee}, + AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, SLOT_DURATION, }; +use sp_consensus_aura::SlotDuration; use sp_runtime::traits::MaybeEquivalence; use std::convert::Into; use xcm::latest::prelude::{Assets as XcmAssets, *}; @@ -79,6 +81,13 @@ fn collator_session_keys() -> CollatorSessionKeys { CollatorSessionKeys::default().add(collator_session_key(ALICE)) } +fn slot_durations() -> SlotDurations { + SlotDurations { + relay: SlotDuration::from_millis(RELAY_CHAIN_SLOT_DURATION_MILLIS.into()), + para: SlotDuration::from_millis(SLOT_DURATION), + } +} + #[test] fn test_buy_and_refund_weight_in_native() { ExtBuilder::::default() @@ -895,6 +904,7 @@ asset_test_utils::include_teleports_for_native_asset_works!( WeightToFee, ParachainSystem, collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { @@ -915,6 +925,7 @@ asset_test_utils::include_teleports_for_foreign_assets_works!( ForeignCreatorsSovereignAccountOf, ForeignAssetsInstance, collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { @@ -1041,6 +1052,7 @@ fn limited_reserve_transfer_assets_for_native_asset_to_asset_hub_rococo_works() LocationToAccountId, >( collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), AccountId::from(ALICE), Box::new(|runtime_event_encoded: Vec| { @@ -1208,6 +1220,7 @@ fn reserve_transfer_native_asset_to_non_teleport_para_works() { LocationToAccountId, >( collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), AccountId::from(ALICE), Box::new(|runtime_event_encoded: Vec| { diff --git a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs index e981fae8015..4007d926983 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs +++ b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -31,7 +31,7 @@ use frame_system::pallet_prelude::BlockNumberFor; use parachains_common::{AccountId, Balance}; use parachains_runtimes_test_utils::{ assert_metadata, assert_total, mock_open_hrmp_channel, AccountIdOf, BalanceOf, - CollatorSessionKeys, ExtBuilder, ValidatorIdOf, XcmReceivedFrom, + CollatorSessionKeys, ExtBuilder, SlotDurations, ValidatorIdOf, XcmReceivedFrom, }; use sp_runtime::{ traits::{MaybeEquivalence, StaticLookup, Zero}, @@ -57,6 +57,7 @@ pub fn teleports_for_native_asset_works< HrmpChannelOpener, >( collator_session_keys: CollatorSessionKeys, + slot_durations: SlotDurations, existential_deposit: BalanceOf, target_account: AccountIdOf, unwrap_pallet_xcm_event: Box) -> Option>>, @@ -205,6 +206,7 @@ pub fn teleports_for_native_asset_works< None, included_head.clone(), &alice, + &slot_durations, )); // check balances @@ -257,6 +259,7 @@ pub fn teleports_for_native_asset_works< Some((runtime_para_id, other_para_id)), included_head, &alice, + &slot_durations, ), Err(DispatchError::Module(sp_runtime::ModuleError { index: 31, @@ -288,6 +291,7 @@ macro_rules! include_teleports_for_native_asset_works( $weight_to_fee:path, $hrmp_channel_opener:path, $collator_session_key:expr, + $slot_durations:expr, $existential_deposit:expr, $unwrap_pallet_xcm_event:expr, $runtime_para_id:expr @@ -306,6 +310,7 @@ macro_rules! include_teleports_for_native_asset_works( $hrmp_channel_opener >( $collator_session_key, + $slot_durations, $existential_deposit, target_account, $unwrap_pallet_xcm_event, @@ -328,6 +333,7 @@ pub fn teleports_for_foreign_assets_works< ForeignAssetsPalletInstance, >( collator_session_keys: CollatorSessionKeys, + slot_durations: SlotDurations, target_account: AccountIdOf, existential_deposit: BalanceOf, asset_owner: AccountIdOf, @@ -592,6 +598,7 @@ pub fn teleports_for_foreign_assets_works< Some((runtime_para_id, foreign_para_id)), included_head, &alice, + &slot_durations, )); // check balances @@ -644,6 +651,7 @@ macro_rules! include_teleports_for_foreign_assets_works( $sovereign_account_of:path, $assets_pallet_instance:path, $collator_session_key:expr, + $slot_durations:expr, $existential_deposit:expr, $unwrap_pallet_xcm_event:expr, $unwrap_xcmp_queue_event:expr @@ -666,6 +674,7 @@ macro_rules! include_teleports_for_foreign_assets_works( $assets_pallet_instance >( $collator_session_key, + $slot_durations, target_account, $existential_deposit, asset_owner, @@ -1397,6 +1406,7 @@ pub fn reserve_transfer_native_asset_to_non_teleport_para_works< LocationToAccountId, >( collator_session_keys: CollatorSessionKeys, + slot_durations: SlotDurations, existential_deposit: BalanceOf, alice_account: AccountIdOf, unwrap_pallet_xcm_event: Box) -> Option>>, @@ -1470,6 +1480,7 @@ pub fn reserve_transfer_native_asset_to_non_teleport_para_works< other_para_id.into(), included_head, &alice, + &slot_durations, ); // we calculate exact delivery fees _after_ sending the message by weighing the sent diff --git a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs index 878dddc9137..905703a9d16 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs +++ b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs @@ -27,7 +27,7 @@ use frame_system::pallet_prelude::BlockNumberFor; use parachains_common::{AccountId, Balance}; use parachains_runtimes_test_utils::{ mock_open_hrmp_channel, AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, RuntimeHelper, - ValidatorIdOf, XcmReceivedFrom, + SlotDurations, ValidatorIdOf, XcmReceivedFrom, }; use sp_runtime::{traits::StaticLookup, Saturating}; use sp_std::ops::Mul; @@ -52,6 +52,7 @@ pub fn limited_reserve_transfer_assets_for_native_asset_works< LocationToAccountId, >( collator_session_keys: CollatorSessionKeys, + slot_durations: SlotDurations, existential_deposit: BalanceOf, alice_account: AccountIdOf, unwrap_pallet_xcm_event: Box) -> Option>>, @@ -125,6 +126,7 @@ pub fn limited_reserve_transfer_assets_for_native_asset_works< local_bridge_hub_para_id.into(), included_head, &alice, + &slot_durations, ); // we calculate exact delivery fees _after_ sending the message by weighing the sent diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs index 63e64506ec7..9e46dc08654 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs @@ -24,9 +24,14 @@ use bridge_hub_rococo_runtime::{ Executive, ExistentialDeposit, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, SessionKeys, SignedExtra, TransactionPayment, UncheckedExtrinsic, }; +use bridge_hub_test_utils::SlotDurations; use codec::{Decode, Encode}; use frame_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8}; -use parachains_common::{rococo::fee::WeightToFee, AccountId, AuraId, Balance}; +use parachains_common::{ + rococo::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee}, + AccountId, AuraId, Balance, SLOT_DURATION, +}; +use sp_consensus_aura::SlotDuration; use sp_core::H160; use sp_keyring::AccountKeyring::Alice; use sp_runtime::{ @@ -95,6 +100,13 @@ fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys SlotDurations { + SlotDurations { + relay: SlotDuration::from_millis(RELAY_CHAIN_SLOT_DURATION_MILLIS.into()), + para: SlotDuration::from_millis(SLOT_DURATION), + } +} + bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!( Runtime, AllPalletsWithoutSystem, @@ -103,6 +115,7 @@ bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!( WeightToFee, ParachainSystem, collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { @@ -264,6 +277,7 @@ mod bridge_hub_westend_tests { ConstU8<2>, >( collator_session_keys(), + slot_durations(), bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, SIBLING_PARACHAIN_ID, Box::new(|runtime_event_encoded: Vec| { @@ -288,6 +302,7 @@ mod bridge_hub_westend_tests { // from Westend from_parachain::relayed_incoming_message_works::( collator_session_keys(), + slot_durations(), bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID, BridgeHubWestendChainId::get(), @@ -304,6 +319,7 @@ mod bridge_hub_westend_tests { // for Westend from_parachain::complex_relay_extrinsic_works::( collator_session_keys(), + slot_durations(), bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID, SIBLING_PARACHAIN_ID, @@ -459,6 +475,7 @@ mod bridge_hub_bulletin_tests { ConstU8<2>, >( collator_session_keys(), + slot_durations(), bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, SIBLING_PARACHAIN_ID, Box::new(|runtime_event_encoded: Vec| { @@ -483,6 +500,7 @@ mod bridge_hub_bulletin_tests { // from Bulletin from_grandpa_chain::relayed_incoming_message_works::( collator_session_keys(), + slot_durations(), bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, RococoBulletinChainId::get(), SIBLING_PARACHAIN_ID, @@ -498,6 +516,7 @@ mod bridge_hub_bulletin_tests { // for Bulletin from_grandpa_chain::complex_relay_extrinsic_works::( collator_session_keys(), + slot_durations(), bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, SIBLING_PARACHAIN_ID, RococoBulletinChainId::get(), diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs index 1237a231390..91d69b80420 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs @@ -18,7 +18,7 @@ use bp_polkadot_core::Signature; use bridge_common_config::{DeliveryRewardInBalance, RequiredStakeForStakeAndSlash}; -use bridge_hub_test_utils::test_cases::from_parachain; +use bridge_hub_test_utils::{test_cases::from_parachain, SlotDurations}; use bridge_hub_westend_runtime::{ bridge_common_config, bridge_to_rococo_config, xcm_config::{RelayNetwork, WestendLocation, XcmConfig}, @@ -33,7 +33,11 @@ use bridge_to_rococo_config::{ }; use codec::{Decode, Encode}; use frame_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8}; -use parachains_common::{westend::fee::WeightToFee, AccountId, AuraId, Balance}; +use parachains_common::{ + westend::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee}, + AccountId, AuraId, Balance, SLOT_DURATION, +}; +use sp_consensus_aura::SlotDuration; use sp_keyring::AccountKeyring::Alice; use sp_runtime::{ generic::{Era, SignedPayload}, @@ -111,6 +115,13 @@ fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys SlotDurations { + SlotDurations { + relay: SlotDuration::from_millis(RELAY_CHAIN_SLOT_DURATION_MILLIS.into()), + para: SlotDuration::from_millis(SLOT_DURATION), + } +} + bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!( Runtime, AllPalletsWithoutSystem, @@ -119,6 +130,7 @@ bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!( WeightToFee, ParachainSystem, collator_session_keys(), + slot_durations(), ExistentialDeposit::get(), Box::new(|runtime_event_encoded: Vec| { match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { @@ -229,6 +241,7 @@ fn message_dispatch_routing_works() { ConstU8<2>, >( collator_session_keys(), + slot_durations(), bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID, SIBLING_PARACHAIN_ID, Box::new(|runtime_event_encoded: Vec| { @@ -252,6 +265,7 @@ fn message_dispatch_routing_works() { fn relayed_incoming_message_works() { from_parachain::relayed_incoming_message_works::( collator_session_keys(), + slot_durations(), bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID, bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, BridgeHubRococoChainId::get(), @@ -267,6 +281,7 @@ fn relayed_incoming_message_works() { pub fn complex_relay_extrinsic_works() { from_parachain::complex_relay_extrinsic_works::( collator_session_keys(), + slot_durations(), bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID, bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, SIBLING_PARACHAIN_ID, diff --git a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_grandpa_chain.rs b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_grandpa_chain.rs index 5eca85d3112..acf0f2c7162 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_grandpa_chain.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_grandpa_chain.rs @@ -39,7 +39,7 @@ use bridge_runtime_common::{ use frame_support::traits::{Get, OnFinalize, OnInitialize}; use frame_system::pallet_prelude::BlockNumberFor; use parachains_runtimes_test_utils::{ - AccountIdOf, BasicParachainRuntime, CollatorSessionKeys, RuntimeCallOf, + AccountIdOf, BasicParachainRuntime, CollatorSessionKeys, RuntimeCallOf, SlotDurations, }; use sp_keyring::AccountKeyring::*; use sp_runtime::{traits::Header as HeaderT, AccountId32}; @@ -107,6 +107,7 @@ where /// Also verifies relayer transaction signed extensions work as intended. pub fn relayed_incoming_message_works( collator_session_key: CollatorSessionKeys, + slot_durations: SlotDurations, runtime_para_id: u32, bridged_chain_id: bp_runtime::ChainId, sibling_parachain_id: u32, @@ -136,6 +137,7 @@ pub fn relayed_incoming_message_works( RuntimeHelper::MPI, >( collator_session_key, + slot_durations, runtime_para_id, sibling_parachain_id, local_relay_chain_id, @@ -205,6 +207,7 @@ pub fn relayed_incoming_message_works( /// Also verifies relayer transaction signed extensions work as intended. pub fn complex_relay_extrinsic_works( collator_session_key: CollatorSessionKeys, + slot_durations: SlotDurations, runtime_para_id: u32, sibling_parachain_id: u32, bridged_chain_id: bp_runtime::ChainId, @@ -237,6 +240,7 @@ pub fn complex_relay_extrinsic_works( RuntimeHelper::MPI, >( collator_session_key, + slot_durations, runtime_para_id, sibling_parachain_id, local_relay_chain_id, diff --git a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_parachain.rs b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_parachain.rs index 6e638b7b350..8a86c5bb72f 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_parachain.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_parachain.rs @@ -40,7 +40,7 @@ use bridge_runtime_common::{ use frame_support::traits::{Get, OnFinalize, OnInitialize}; use frame_system::pallet_prelude::BlockNumberFor; use parachains_runtimes_test_utils::{ - AccountIdOf, BasicParachainRuntime, CollatorSessionKeys, RuntimeCallOf, + AccountIdOf, BasicParachainRuntime, CollatorSessionKeys, RuntimeCallOf, SlotDurations, }; use sp_keyring::AccountKeyring::*; use sp_runtime::{traits::Header as HeaderT, AccountId32}; @@ -112,6 +112,7 @@ where /// Also verifies relayer transaction signed extensions work as intended. pub fn relayed_incoming_message_works( collator_session_key: CollatorSessionKeys, + slot_durations: SlotDurations, runtime_para_id: u32, bridged_para_id: u32, bridged_chain_id: bp_runtime::ChainId, @@ -146,6 +147,7 @@ pub fn relayed_incoming_message_works( RuntimeHelper::MPI, >( collator_session_key, + slot_durations, runtime_para_id, sibling_parachain_id, local_relay_chain_id, @@ -244,6 +246,7 @@ pub fn relayed_incoming_message_works( /// Also verifies relayer transaction signed extensions work as intended. pub fn complex_relay_extrinsic_works( collator_session_key: CollatorSessionKeys, + slot_durations: SlotDurations, runtime_para_id: u32, bridged_para_id: u32, sibling_parachain_id: u32, @@ -281,6 +284,7 @@ pub fn complex_relay_extrinsic_works( RuntimeHelper::MPI, >( collator_session_key, + slot_durations, runtime_para_id, sibling_parachain_id, local_relay_chain_id, diff --git a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs index ba58aeb046e..4f634c184aa 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs @@ -31,7 +31,7 @@ use frame_system::pallet_prelude::BlockNumberFor; use pallet_bridge_grandpa::{BridgedBlockHash, BridgedHeader}; use parachains_common::AccountId; use parachains_runtimes_test_utils::{ - mock_open_hrmp_channel, AccountIdOf, CollatorSessionKeys, RuntimeCallOf, + mock_open_hrmp_channel, AccountIdOf, CollatorSessionKeys, RuntimeCallOf, SlotDurations, }; use sp_core::Get; use sp_keyring::AccountKeyring::*; @@ -220,6 +220,7 @@ pub fn relayer_id_at_bridged_chain, /// with proofs (finality, message) independently submitted. pub fn relayed_incoming_message_works( collator_session_key: CollatorSessionKeys, + slot_durations: SlotDurations, runtime_para_id: u32, sibling_parachain_id: u32, local_relay_chain_id: NetworkId, @@ -272,6 +273,7 @@ pub fn relayed_incoming_message_works( sibling_parachain_id.into(), included_head, &alice, + &slot_durations, ); // set up relayer details and proofs diff --git a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs index eb7ba132168..ce939692644 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs @@ -45,7 +45,7 @@ use frame_system::pallet_prelude::BlockNumberFor; use parachains_common::AccountId; use parachains_runtimes_test_utils::{ mock_open_hrmp_channel, AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, RuntimeCallOf, - XcmReceivedFrom, + SlotDurations, XcmReceivedFrom, }; use sp_runtime::{traits::Zero, AccountId32}; use xcm::{latest::prelude::*, AlwaysLatest}; @@ -419,6 +419,7 @@ pub fn message_dispatch_routing_works< NetworkDistanceAsParentCount, >( collator_session_key: CollatorSessionKeys, + slot_durations: SlotDurations, runtime_para_id: u32, sibling_parachain_id: u32, unwrap_cumulus_pallet_parachain_system_event: Box< @@ -529,6 +530,7 @@ pub fn message_dispatch_routing_works< sibling_parachain_id.into(), included_head, &alice, + &slot_durations, ); let result = <>::MessageDispatch>::dispatch( diff --git a/cumulus/parachains/runtimes/test-utils/src/lib.rs b/cumulus/parachains/runtimes/test-utils/src/lib.rs index 88e878c73a3..eb75c2f7ee0 100644 --- a/cumulus/parachains/runtimes/test-utils/src/lib.rs +++ b/cumulus/parachains/runtimes/test-utils/src/lib.rs @@ -29,7 +29,6 @@ use frame_support::{ weights::Weight, }; use frame_system::pallet_prelude::{BlockNumberFor, HeaderFor}; -use parachains_common::SLOT_DURATION; use polkadot_parachain_primitives::primitives::{ HeadData, HrmpChannelId, RelayChainBlockNumber, XcmpMessageFormat, }; @@ -115,6 +114,11 @@ impl, included_head: HeaderFor, slot_digest: &[u8], + slot_durations: &SlotDurations, ) -> DispatchResult where HrmpChannelOpener: frame_support::inherent::ProvideInherent< @@ -348,6 +353,7 @@ impl< target_para_id.into(), included_head, slot_digest, + slot_durations, ); } @@ -493,12 +499,12 @@ pub fn mock_open_hrmp_channel< recipient: ParaId, included_head: HeaderFor, mut slot_digest: &[u8], + slot_durations: &SlotDurations, ) { - const RELAY_CHAIN_SLOT_DURATION: SlotDuration = SlotDuration::from_millis(6000); let slot = Slot::decode(&mut slot_digest).expect("failed to decode digest"); // Convert para slot to relay chain. - let timestamp = slot.saturating_mul(SLOT_DURATION); - let relay_slot = Slot::from_timestamp(timestamp.into(), RELAY_CHAIN_SLOT_DURATION); + let timestamp = slot.saturating_mul(slot_durations.para.as_millis()); + let relay_slot = Slot::from_timestamp(timestamp.into(), slot_durations.relay); let n = 1_u32; let mut sproof_builder = RelayStateSproofBuilder { diff --git a/cumulus/polkadot-parachain/src/command.rs b/cumulus/polkadot-parachain/src/command.rs index 04d618f66c7..a7319b6dfbb 100644 --- a/cumulus/polkadot-parachain/src/command.rs +++ b/cumulus/polkadot-parachain/src/command.rs @@ -695,9 +695,7 @@ pub fn run() -> Result<()> { .map(|r| r.0) .map_err(Into::into), - AssetHubKusama | - AssetHubRococo | - AssetHubWestend => + AssetHubKusama | AssetHubWestend => crate::service::start_asset_hub_node::< RuntimeApi, AuraId, @@ -706,6 +704,15 @@ pub fn run() -> Result<()> { .map(|r| r.0) .map_err(Into::into), + AssetHubRococo => + crate::service::start_asset_hub_lookahead_node::< + RuntimeApi, + AuraId, + >(config, polkadot_config, collator_options, id, hwbench) + .await + .map(|r| r.0) + .map_err(Into::into), + CollectivesPolkadot | CollectivesWestend => crate::service::start_generic_aura_node::< RuntimeApi, diff --git a/cumulus/polkadot-parachain/src/service.rs b/cumulus/polkadot-parachain/src/service.rs index 81d0c9d3980..61b9cbbd80d 100644 --- a/cumulus/polkadot-parachain/src/service.rs +++ b/cumulus/polkadot-parachain/src/service.rs @@ -976,6 +976,7 @@ pub async fn start_rococo_parachain_node( proposer, collator_service, authoring_duration: Duration::from_millis(1500), + reinitialize: false, }; let fut = aura::run::< @@ -1291,7 +1292,7 @@ where Ok(BasicQueue::new(verifier, Box::new(block_import), None, &spawner, registry)) } -/// Start an aura powered parachain node. Asset Hub and Collectives use this. +/// Start an aura powered parachain node. Collectives uses this. pub async fn start_generic_aura_node( parachain_config: Configuration, polkadot_config: Configuration, @@ -1530,6 +1531,159 @@ where .await } +/// Start a shell node which should later transition into an Aura powered parachain node. Asset Hub +/// uses this because at genesis, Asset Hub was on the `shell` runtime which didn't have Aura and +/// needs to sync and upgrade before it can run `AuraApi` functions. +/// +/// Uses the lookahead collator to support async backing. +#[sc_tracing::logging::prefix_logs_with("Parachain")] +pub async fn start_asset_hub_lookahead_node( + parachain_config: Configuration, + polkadot_config: Configuration, + collator_options: CollatorOptions, + para_id: ParaId, + hwbench: Option, +) -> sc_service::error::Result<(TaskManager, Arc>)> +where + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi::RuntimeApi: sp_transaction_pool::runtime_api::TaggedTransactionQueue + + sp_api::Metadata + + sp_session::SessionKeys + + sp_api::ApiExt + + sp_offchain::OffchainWorkerApi + + sp_block_builder::BlockBuilder + + cumulus_primitives_core::CollectCollationInfo + + sp_consensus_aura::AuraApi::Pair as Pair>::Public> + + pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi + + frame_rpc_system::AccountNonceApi + + cumulus_primitives_aura::AuraUnincludedSegmentApi, + <::Pair as Pair>::Signature: + TryFrom> + std::hash::Hash + sp_runtime::traits::Member + Codec, +{ + start_node_impl::( + parachain_config, + polkadot_config, + collator_options, + CollatorSybilResistance::Resistant, // Aura + para_id, + |_| Ok(RpcModule::new(())), + aura_build_import_queue::<_, AuraId>, + |client, + block_import, + prometheus_registry, + telemetry, + task_manager, + relay_chain_interface, + transaction_pool, + sync_oracle, + keystore, + relay_chain_slot_duration, + para_id, + collator_key, + overseer_handle, + announce_block, + backend| { + let relay_chain_interface2 = relay_chain_interface.clone(); + + let collator_service = CollatorService::new( + client.clone(), + Arc::new(task_manager.spawn_handle()), + announce_block, + client.clone(), + ); + + let spawner = task_manager.spawn_handle(); + + let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( + spawner, + client.clone(), + transaction_pool, + prometheus_registry, + telemetry.clone(), + ); + + let collation_future = Box::pin(async move { + // Start collating with the `shell` runtime while waiting for an upgrade to an Aura + // compatible runtime. + let mut request_stream = cumulus_client_collator::relay_chain_driven::init( + collator_key.clone(), + para_id, + overseer_handle.clone(), + ) + .await; + while let Some(request) = request_stream.next().await { + let pvd = request.persisted_validation_data().clone(); + let last_head_hash = + match ::Header::decode(&mut &pvd.parent_head.0[..]) { + Ok(header) => header.hash(), + Err(e) => { + log::error!("Could not decode the head data: {e}"); + request.complete(None); + continue + }, + }; + + // Check if we have upgraded to an Aura compatible runtime and transition if + // necessary. + if client + .runtime_api() + .has_api::>(last_head_hash) + .unwrap_or(false) + { + // Respond to this request before transitioning to Aura. + request.complete(None); + break + } + } + + // Move to Aura consensus. + let slot_duration = match cumulus_client_consensus_aura::slot_duration(&*client) { + Ok(d) => d, + Err(e) => { + log::error!("Could not get Aura slot duration: {e}"); + return + }, + }; + + let proposer = Proposer::new(proposer_factory); + + let params = AuraParams { + create_inherent_data_providers: move |_, ()| async move { Ok(()) }, + block_import, + para_client: client.clone(), + para_backend: backend, + relay_client: relay_chain_interface2, + code_hash_provider: move |block_hash| { + client.code_at(block_hash).ok().map(|c| ValidationCode::from(c).hash()) + }, + sync_oracle, + keystore, + collator_key, + para_id, + overseer_handle, + slot_duration, + relay_chain_slot_duration, + proposer, + collator_service, + authoring_duration: Duration::from_millis(1500), + reinitialize: true, /* we need to always re-initialize for asset-hub moving + * to aura */ + }; + + aura::run::::Pair, _, _, _, _, _, _, _, _, _>(params) + .await + }); + + let spawner = task_manager.spawn_essential_handle(); + spawner.spawn_essential("cumulus-asset-hub-collator", None, collation_future); + + Ok(()) + }, + hwbench, + ) + .await +} + /// Start an aura powered parachain node which uses the lookahead collator to support async backing. /// This node is basic in the sense that its runtime api doesn't include common contents such as /// transaction payment. Used for aura glutton. @@ -1615,6 +1769,7 @@ where proposer, collator_service, authoring_duration: Duration::from_millis(1500), + reinitialize: false, }; let fut = diff --git a/polkadot/node/collation-generation/src/lib.rs b/polkadot/node/collation-generation/src/lib.rs index b8c9c1a36e4..cfa75d7b441 100644 --- a/polkadot/node/collation-generation/src/lib.rs +++ b/polkadot/node/collation-generation/src/lib.rs @@ -143,6 +143,16 @@ impl CollationGenerationSubsystem { } false }, + Ok(FromOrchestra::Communication { + msg: CollationGenerationMessage::Reinitialize(config), + }) => { + if self.config.is_none() { + gum::error!(target: LOG_TARGET, "no initial initialization"); + } else { + self.config = Some(Arc::new(config)); + } + false + }, Ok(FromOrchestra::Communication { msg: CollationGenerationMessage::SubmitCollation(params), }) => { diff --git a/polkadot/node/subsystem-types/src/messages.rs b/polkadot/node/subsystem-types/src/messages.rs index c7675c84b91..1d5d82b57fd 100644 --- a/polkadot/node/subsystem-types/src/messages.rs +++ b/polkadot/node/subsystem-types/src/messages.rs @@ -830,8 +830,10 @@ pub enum ProvisionerMessage { /// Message to the Collation Generation subsystem. #[derive(Debug)] pub enum CollationGenerationMessage { - /// Initialize the collation generation subsystem + /// Initialize the collation generation subsystem. Initialize(CollationGenerationConfig), + /// Reinitialize the collation generation subsystem, overriding the existing config. + Reinitialize(CollationGenerationConfig), /// Submit a collation to the subsystem. This will package it into a signed /// [`CommittedCandidateReceipt`] and distribute along the network to validators. /// diff --git a/prdoc/pr_2826.prdoc b/prdoc/pr_2826.prdoc new file mode 100644 index 00000000000..70de795a100 --- /dev/null +++ b/prdoc/pr_2826.prdoc @@ -0,0 +1,10 @@ +title: Enable async backing on asset-hub-rococo + +doc: + - audience: Runtime User + description: | + Async backing has been enabled on Asset Hub Rococo, which now targets 6s block times. + +crates: + - name: asset-hub-rococo-runtime + - name: polkadot-parachain-bin \ No newline at end of file -- GitLab From deb72f432dd8adf25fb58db7c3a21d747274c5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 22 Jan 2024 11:31:37 +0100 Subject: [PATCH 004/207] sc-informant: Respect `--disable-log-color` (#3009) Changes `sc-informant` to respect the `--disable-log-color` CLI flag. Closes: https://github.com/paritytech/polkadot-sdk/issues/2795 --------- Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> --- prdoc/pr_3009.prdoc | 10 ++++ substrate/client/cli/src/config.rs | 6 +-- substrate/client/informant/src/display.rs | 45 ++++++------------ substrate/client/informant/src/lib.rs | 58 ++++++++++++++++++++--- substrate/client/service/src/config.rs | 8 ++-- 5 files changed, 82 insertions(+), 45 deletions(-) create mode 100644 prdoc/pr_3009.prdoc diff --git a/prdoc/pr_3009.prdoc b/prdoc/pr_3009.prdoc new file mode 100644 index 00000000000..2a55f3d7d32 --- /dev/null +++ b/prdoc/pr_3009.prdoc @@ -0,0 +1,10 @@ +title: "sc-informant: Respect `--disable-log-color`" + +doc: + - audience: Node Operator + description: | + Fixes some places that weren't respecting the `--disable-log-color` CLI flag. + +crates: + - name: "sc-informant" + - name: "sc-service" diff --git a/substrate/client/cli/src/config.rs b/substrate/client/cli/src/config.rs index b842df5a690..170173c8c28 100644 --- a/substrate/client/cli/src/config.rs +++ b/substrate/client/cli/src/config.rs @@ -27,8 +27,8 @@ use names::{Generator, Name}; use sc_service::{ config::{ BasePath, Configuration, DatabaseSource, KeystoreConfig, NetworkConfiguration, - NodeKeyConfig, OffchainWorkerConfig, PrometheusConfig, PruningMode, Role, RpcMethods, - TelemetryEndpoints, TransactionPoolOptions, WasmExecutionMethod, + NodeKeyConfig, OffchainWorkerConfig, OutputFormat, PrometheusConfig, PruningMode, Role, + RpcMethods, TelemetryEndpoints, TransactionPoolOptions, WasmExecutionMethod, }, BlocksPruning, ChainSpec, TracingReceiver, }; @@ -516,7 +516,7 @@ pub trait CliConfiguration: Sized { announce_block: self.announce_block()?, role, base_path, - informant_output_format: Default::default(), + informant_output_format: OutputFormat { enable_color: !self.disable_log_color()? }, runtime_cache_size, }) } diff --git a/substrate/client/informant/src/display.rs b/substrate/client/informant/src/display.rs index bcf3794032f..cdbb83b6596 100644 --- a/substrate/client/informant/src/display.rs +++ b/substrate/client/informant/src/display.rs @@ -142,37 +142,20 @@ impl InformantDisplay { ("⚙️ ", format!("Preparing{}", speed), format!(", target=#{target}")), }; - if self.format.enable_color { - info!( - target: "substrate", - "{} {}{} ({} peers), best: #{} ({}), finalized #{} ({}), {} {}", - level, - Colour::White.bold().paint(&status), - target, - Colour::White.bold().paint(format!("{}", num_connected_peers)), - Colour::White.bold().paint(format!("{}", best_number)), - best_hash, - Colour::White.bold().paint(format!("{}", finalized_number)), - info.chain.finalized_hash, - Colour::Green.paint(format!("⬇ {}", TransferRateFormat(avg_bytes_per_sec_inbound))), - Colour::Red.paint(format!("⬆ {}", TransferRateFormat(avg_bytes_per_sec_outbound))), - ) - } else { - info!( - target: "substrate", - "{} {}{} ({} peers), best: #{} ({}), finalized #{} ({}), ⬇ {} ⬆ {}", - level, - status, - target, - num_connected_peers, - best_number, - best_hash, - finalized_number, - info.chain.finalized_hash, - TransferRateFormat(avg_bytes_per_sec_inbound), - TransferRateFormat(avg_bytes_per_sec_outbound), - ) - } + info!( + target: "substrate", + "{} {}{} ({} peers), best: #{} ({}), finalized #{} ({}), {} {}", + level, + self.format.print_with_color(Colour::White.bold(), status), + target, + self.format.print_with_color(Colour::White.bold(), num_connected_peers), + self.format.print_with_color(Colour::White.bold(), best_number), + best_hash, + self.format.print_with_color(Colour::White.bold(), finalized_number), + info.chain.finalized_hash, + self.format.print_with_color(Colour::Green, format!("⬇ {}", TransferRateFormat(avg_bytes_per_sec_inbound))), + self.format.print_with_color(Colour::Red, format!("⬆ {}", TransferRateFormat(avg_bytes_per_sec_outbound))), + ) } } diff --git a/substrate/client/informant/src/lib.rs b/substrate/client/informant/src/lib.rs index b072f8551f9..7db80bb2d97 100644 --- a/substrate/client/informant/src/lib.rs +++ b/substrate/client/informant/src/lib.rs @@ -18,7 +18,7 @@ //! Console informant. Prints sync progress and block events. Runs on the calling thread. -use ansi_term::Colour; +use ansi_term::{Colour, Style}; use futures::prelude::*; use futures_timer::Delay; use log::{debug, info, trace}; @@ -51,6 +51,47 @@ impl Default for OutputFormat { } } +enum ColorOrStyle { + Color(Colour), + Style(Style), +} + +impl From for ColorOrStyle { + fn from(value: Colour) -> Self { + Self::Color(value) + } +} + +impl From