diff --git a/cumulus/parachain-template/runtime/src/lib.rs b/cumulus/parachain-template/runtime/src/lib.rs index 8af46f9f7180..bf1cdf7ab74d 100644 --- a/cumulus/parachain-template/runtime/src/lib.rs +++ b/cumulus/parachain-template/runtime/src/lib.rs @@ -273,43 +273,13 @@ parameter_types! { pub const SS58Prefix: u16 = 42; } -// Configure FRAME pallets to include in runtime. +/// Configure FRAME pallets to include in runtime. +/// +/// The default types are being injected by [`derive_impl`](`frame_support::derive_impl`) from +/// [`ParaChainDefaultConfig`](`struct@frame_system::config_preludes::ParaChainDefaultConfig`), +/// but overridden as needed. #[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { - /// The following are being injected by [`derive_impl`](`frame_support::derive_impl`) from - /// [`ParaChainDefaultConfig`](`struct@frame_system::config_preludes::ParaChainDefaultConfig`), - /// but can be overridden if needed. - /// - /// The aggregated dispatch type that is available for extrinsics. - /// type RuntimeCall = RuntimeCall; - /// - /// The ubiquitous event type. - /// type RuntimeEvent = RuntimeEvent; - /// - /// The ubiquitous origin type. - /// type RuntimeOrigin = RuntimeOrigin; - /// - /// Converts a module to an index of this module in the runtime. - /// type PalletInfo = PalletInfo; - /// - /// The basic call filter to use in dispatchable. - /// type BaseCallFilter = Everything; - /// - /// Weight information for the extrinsics of this pallet. - /// type SystemWeightInfo = (); - /// - /// What to do if a new account is created. - /// type OnNewAccount = (); - /// - /// What to do if an account is fully reaped from the system. - /// type OnKilledAccount = (); - /// - /// The hashing algorithm used. - /// type Hashing = BlakeTwo256; - /// - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - /// type Lookup = AccountIdLookup; - /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The index type for storing how many extrinsics an account has signed. diff --git a/substrate/bin/node-template/runtime/src/lib.rs b/substrate/bin/node-template/runtime/src/lib.rs index 077b7c24d2dc..2587b6a83326 100644 --- a/substrate/bin/node-template/runtime/src/lib.rs +++ b/substrate/bin/node-template/runtime/src/lib.rs @@ -12,9 +12,7 @@ use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, One, Verify, - }, + traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, One, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, MultiSignature, }; @@ -151,45 +149,13 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } -// Configure FRAME pallets to include in runtime. - +/// Configure FRAME pallets to include in runtime. +/// +/// The default types are being injected by [`derive_impl`](`frame_support::derive_impl`) from +/// [`SoloChainDefaultConfig`](`struct@frame_system::config_preludes::SolochainDefaultConfig`), +/// but overridden as needed. #[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { - /// The following are being injected by [`derive_impl`](`frame_support::derive_impl`) from - /// [`SoloChainDefaultConfig`](`struct@frame_system::config_preludes::SolochainDefaultConfig`), - /// but can be overridden if needed. - /// - /// The ubiquitous event type. - /// type RuntimeEvent = RuntimeEvent; - /// - /// The aggregated dispatch type that is available for extrinsics. - /// type RuntimeCall = RuntimeCall; - /// - /// The ubiquitous origin type. - /// type RuntimeOrigin = RuntimeOrigin; - /// - /// Converts a module to the index of the module in `construct_runtime!`. - /// - /// This type is being generated by `construct_runtime!`. - /// type PalletInfo = PalletInfo; - /// - /// What to do if a new account is created. - /// type OnNewAccount = (); - /// - /// What to do if an account is fully reaped from the system. - /// type OnKilledAccount = (); - /// - /// The set code logic, just the default since we're not a parachain. - /// type OnSetCode = (); - /// - /// The hashing algorithm used. - /// type Hashing = BlakeTwo256; - /// - /// Weight information for the extrinsics of this pallet. - /// type SystemWeightInfo = (); - - /// The basic call filter to use in dispatchable. - type BaseCallFilter = frame_support::traits::Everything; /// The block type for the runtime. type Block = Block; /// Block & extrinsics weights: base values and limits. @@ -198,8 +164,6 @@ impl frame_system::Config for Runtime { type BlockLength = BlockLength; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; /// The type for storing how many extrinsics an account has signed. type Nonce = Nonce; /// The type for hashing blocks and tries. diff --git a/substrate/frame/system/src/lib.rs b/substrate/frame/system/src/lib.rs index a5ec5fe2b901..0fcecaaae31a 100644 --- a/substrate/frame/system/src/lib.rs +++ b/substrate/frame/system/src/lib.rs @@ -263,31 +263,76 @@ pub mod pallet { #[frame_support::register_default_impl(SolochainDefaultConfig)] impl DefaultConfig for SolochainDefaultConfig { + /// The default type for storing how many extrinsics an account has signed. type Nonce = u32; + + /// The default type for hashing blocks and tries. type Hash = sp_core::hash::H256; + + /// The default hashing algorithm used. type Hashing = sp_runtime::traits::BlakeTwo256; + + /// The default identifier used to distinguish between accounts. type AccountId = sp_runtime::AccountId32; + + /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = sp_runtime::traits::AccountIdLookup; + + /// The maximum number of consumers allowed on a single account. Using 128 as default. type MaxConsumers = frame_support::traits::ConstU32<128>; + + /// The default data to be stored in an account. type AccountData = crate::AccountInfo; + + /// What to do if a new account is created. type OnNewAccount = (); + + /// What to do if an account is fully reaped from the system. type OnKilledAccount = (); + + /// Weight information for the extrinsics of this pallet. type SystemWeightInfo = (); + + /// This is used as an identifier of the chain. type SS58Prefix = (); + + /// Version of the runtime. type Version = (); + + /// Block & extrinsics weights: base values and limits. type BlockWeights = (); + + /// The maximum length of a block (in bytes). type BlockLength = (); + + /// The weight of database operations that the runtime can invoke. type DbWeight = (); + + /// The ubiquitous event type injected by `construct_runtime!`. #[inject_runtime_type] type RuntimeEvent = (); + + /// The ubiquitous origin type injected by `construct_runtime!`. #[inject_runtime_type] type RuntimeOrigin = (); + + /// The aggregated dispatch type available for extrinsics, injected by + /// `construct_runtime!`. #[inject_runtime_type] type RuntimeCall = (); + + /// Converts a module to the index of the module, injected by `construct_runtime!`. #[inject_runtime_type] type PalletInfo = (); + + /// The basic call filter to use in dispatchable. Supports everything as the default. type BaseCallFilter = frame_support::traits::Everything; + + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + /// Using 256 as default. type BlockHashCount = frame_support::traits::ConstU32<256>; + + /// The set code logic, just the default since we're not a parachain. type OnSetCode = (); }