diff --git a/Cargo.lock b/Cargo.lock index cb4e085218e5..d5624f2c0aaa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5196,6 +5196,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -17806,6 +17807,7 @@ dependencies = [ "primitive-types", "scale-info", "sp-arithmetic", + "sp-core", "sp-io", "sp-runtime", "sp-std", diff --git a/bridges/bin/runtime-common/src/mock.rs b/bridges/bin/runtime-common/src/mock.rs index 45ef790d7448..53a68726c105 100644 --- a/bridges/bin/runtime-common/src/mock.rs +++ b/bridges/bin/runtime-common/src/mock.rs @@ -144,6 +144,7 @@ parameter_types! { pub const MaxUnrewardedRelayerEntriesAtInboundLane: MessageNonce = 16; pub const MaxUnconfirmedMessagesAtInboundLane: MessageNonce = 1_000; pub const ReserveId: [u8; 8] = *b"brdgrlrs"; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for TestRuntime { @@ -170,6 +171,7 @@ impl frame_system::Config for TestRuntime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_utility::Config for TestRuntime { diff --git a/bridges/modules/grandpa/src/mock.rs b/bridges/modules/grandpa/src/mock.rs index f88a0a3e6a6e..41cf2866b6c5 100644 --- a/bridges/modules/grandpa/src/mock.rs +++ b/bridges/modules/grandpa/src/mock.rs @@ -53,6 +53,7 @@ parameter_types! { pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0); pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for TestRuntime { @@ -79,6 +80,7 @@ impl frame_system::Config for TestRuntime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/bridges/modules/messages/src/mock.rs b/bridges/modules/messages/src/mock.rs index aebb7eafa787..50b4b613a51a 100644 --- a/bridges/modules/messages/src/mock.rs +++ b/bridges/modules/messages/src/mock.rs @@ -89,6 +89,7 @@ parameter_types! { pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0); pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } pub type DbWeight = RocksDbWeight; @@ -117,6 +118,7 @@ impl frame_system::Config for TestRuntime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for TestRuntime { diff --git a/bridges/modules/parachains/src/mock.rs b/bridges/modules/parachains/src/mock.rs index 14afe3841710..6735131ddde9 100644 --- a/bridges/modules/parachains/src/mock.rs +++ b/bridges/modules/parachains/src/mock.rs @@ -157,6 +157,7 @@ parameter_types! { pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0); pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for TestRuntime { @@ -183,6 +184,7 @@ impl frame_system::Config for TestRuntime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/bridges/modules/relayers/src/mock.rs b/bridges/modules/relayers/src/mock.rs index 4713ec91658a..aaef649dc649 100644 --- a/bridges/modules/relayers/src/mock.rs +++ b/bridges/modules/relayers/src/mock.rs @@ -59,6 +59,7 @@ parameter_types! { pub const ReserveId: [u8; 8] = *b"brdgrlrs"; pub const Stake: Balance = 1_000; pub const Lease: BlockNumber = 8; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for TestRuntime { @@ -85,6 +86,7 @@ impl frame_system::Config for TestRuntime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for TestRuntime { diff --git a/bridges/modules/xcm-bridge-hub-router/src/mock.rs b/bridges/modules/xcm-bridge-hub-router/src/mock.rs index 58df21a6d901..453e38d9ab7f 100644 --- a/bridges/modules/xcm-bridge-hub-router/src/mock.rs +++ b/bridges/modules/xcm-bridge-hub-router/src/mock.rs @@ -55,6 +55,7 @@ parameter_types! { pub BridgeFeeAsset: AssetId = MultiLocation::parent().into(); pub BridgeTable: Vec<(NetworkId, MultiLocation, Option)> = vec![(BridgedNetworkId::get(), SiblingBridgeHubLocation::get(), Some((BridgeFeeAsset::get(), BASE_FEE).into()))]; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for TestRuntime { @@ -81,6 +82,7 @@ impl frame_system::Config for TestRuntime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_xcm_bridge_hub_router::Config<()> for TestRuntime { diff --git a/cumulus/client/relay-chain-minimal-node/src/network.rs b/cumulus/client/relay-chain-minimal-node/src/network.rs index f39d7a26dd88..2a36c3a8109e 100644 --- a/cumulus/client/relay-chain-minimal-node/src/network.rs +++ b/cumulus/client/relay-chain-minimal-node/src/network.rs @@ -153,6 +153,7 @@ fn get_block_announce_proto_config( best_number, best_hash, genesis_hash, + true, ))), // NOTE: `set_config` will be ignored by `protocol.rs` as the block announcement // protocol is still hardcoded into the peerset. diff --git a/cumulus/client/service/src/lib.rs b/cumulus/client/service/src/lib.rs index 9f1b6762450b..44fd858a4e32 100644 --- a/cumulus/client/service/src/lib.rs +++ b/cumulus/client/service/src/lib.rs @@ -50,7 +50,10 @@ use sp_api::ProvideRuntimeApi; use sp_blockchain::{HeaderBackend, HeaderMetadata}; use sp_core::{traits::SpawnNamed, Decode}; use sp_runtime::traits::{Block as BlockT, BlockIdTo}; -use std::{sync::Arc, time::Duration}; +use std::{ + sync::{atomic::Ordering, Arc}, + time::Duration, +}; // Given the sporadic nature of the explicit recovery operation and the // possibility to retry infinite times this value is more than enough. @@ -451,7 +454,7 @@ where RCInterface: RelayChainInterface + Clone + 'static, IQ: ImportQueue + 'static, { - let warp_sync_params = match parachain_config.network.sync_mode { + let warp_sync_params = match parachain_config.network.sync_mode.load(Ordering::Relaxed) { SyncMode::Warp => { let target_block = warp_sync_get::( para_id, @@ -484,7 +487,7 @@ where import_queue, block_announce_validator_builder: Some(Box::new(move |_| block_announce_validator)), warp_sync_params, - block_relay: None, + block_relay: None, }) } diff --git a/cumulus/pallets/collator-selection/src/mock.rs b/cumulus/pallets/collator-selection/src/mock.rs index 44d531c971ee..7839e877780e 100644 --- a/cumulus/pallets/collator-selection/src/mock.rs +++ b/cumulus/pallets/collator-selection/src/mock.rs @@ -48,6 +48,7 @@ frame_support::construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl system::Config for Test { @@ -74,6 +75,7 @@ impl system::Config for Test { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/cumulus/pallets/dmp-queue/src/lib.rs b/cumulus/pallets/dmp-queue/src/lib.rs index eff4a625ef1b..e52ab9b38009 100644 --- a/cumulus/pallets/dmp-queue/src/lib.rs +++ b/cumulus/pallets/dmp-queue/src/lib.rs @@ -449,6 +449,7 @@ mod tests { pub const ParachainId: ParaId = ParaId::new(200); pub const ReservedXcmpWeight: Weight = Weight::zero(); pub const ReservedDmpWeight: Weight = Weight::zero(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } type AccountId = u64; @@ -477,6 +478,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } thread_local! { diff --git a/cumulus/pallets/parachain-system/src/tests.rs b/cumulus/pallets/parachain-system/src/tests.rs index 626196790bc9..ba21ea7f12f3 100755 --- a/cumulus/pallets/parachain-system/src/tests.rs +++ b/cumulus/pallets/parachain-system/src/tests.rs @@ -71,7 +71,9 @@ parameter_types! { pub const ParachainId: ParaId = ParaId::new(200); pub const ReservedXcmpWeight: Weight = Weight::zero(); pub const ReservedDmpWeight: Weight = Weight::zero(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } + impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; @@ -96,6 +98,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl Config for Test { type RuntimeEvent = RuntimeEvent; diff --git a/cumulus/pallets/xcmp-queue/src/mock.rs b/cumulus/pallets/xcmp-queue/src/mock.rs index a3f10fa5428c..1ede14134656 100644 --- a/cumulus/pallets/xcmp-queue/src/mock.rs +++ b/cumulus/pallets/xcmp-queue/src/mock.rs @@ -50,6 +50,7 @@ frame_support::construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } type AccountId = u64; @@ -78,6 +79,7 @@ impl frame_system::Config for Test { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/cumulus/parachain-template/pallets/template/src/mock.rs b/cumulus/parachain-template/pallets/template/src/mock.rs index 8fae1019f42d..1eebbf66f999 100644 --- a/cumulus/parachain-template/pallets/template/src/mock.rs +++ b/cumulus/parachain-template/pallets/template/src/mock.rs @@ -20,6 +20,7 @@ frame_support::construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl system::Config for Test { @@ -46,6 +47,7 @@ impl system::Config for Test { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl crate::Config for Test { diff --git a/cumulus/parachain-template/runtime/src/lib.rs b/cumulus/parachain-template/runtime/src/lib.rs index 038597096f6a..112c1e5452af 100644 --- a/cumulus/parachain-template/runtime/src/lib.rs +++ b/cumulus/parachain-template/runtime/src/lib.rs @@ -268,6 +268,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u16 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -318,6 +319,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/common/src/impls.rs b/cumulus/parachains/common/src/impls.rs index 107cd5c68732..169999f75efc 100644 --- a/cumulus/parachains/common/src/impls.rs +++ b/cumulus/parachains/common/src/impls.rs @@ -153,6 +153,7 @@ mod tests { pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024); pub const AvailableBlockRatio: Perbill = Perbill::one(); pub const MaxReserves: u32 = 50; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -179,6 +180,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs index 828d1b4750a3..dc2d9f1fa4a2 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs @@ -163,6 +163,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 2; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -190,6 +191,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs index 0051af21f9a3..7db0361b98b1 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs @@ -173,6 +173,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 0; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -200,6 +201,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { 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 4887fce1b0a4..3ee59fd5ed4f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -142,6 +142,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -169,6 +170,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 54b15e6b327b..b1d5da722c9a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -165,6 +165,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 2; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -214,6 +215,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs index dbfdc249a3cd..a461ca52d5c5 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -165,6 +165,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 0; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -214,6 +215,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { 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 309a5cfb0b1d..454a2caf307d 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 @@ -181,6 +181,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u16 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -231,6 +232,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 238db08a0c9e..cf0e2264efff 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -149,6 +149,7 @@ parameter_types! { }) .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -176,6 +177,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = ConstU16<0>; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 399ada1be2c7..dd3dfa59683c 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -163,6 +163,7 @@ parameter_types! { }) .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -190,6 +191,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = ConstU16<42>; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs index dde8f747d463..b792bd4b94da 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs @@ -136,6 +136,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 2; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -162,6 +163,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs index 5f6733faf706..c9775c203540 100644 --- a/cumulus/parachains/runtimes/starters/seedling/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/seedling/src/lib.rs @@ -116,7 +116,9 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } + impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; @@ -153,6 +155,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_sudo::Config for Runtime { diff --git a/cumulus/parachains/runtimes/starters/shell/src/lib.rs b/cumulus/parachains/runtimes/starters/shell/src/lib.rs index ef914a246efc..e5bb1f2e2330 100644 --- a/cumulus/parachains/runtimes/starters/shell/src/lib.rs +++ b/cumulus/parachains/runtimes/starters/shell/src/lib.rs @@ -123,6 +123,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -161,6 +162,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index 9a758cdd9782..307dbcfd64b0 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -314,6 +314,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u16 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -364,6 +365,7 @@ impl frame_system::Config for Runtime { /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 362ad0383a23..7974583262c8 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -177,6 +177,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -215,6 +216,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/cumulus/test/runtime/src/lib.rs b/cumulus/test/runtime/src/lib.rs index ccf624c0ffa4..e7489dcbba33 100644 --- a/cumulus/test/runtime/src/lib.rs +++ b/cumulus/test/runtime/src/lib.rs @@ -178,6 +178,7 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -215,6 +216,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index 58535944a22e..75e853d0ef85 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -894,7 +894,7 @@ pub fn new_full( import_queue, block_announce_validator_builder: None, warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)), - block_relay: None, + block_relay: None, })?; if config.offchain_worker.enabled { diff --git a/polkadot/runtime/common/src/assigned_slots/mod.rs b/polkadot/runtime/common/src/assigned_slots/mod.rs index cc8ec339c118..65a428a3d35f 100644 --- a/polkadot/runtime/common/src/assigned_slots/mod.rs +++ b/polkadot/runtime/common/src/assigned_slots/mod.rs @@ -678,6 +678,7 @@ mod tests { parameter_types! { pub const BlockHashCount: u32 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -703,6 +704,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/common/src/auctions.rs b/polkadot/runtime/common/src/auctions.rs index e35303912fa1..e06879ac2c64 100644 --- a/polkadot/runtime/common/src/auctions.rs +++ b/polkadot/runtime/common/src/auctions.rs @@ -704,6 +704,7 @@ mod tests { parameter_types! { pub const BlockHashCount: u32 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -729,6 +730,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/common/src/claims.rs b/polkadot/runtime/common/src/claims.rs index 0c736a632842..b24d5dcaf994 100644 --- a/polkadot/runtime/common/src/claims.rs +++ b/polkadot/runtime/common/src/claims.rs @@ -738,6 +738,7 @@ mod tests { parameter_types! { pub const BlockHashCount: u32 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -763,6 +764,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/common/src/crowdloan/mod.rs b/polkadot/runtime/common/src/crowdloan/mod.rs index 5a2939145925..bc7d67762dc2 100644 --- a/polkadot/runtime/common/src/crowdloan/mod.rs +++ b/polkadot/runtime/common/src/crowdloan/mod.rs @@ -896,6 +896,7 @@ mod tests { parameter_types! { pub const BlockHashCount: u32 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } type BlockNumber = u64; @@ -924,6 +925,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/common/src/impls.rs b/polkadot/runtime/common/src/impls.rs index 0d0dee2e9ad9..0a5d867f5e3a 100644 --- a/polkadot/runtime/common/src/impls.rs +++ b/polkadot/runtime/common/src/impls.rs @@ -142,6 +142,7 @@ mod tests { .build_or_panic(); pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024); pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -168,6 +169,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/polkadot/runtime/common/src/integration_tests.rs b/polkadot/runtime/common/src/integration_tests.rs index f14db68267d5..84782a11071f 100644 --- a/polkadot/runtime/common/src/integration_tests.rs +++ b/polkadot/runtime/common/src/integration_tests.rs @@ -107,6 +107,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max( Weight::from_parts(4 * 1024 * 1024, u64::MAX), ); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -133,6 +134,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/common/src/paras_registrar/mod.rs b/polkadot/runtime/common/src/paras_registrar/mod.rs index f2751803a413..9480c379b23d 100644 --- a/polkadot/runtime/common/src/paras_registrar/mod.rs +++ b/polkadot/runtime/common/src/paras_registrar/mod.rs @@ -749,6 +749,7 @@ mod tests { frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX)); pub BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(4 * 1024 * 1024, NORMAL_RATIO); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -775,6 +776,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/common/src/purchase.rs b/polkadot/runtime/common/src/purchase.rs index 58ca19d0288c..0e85cf2fe713 100644 --- a/polkadot/runtime/common/src/purchase.rs +++ b/polkadot/runtime/common/src/purchase.rs @@ -510,6 +510,7 @@ mod tests { parameter_types! { pub const BlockHashCount: u32 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -535,6 +536,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/common/src/slots/mod.rs b/polkadot/runtime/common/src/slots/mod.rs index a3efd5bfa30a..8ff1ee1985dd 100644 --- a/polkadot/runtime/common/src/slots/mod.rs +++ b/polkadot/runtime/common/src/slots/mod.rs @@ -528,6 +528,7 @@ mod tests { parameter_types! { pub const BlockHashCount: u32 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -553,6 +554,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index 659a7052d2b7..f59fa3c59741 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -168,6 +168,7 @@ impl Contains for BaseFilter { parameter_types! { pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 2; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -194,6 +195,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/parachains/src/mock.rs b/polkadot/runtime/parachains/src/mock.rs index ded7de08e4fa..1a0f3f84d288 100644 --- a/polkadot/runtime/parachains/src/mock.rs +++ b/polkadot/runtime/parachains/src/mock.rs @@ -90,6 +90,7 @@ parameter_types! { Weight::from_parts(4 * 1024 * 1024, u64::MAX), ); pub static BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(u32::MAX, Perbill::from_percent(75)); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } pub type AccountId = u64; @@ -118,6 +119,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/polkadot/src/lib.rs b/polkadot/runtime/polkadot/src/lib.rs index 45ea561b33fa..7c6036586c86 100644 --- a/polkadot/runtime/polkadot/src/lib.rs +++ b/polkadot/runtime/polkadot/src/lib.rs @@ -151,6 +151,7 @@ pub fn native_version() -> NativeVersion { parameter_types! { pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 0; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -177,6 +178,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index e043852901f1..c595f2b256c3 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -145,6 +145,7 @@ impl Contains for BaseFilter { parameter_types! { pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -171,6 +172,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 94852ad39f5a..cd94c77597a6 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -135,6 +135,7 @@ sp_api::decl_runtime_apis! { parameter_types! { pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -161,6 +162,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl frame_system::offchain::SendTransactionTypes for Runtime diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 7dfc781d2467..a1f48090a220 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -144,6 +144,7 @@ pub fn native_version() -> NativeVersion { parameter_types! { pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -170,6 +171,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs index f5759afc0646..d7793e9ee9e2 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -44,6 +44,7 @@ parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX)); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = Everything; @@ -69,6 +70,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs index 1b244f316de9..0dcc7b36450b 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/mock.rs @@ -48,6 +48,7 @@ parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX)); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -74,6 +75,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } /// The benchmarks in this pallet should never need an asset transactor to begin with. diff --git a/polkadot/xcm/pallet-xcm/src/mock.rs b/polkadot/xcm/pallet-xcm/src/mock.rs index b09bcb80ed67..ae575f77fa94 100644 --- a/polkadot/xcm/pallet-xcm/src/mock.rs +++ b/polkadot/xcm/pallet-xcm/src/mock.rs @@ -195,6 +195,7 @@ impl SendXcm for TestSendXcmErrX8 { parameter_types! { pub const BlockHashCount: u64 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -221,6 +222,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/xcm/xcm-builder/Cargo.toml b/polkadot/xcm/xcm-builder/Cargo.toml index 1f0e1cf34775..74f81aa3f389 100644 --- a/polkadot/xcm/xcm-builder/Cargo.toml +++ b/polkadot/xcm/xcm-builder/Cargo.toml @@ -14,6 +14,7 @@ xcm = { package = "staging-xcm", path = "..", default-features = false } xcm-executor = { package = "staging-xcm-executor", path = "../xcm-executor", default-features = false } sp-std = { path = "../../../substrate/primitives/std", default-features = false } sp-arithmetic = { path = "../../../substrate/primitives/arithmetic", default-features = false } +sp-core = { path = "../../../substrate/primitives/core", default-features = false} sp-io = { path = "../../../substrate/primitives/io", default-features = false } sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false } sp-weights = { path = "../../../substrate/primitives/weights", default-features = false } @@ -61,6 +62,7 @@ std = [ "polkadot-parachain-primitives/std", "scale-info/std", "sp-arithmetic/std", + "sp-core/std", "sp-io/std", "sp-runtime/std", "sp-std/std", diff --git a/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs b/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs index c663b0a4d76f..535bc2b3ad48 100644 --- a/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs +++ b/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs @@ -51,6 +51,7 @@ construct_runtime!( parameter_types! { pub const BlockHashCount: BlockNumber = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] @@ -66,6 +67,7 @@ impl frame_system::Config for Test { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; type Lookup = sp_runtime::traits::IdentityLookup; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } pub type Balance = u128; diff --git a/polkadot/xcm/xcm-builder/tests/mock/mod.rs b/polkadot/xcm/xcm-builder/tests/mock/mod.rs index 363748940ca6..59cbe61d0383 100644 --- a/polkadot/xcm/xcm-builder/tests/mock/mod.rs +++ b/polkadot/xcm/xcm-builder/tests/mock/mod.rs @@ -74,6 +74,7 @@ pub const CENTS: Balance = UNITS / 30_000; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -100,6 +101,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/xcm/xcm-simulator/example/src/parachain.rs b/polkadot/xcm/xcm-simulator/example/src/parachain.rs index bc7cba313828..53dd691391e0 100644 --- a/polkadot/xcm/xcm-simulator/example/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/parachain.rs @@ -61,6 +61,7 @@ pub type Balance = u128; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -87,6 +88,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs index 4e9195a8454f..54065e973e3a 100644 --- a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs @@ -47,6 +47,7 @@ pub type Balance = u128; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -73,6 +74,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs index 95f875eca06e..e759761b7114 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs @@ -50,6 +50,7 @@ pub type Balance = u128; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -76,6 +77,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs index a29ead9e6c3b..357435b409bf 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs @@ -46,6 +46,7 @@ pub type Balance = u128; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -72,6 +73,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/bin/node-template/pallets/template/src/mock.rs b/substrate/bin/node-template/pallets/template/src/mock.rs index 244ae1b37859..a7850b6677cc 100644 --- a/substrate/bin/node-template/pallets/template/src/mock.rs +++ b/substrate/bin/node-template/pallets/template/src/mock.rs @@ -1,5 +1,8 @@ use crate as pallet_template; -use frame_support::traits::{ConstU16, ConstU64}; +use frame_support::{ + parameter_types, + traits::{ConstU16, ConstU64}, +}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -17,6 +20,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -41,6 +48,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_template::Config for Test { diff --git a/substrate/bin/node-template/runtime/src/lib.rs b/substrate/bin/node-template/runtime/src/lib.rs index 216be9588bca..562035804ceb 100644 --- a/substrate/bin/node-template/runtime/src/lib.rs +++ b/substrate/bin/node-template/runtime/src/lib.rs @@ -148,6 +148,7 @@ parameter_types! { pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength ::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } // Configure FRAME pallets to include in runtime. @@ -200,6 +201,7 @@ impl frame_system::Config for Runtime { /// The set code logic, just the default since we're not a parachain. type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_aura::Config for Runtime { diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 4f34e4ecd812..4d0d8aa9cf39 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -260,6 +260,7 @@ parameter_types! { pub const ExtendDuration: BlockNumber = 2 * HOURS; pub const ExtendDepositAmount: Balance = 1_000_000 * DOLLARS; pub const ReleaseDelay: u32 = 2 * DAYS; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl pallet_safe_mode::Config for Runtime { @@ -304,6 +305,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_insecure_randomness_collective_flip::Config for Runtime {} diff --git a/substrate/client/network/sync/src/block_request_handler.rs b/substrate/client/network/sync/src/block_request_handler.rs index 6a77e47159ac..0bd6b605f94e 100644 --- a/substrate/client/network/sync/src/block_request_handler.rs +++ b/substrate/client/network/sync/src/block_request_handler.rs @@ -32,7 +32,6 @@ use futures::{channel::oneshot, stream::StreamExt}; use libp2p::PeerId; use log::debug; use prost::Message; -use schnellru::{ByLength, LruMap}; use sc_client_api::BlockBackend; use sc_network::{ config::ProtocolId, @@ -42,6 +41,7 @@ use sc_network::{ types::ProtocolName, }; use sc_network_common::sync::message::{BlockAttributes, BlockData, BlockRequest, FromBlock}; +use schnellru::{ByLength, LruMap}; use sp_blockchain::HeaderBackend; use sp_runtime::{ generic::BlockId, diff --git a/substrate/client/network/sync/src/lib.rs b/substrate/client/network/sync/src/lib.rs index c9363e698896..deda6cde416e 100644 --- a/substrate/client/network/sync/src/lib.rs +++ b/substrate/client/network/sync/src/lib.rs @@ -3741,7 +3741,7 @@ mod test { let peer_id1 = PeerId::random(); let best_block = blocks[3].clone(); - sync.new_peer(peer_id1, best_block.hash(), *best_block.header().number()) + sync.new_peer(peer_id1, best_block.hash(), *best_block.header().number(), true) .unwrap(); sync.peers.get_mut(&peer_id1).unwrap().state = PeerSyncState::Available; diff --git a/substrate/frame/alliance/src/mock.rs b/substrate/frame/alliance/src/mock.rs index f04e7e414ed9..8d03faf0722c 100644 --- a/substrate/frame/alliance/src/mock.rs +++ b/substrate/frame/alliance/src/mock.rs @@ -44,6 +44,7 @@ parameter_types! { pub const BlockHashCount: BlockNumber = 250; pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(Weight::MAX); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -69,6 +70,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/asset-conversion/src/mock.rs b/substrate/frame/asset-conversion/src/mock.rs index 3a19f39e7ca6..3f483aa38c26 100644 --- a/substrate/frame/asset-conversion/src/mock.rs +++ b/substrate/frame/asset-conversion/src/mock.rs @@ -48,6 +48,10 @@ construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -72,6 +76,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/asset-rate/src/mock.rs b/substrate/frame/asset-rate/src/mock.rs index 5fe0d4240af5..8b0313dc9da7 100644 --- a/substrate/frame/asset-rate/src/mock.rs +++ b/substrate/frame/asset-rate/src/mock.rs @@ -18,7 +18,10 @@ //! The crate's mock. use crate as pallet_asset_rate; -use frame_support::traits::{ConstU16, ConstU64}; +use frame_support::{ + parameter_types, + traits::{ConstU16, ConstU64}, +}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -36,6 +39,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -60,6 +67,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/assets/src/mock.rs b/substrate/frame/assets/src/mock.rs index 32ad02da9041..e7b4024809b0 100644 --- a/substrate/frame/assets/src/mock.rs +++ b/substrate/frame/assets/src/mock.rs @@ -46,6 +46,10 @@ construct_runtime!( type AccountId = u64; type AssetId = u32; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -70,6 +74,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<3>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/atomic-swap/src/tests.rs b/substrate/frame/atomic-swap/src/tests.rs index e20e1df564c7..fbb3418babfa 100644 --- a/substrate/frame/atomic-swap/src/tests.rs +++ b/substrate/frame/atomic-swap/src/tests.rs @@ -19,6 +19,7 @@ use super::*; use crate as pallet_atomic_swap; +use frame_support::parameter_types; use frame_support::traits::{ConstU32, ConstU64}; use sp_core::H256; @@ -38,6 +39,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -62,6 +67,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/aura/src/mock.rs b/substrate/frame/aura/src/mock.rs index 39b798c2f684..21de21fa8fb4 100644 --- a/substrate/frame/aura/src/mock.rs +++ b/substrate/frame/aura/src/mock.rs @@ -41,6 +41,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -65,6 +69,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Test { diff --git a/substrate/frame/authority-discovery/src/lib.rs b/substrate/frame/authority-discovery/src/lib.rs index 87b743ae1967..56b5ed025c41 100644 --- a/substrate/frame/authority-discovery/src/lib.rs +++ b/substrate/frame/authority-discovery/src/lib.rs @@ -223,6 +223,7 @@ mod tests { parameter_types! { pub const Period: BlockNumber = 1; pub const Offset: BlockNumber = 0; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -249,6 +250,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } pub struct TestSessionHandler; diff --git a/substrate/frame/authorship/src/lib.rs b/substrate/frame/authorship/src/lib.rs index a9bd0c38cb67..13cffb698b7a 100644 --- a/substrate/frame/authorship/src/lib.rs +++ b/substrate/frame/authorship/src/lib.rs @@ -98,6 +98,7 @@ mod tests { use crate as pallet_authorship; use codec::{Decode, Encode}; use frame_support::{ + parameter_types, traits::{ConstU32, ConstU64}, ConsensusEngineId, }; @@ -119,6 +120,10 @@ mod tests { } ); + parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; + } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -143,6 +148,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet::Config for Test { diff --git a/substrate/frame/babe/src/mock.rs b/substrate/frame/babe/src/mock.rs index dbffe9f312e6..06d8c61958e9 100644 --- a/substrate/frame/babe/src/mock.rs +++ b/substrate/frame/babe/src/mock.rs @@ -63,6 +63,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -87,6 +91,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl frame_system::offchain::SendTransactionTypes for Test diff --git a/substrate/frame/bags-list/src/mock.rs b/substrate/frame/bags-list/src/mock.rs index ae50adabd508..c1269c4a1017 100644 --- a/substrate/frame/bags-list/src/mock.rs +++ b/substrate/frame/bags-list/src/mock.rs @@ -31,6 +31,7 @@ parameter_types! { // Set the vote weight for any id who's weight has _not_ been set with `set_score_of`. pub static NextVoteWeight: VoteWeight = 0; pub static NextVoteWeightMap: HashMap = Default::default(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } pub struct StakingMock; @@ -72,6 +73,7 @@ impl frame_system::Config for Runtime { type SystemWeightInfo = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/balances/src/tests/mod.rs b/substrate/frame/balances/src/tests/mod.rs index d15f8e89118c..18752aa221b6 100644 --- a/substrate/frame/balances/src/tests/mod.rs +++ b/substrate/frame/balances/src/tests/mod.rs @@ -85,6 +85,7 @@ parameter_types! { frame_support::weights::Weight::from_parts(1024, u64::MAX), ); pub static ExistentialDeposit: u64 = 1; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -110,6 +111,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_transaction_payment::Config for Test { diff --git a/substrate/frame/beefy-mmr/src/mock.rs b/substrate/frame/beefy-mmr/src/mock.rs index b2d8758a04be..186bdbf3fbc4 100644 --- a/substrate/frame/beefy-mmr/src/mock.rs +++ b/substrate/frame/beefy-mmr/src/mock.rs @@ -58,6 +58,10 @@ construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -82,6 +86,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_session::Config for Test { diff --git a/substrate/frame/beefy/src/mock.rs b/substrate/frame/beefy/src/mock.rs index b55a65dbd73a..9fc6cab92563 100644 --- a/substrate/frame/beefy/src/mock.rs +++ b/substrate/frame/beefy/src/mock.rs @@ -69,6 +69,10 @@ construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -93,6 +97,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl frame_system::offchain::SendTransactionTypes for Test diff --git a/substrate/frame/benchmarking/pov/Cargo.toml b/substrate/frame/benchmarking/pov/Cargo.toml index 3a08c7a67e19..4c5aadb92f06 100644 --- a/substrate/frame/benchmarking/pov/Cargo.toml +++ b/substrate/frame/benchmarking/pov/Cargo.toml @@ -17,6 +17,7 @@ scale-info = { version = "2.5.0", default-features = false, features = ["derive" frame-benchmarking = { path = "..", default-features = false} frame-support = { path = "../../support", default-features = false} frame-system = { path = "../../system", default-features = false} +sp-core = { path = "../../../primitives/core", default-features = false} sp-io = { path = "../../../primitives/io", default-features = false} sp-runtime = { path = "../../../primitives/runtime", default-features = false} sp-std = { path = "../../../primitives/std", default-features = false} @@ -29,6 +30,7 @@ std = [ "frame-support/std", "frame-system/std", "scale-info/std", + "sp-core/std", "sp-io/std", "sp-runtime/std", "sp-std/std", diff --git a/substrate/frame/benchmarking/pov/src/benchmarking.rs b/substrate/frame/benchmarking/pov/src/benchmarking.rs index 473947b171ac..4765785707cc 100644 --- a/substrate/frame/benchmarking/pov/src/benchmarking.rs +++ b/substrate/frame/benchmarking/pov/src/benchmarking.rs @@ -339,6 +339,7 @@ frame_benchmarking::benchmarks! { #[cfg(test)] mod mock { + use frame_support::parameter_types; use sp_runtime::{testing::H256, BuildStorage}; type AccountId = u64; @@ -354,6 +355,10 @@ mod mock { } ); + parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; + } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -378,6 +383,7 @@ mod mock { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl crate::Config for Test { diff --git a/substrate/frame/benchmarking/pov/src/tests.rs b/substrate/frame/benchmarking/pov/src/tests.rs index f09e37a5288a..c851c6c6e217 100644 --- a/substrate/frame/benchmarking/pov/src/tests.rs +++ b/substrate/frame/benchmarking/pov/src/tests.rs @@ -162,6 +162,7 @@ fn noop_is_free() { } mod mock { + use frame_support::parameter_types; use sp_runtime::testing::H256; type Block = frame_system::mocking::MockBlock; @@ -174,6 +175,10 @@ mod mock { } ); + parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; + } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -198,6 +203,7 @@ mod mock { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl crate::Config for Test { diff --git a/substrate/frame/benchmarking/src/baseline.rs b/substrate/frame/benchmarking/src/baseline.rs index 6cd23ebe028a..6bedd1d738d6 100644 --- a/substrate/frame/benchmarking/src/baseline.rs +++ b/substrate/frame/benchmarking/src/baseline.rs @@ -110,6 +110,7 @@ benchmarks! { #[cfg(test)] pub mod mock { + use frame_support::parameter_types; use sp_runtime::{testing::H256, BuildStorage}; type AccountId = u64; @@ -124,6 +125,10 @@ pub mod mock { } ); + parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; + } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -148,6 +153,7 @@ pub mod mock { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl super::Config for Test {} diff --git a/substrate/frame/benchmarking/src/tests.rs b/substrate/frame/benchmarking/src/tests.rs index e5bacbdb2361..0a8007c5c9bf 100644 --- a/substrate/frame/benchmarking/src/tests.rs +++ b/substrate/frame/benchmarking/src/tests.rs @@ -75,6 +75,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -99,6 +103,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/benchmarking/src/tests_instance.rs b/substrate/frame/benchmarking/src/tests_instance.rs index f2c721c8114c..8231c8dab141 100644 --- a/substrate/frame/benchmarking/src/tests_instance.rs +++ b/substrate/frame/benchmarking/src/tests_instance.rs @@ -19,7 +19,7 @@ #![cfg(test)] -use frame_support::traits::ConstU32; +use frame_support::{parameter_types, traits::ConstU32}; use sp_runtime::{ testing::H256, traits::{BlakeTwo256, IdentityLookup}, @@ -85,6 +85,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -109,6 +113,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_test::Config for Test { diff --git a/substrate/frame/bounties/src/tests.rs b/substrate/frame/bounties/src/tests.rs index a6fb89bb8601..c548f09640dc 100644 --- a/substrate/frame/bounties/src/tests.rs +++ b/substrate/frame/bounties/src/tests.rs @@ -52,6 +52,7 @@ frame_support::construct_runtime!( parameter_types! { pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } type Balance = u64; @@ -80,6 +81,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/broker/src/mock.rs b/substrate/frame/broker/src/mock.rs index cab6b7389c06..3d5379f43a69 100644 --- a/substrate/frame/broker/src/mock.rs +++ b/substrate/frame/broker/src/mock.rs @@ -47,6 +47,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -71,6 +75,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } #[derive(Debug, Clone, Eq, PartialEq)] diff --git a/substrate/frame/child-bounties/src/tests.rs b/substrate/frame/child-bounties/src/tests.rs index 24a6410f29f7..8472973e2aab 100644 --- a/substrate/frame/child-bounties/src/tests.rs +++ b/substrate/frame/child-bounties/src/tests.rs @@ -55,6 +55,7 @@ parameter_types! { pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0); pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } type Balance = u64; @@ -83,6 +84,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 86b85e07a8bd..62d1adad45a3 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -89,6 +89,7 @@ parameter_types! { pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(Weight::MAX); pub static MaxProposalWeight: Weight = default_max_proposal_weight(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -114,6 +115,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl Config for Test { type RuntimeOrigin = RuntimeOrigin; diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs index 0fea2b155950..1b74a32d793a 100644 --- a/substrate/frame/contracts/src/tests.rs +++ b/substrate/frame/contracts/src/tests.rs @@ -330,6 +330,7 @@ parameter_types! { Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX), ); pub static ExistentialDeposit: u64 = 1; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -355,6 +356,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_insecure_randomness_collective_flip::Config for Test {} impl pallet_balances::Config for Test { diff --git a/substrate/frame/conviction-voting/src/tests.rs b/substrate/frame/conviction-voting/src/tests.rs index 656112deebfb..d6d528371f6e 100644 --- a/substrate/frame/conviction-voting/src/tests.rs +++ b/substrate/frame/conviction-voting/src/tests.rs @@ -51,6 +51,10 @@ impl Contains for BaseFilter { } } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = BaseFilter; type BlockWeights = (); @@ -75,6 +79,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/core-fellowship/src/tests.rs b/substrate/frame/core-fellowship/src/tests.rs index a02c010718c9..fb3009de3531 100644 --- a/substrate/frame/core-fellowship/src/tests.rs +++ b/substrate/frame/core-fellowship/src/tests.rs @@ -49,6 +49,7 @@ frame_support::construct_runtime!( parameter_types! { pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1_000_000, u64::max_value())); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = Everything; @@ -74,6 +75,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } thread_local! { diff --git a/substrate/frame/democracy/src/tests.rs b/substrate/frame/democracy/src/tests.rs index e5cfcc5b4002..aa988f787a3d 100644 --- a/substrate/frame/democracy/src/tests.rs +++ b/substrate/frame/democracy/src/tests.rs @@ -76,6 +76,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max( Weight::from_parts(frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND, u64::MAX), ); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = BaseFilter; @@ -101,6 +102,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * BlockWeights::get().max_block; diff --git a/substrate/frame/election-provider-multi-phase/src/mock.rs b/substrate/frame/election-provider-multi-phase/src/mock.rs index 05d151e51ecc..254ce2a9efad 100644 --- a/substrate/frame/election-provider-multi-phase/src/mock.rs +++ b/substrate/frame/election-provider-multi-phase/src/mock.rs @@ -204,6 +204,10 @@ pub fn witness() -> SolutionOrSnapshotSize { .unwrap_or_default() } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; @@ -228,6 +232,7 @@ impl frame_system::Config for Runtime { type SystemWeightInfo = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); diff --git a/substrate/frame/election-provider-support/src/onchain.rs b/substrate/frame/election-provider-support/src/onchain.rs index 8ac245a360bb..e37fd441e914 100644 --- a/substrate/frame/election-provider-support/src/onchain.rs +++ b/substrate/frame/election-provider-support/src/onchain.rs @@ -200,6 +200,10 @@ mod tests { } ); + parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; + } + impl frame_system::Config for Runtime { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; @@ -224,6 +228,7 @@ mod tests { type SystemWeightInfo = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } struct PhragmenParams; diff --git a/substrate/frame/elections-phragmen/src/lib.rs b/substrate/frame/elections-phragmen/src/lib.rs index 6912649bd122..2c87eed0ab63 100644 --- a/substrate/frame/elections-phragmen/src/lib.rs +++ b/substrate/frame/elections-phragmen/src/lib.rs @@ -1318,6 +1318,10 @@ mod tests { }; use substrate_test_utils::assert_eq_uvec; + parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; + } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -1342,6 +1346,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/examples/basic/src/tests.rs b/substrate/frame/examples/basic/src/tests.rs index addf219dc3c3..15052c8f826d 100644 --- a/substrate/frame/examples/basic/src/tests.rs +++ b/substrate/frame/examples/basic/src/tests.rs @@ -21,6 +21,7 @@ use crate::*; use frame_support::{ assert_ok, dispatch::{DispatchInfo, GetDispatchInfo}, + parameter_types, traits::{ConstU64, OnInitialize}, }; use sp_core::H256; @@ -45,6 +46,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -69,6 +74,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/examples/dev-mode/src/tests.rs b/substrate/frame/examples/dev-mode/src/tests.rs index ba98f5174ce2..f3641c9674f8 100644 --- a/substrate/frame/examples/dev-mode/src/tests.rs +++ b/substrate/frame/examples/dev-mode/src/tests.rs @@ -18,7 +18,7 @@ //! Tests for pallet-dev-mode. use crate::*; -use frame_support::{assert_ok, traits::ConstU64}; +use frame_support::{assert_ok, parameter_types, traits::ConstU64}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -39,6 +39,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -63,6 +67,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/examples/offchain-worker/src/tests.rs b/substrate/frame/examples/offchain-worker/src/tests.rs index 203a59a8af03..1ef46db261e4 100644 --- a/substrate/frame/examples/offchain-worker/src/tests.rs +++ b/substrate/frame/examples/offchain-worker/src/tests.rs @@ -46,6 +46,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -70,6 +74,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } type Extrinsic = TestXt; diff --git a/substrate/frame/executive/src/lib.rs b/substrate/frame/executive/src/lib.rs index 1d9afdfa60aa..827b9443d0b0 100644 --- a/substrate/frame/executive/src/lib.rs +++ b/substrate/frame/executive/src/lib.rs @@ -863,6 +863,7 @@ mod tests { read: 10, write: 100, }; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; @@ -888,6 +889,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } type Balance = u64; diff --git a/substrate/frame/fast-unstake/src/mock.rs b/substrate/frame/fast-unstake/src/mock.rs index dc24a823c0db..99592d902ff0 100644 --- a/substrate/frame/fast-unstake/src/mock.rs +++ b/substrate/frame/fast-unstake/src/mock.rs @@ -42,6 +42,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max( Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX), ); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -68,6 +69,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/substrate/frame/glutton/src/mock.rs b/substrate/frame/glutton/src/mock.rs index 4bc40b547887..9e24f3daae3c 100644 --- a/substrate/frame/glutton/src/mock.rs +++ b/substrate/frame/glutton/src/mock.rs @@ -19,7 +19,7 @@ use super::*; use crate as pallet_glutton; use frame_support::{ - assert_ok, + assert_ok, parameter_types, traits::{ConstU32, ConstU64}, }; use sp_core::H256; @@ -38,6 +38,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -62,6 +66,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl Config for Test { diff --git a/substrate/frame/grandpa/src/mock.rs b/substrate/frame/grandpa/src/mock.rs index fd4d737dc493..4a9307a1e7d2 100644 --- a/substrate/frame/grandpa/src/mock.rs +++ b/substrate/frame/grandpa/src/mock.rs @@ -66,6 +66,10 @@ impl_opaque_keys! { } } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -90,6 +94,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl frame_system::offchain::SendTransactionTypes for Test diff --git a/substrate/frame/identity/src/tests.rs b/substrate/frame/identity/src/tests.rs index 1532980574c2..e8e762797843 100644 --- a/substrate/frame/identity/src/tests.rs +++ b/substrate/frame/identity/src/tests.rs @@ -44,6 +44,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -68,6 +72,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/im-online/src/mock.rs b/substrate/frame/im-online/src/mock.rs index 85da061fe904..e99a6c461fa9 100644 --- a/substrate/frame/im-online/src/mock.rs +++ b/substrate/frame/im-online/src/mock.rs @@ -113,6 +113,10 @@ pub fn new_test_ext() -> sp_io::TestExternalities { result } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -137,6 +141,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/indices/src/mock.rs b/substrate/frame/indices/src/mock.rs index d63081e0b73f..c6cc090e2dbf 100644 --- a/substrate/frame/indices/src/mock.rs +++ b/substrate/frame/indices/src/mock.rs @@ -20,7 +20,10 @@ #![cfg(test)] use crate::{self as pallet_indices, Config}; -use frame_support::traits::{ConstU32, ConstU64}; +use frame_support::{ + parameter_types, + traits::{ConstU32, ConstU64}, +}; use sp_core::H256; use sp_runtime::BuildStorage; @@ -35,6 +38,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -59,6 +66,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/insecure-randomness-collective-flip/src/lib.rs b/substrate/frame/insecure-randomness-collective-flip/src/lib.rs index 474087777c46..ef8d1ed84643 100644 --- a/substrate/frame/insecure-randomness-collective-flip/src/lib.rs +++ b/substrate/frame/insecure-randomness-collective-flip/src/lib.rs @@ -187,6 +187,7 @@ mod tests { parameter_types! { pub BlockLength: limits::BlockLength = limits::BlockLength ::max(2 * 1024); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -213,6 +214,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_insecure_randomness_collective_flip::Config for Test {} diff --git a/substrate/frame/lottery/src/mock.rs b/substrate/frame/lottery/src/mock.rs index aefb6a1cce2b..f6b54f303bee 100644 --- a/substrate/frame/lottery/src/mock.rs +++ b/substrate/frame/lottery/src/mock.rs @@ -45,6 +45,7 @@ frame_support::construct_runtime!( parameter_types! { pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -71,6 +72,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/membership/src/lib.rs b/substrate/frame/membership/src/lib.rs index 6fb61f0e491b..323d947e7c44 100644 --- a/substrate/frame/membership/src/lib.rs +++ b/substrate/frame/membership/src/lib.rs @@ -549,6 +549,7 @@ mod tests { parameter_types! { pub static Members: Vec = vec![]; pub static Prime: Option = None; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -575,6 +576,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } ord_parameter_types! { pub const One: u64 = 1; diff --git a/substrate/frame/merkle-mountain-range/src/mock.rs b/substrate/frame/merkle-mountain-range/src/mock.rs index ecc254278bf0..cfc07a24e2fb 100644 --- a/substrate/frame/merkle-mountain-range/src/mock.rs +++ b/substrate/frame/merkle-mountain-range/src/mock.rs @@ -37,6 +37,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; @@ -61,6 +65,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl Config for Test { diff --git a/substrate/frame/message-queue/src/integration_test.rs b/substrate/frame/message-queue/src/integration_test.rs index a1003edf3c92..6d7784ed385e 100644 --- a/substrate/frame/message-queue/src/integration_test.rs +++ b/substrate/frame/message-queue/src/integration_test.rs @@ -50,6 +50,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -74,6 +78,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/message-queue/src/mock.rs b/substrate/frame/message-queue/src/mock.rs index 473c5faac4c5..04dbac3b0212 100644 --- a/substrate/frame/message-queue/src/mock.rs +++ b/substrate/frame/message-queue/src/mock.rs @@ -43,6 +43,11 @@ frame_support::construct_runtime!( MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, } ); + +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -67,6 +72,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { pub const HeapSize: u32 = 24; diff --git a/substrate/frame/nft-fractionalization/src/mock.rs b/substrate/frame/nft-fractionalization/src/mock.rs index c690f0e580ed..95cde9bdd670 100644 --- a/substrate/frame/nft-fractionalization/src/mock.rs +++ b/substrate/frame/nft-fractionalization/src/mock.rs @@ -49,6 +49,11 @@ construct_runtime!( Nfts: pallet_nfts, } ); + +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -73,6 +78,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/nfts/src/mock.rs b/substrate/frame/nfts/src/mock.rs index f091a53f8d7c..324d11ab3141 100644 --- a/substrate/frame/nfts/src/mock.rs +++ b/substrate/frame/nfts/src/mock.rs @@ -46,6 +46,10 @@ pub type Signature = MultiSignature; pub type AccountPublic = ::Signer; pub type AccountId = ::AccountId; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -70,6 +74,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/nicks/src/lib.rs b/substrate/frame/nicks/src/lib.rs index 0a68f7d7142d..ceb4996293fe 100644 --- a/substrate/frame/nicks/src/lib.rs +++ b/substrate/frame/nicks/src/lib.rs @@ -253,7 +253,7 @@ mod tests { use crate as pallet_nicks; use frame_support::{ - assert_noop, assert_ok, ord_parameter_types, + assert_noop, assert_ok, ord_parameter_types, parameter_types, traits::{ConstU32, ConstU64}, }; use frame_system::EnsureSignedBy; @@ -274,6 +274,10 @@ mod tests { } ); + parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; + } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -298,6 +302,7 @@ mod tests { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/nis/src/mock.rs b/substrate/frame/nis/src/mock.rs index 76fdf5f3f069..79c950c4143d 100644 --- a/substrate/frame/nis/src/mock.rs +++ b/substrate/frame/nis/src/mock.rs @@ -50,6 +50,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = Everything; type BlockWeights = (); @@ -74,6 +78,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/node-authorization/src/mock.rs b/substrate/frame/node-authorization/src/mock.rs index 84e3336b3bd6..f1640683ec4d 100644 --- a/substrate/frame/node-authorization/src/mock.rs +++ b/substrate/frame/node-authorization/src/mock.rs @@ -21,7 +21,7 @@ use super::*; use crate as pallet_node_authorization; use frame_support::{ - ord_parameter_types, + ord_parameter_types, parameter_types, traits::{ConstU32, ConstU64}, }; use frame_system::EnsureSignedBy; @@ -43,6 +43,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type DbWeight = (); @@ -67,6 +71,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } ord_parameter_types! { diff --git a/substrate/frame/nomination-pools/benchmarking/src/mock.rs b/substrate/frame/nomination-pools/benchmarking/src/mock.rs index 2d75df63b518..bc2175a9bad4 100644 --- a/substrate/frame/nomination-pools/benchmarking/src/mock.rs +++ b/substrate/frame/nomination-pools/benchmarking/src/mock.rs @@ -28,6 +28,10 @@ type Nonce = u32; type BlockNumber = u64; type Balance = u128; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -52,6 +56,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/substrate/frame/nomination-pools/src/mock.rs b/substrate/frame/nomination-pools/src/mock.rs index 28c24c428035..ed391568e747 100644 --- a/substrate/frame/nomination-pools/src/mock.rs +++ b/substrate/frame/nomination-pools/src/mock.rs @@ -181,6 +181,10 @@ impl sp_staking::StakingInterface for StakingMock { } } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; @@ -205,6 +209,7 @@ impl frame_system::Config for Runtime { type SystemWeightInfo = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/nomination-pools/test-staking/src/mock.rs b/substrate/frame/nomination-pools/test-staking/src/mock.rs index 02c253e62c01..3433202749bb 100644 --- a/substrate/frame/nomination-pools/test-staking/src/mock.rs +++ b/substrate/frame/nomination-pools/test-staking/src/mock.rs @@ -38,6 +38,10 @@ pub(crate) type T = Runtime; pub(crate) const POOL1_BONDED: AccountId = 20318131474730217858575332831085u128; pub(crate) const POOL1_REWARD: AccountId = 20397359637244482196168876781421u128; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -62,6 +66,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Runtime { diff --git a/substrate/frame/offences/benchmarking/src/mock.rs b/substrate/frame/offences/benchmarking/src/mock.rs index 88f418dd3e2e..98821b02b493 100644 --- a/substrate/frame/offences/benchmarking/src/mock.rs +++ b/substrate/frame/offences/benchmarking/src/mock.rs @@ -40,6 +40,10 @@ type AccountId = u64; type Nonce = u32; type Balance = u64; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -64,6 +68,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/offences/src/mock.rs b/substrate/frame/offences/src/mock.rs index 990ceae5ac01..b9301bd7db5b 100644 --- a/substrate/frame/offences/src/mock.rs +++ b/substrate/frame/offences/src/mock.rs @@ -75,6 +75,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -99,6 +103,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl Config for Runtime { diff --git a/substrate/frame/paged-list/src/mock.rs b/substrate/frame/paged-list/src/mock.rs index 390b4a8530dc..0ec3179487e4 100644 --- a/substrate/frame/paged-list/src/mock.rs +++ b/substrate/frame/paged-list/src/mock.rs @@ -20,7 +20,10 @@ #![cfg(feature = "std")] use crate::{paged_list::StoragePagedListMeta, Config, ListPrefix}; -use frame_support::traits::{ConstU16, ConstU64}; +use frame_support::{ + parameter_types, + traits::{ConstU16, ConstU64}, +}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -38,6 +41,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -62,6 +69,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } frame_support::parameter_types! { diff --git a/substrate/frame/preimage/src/mock.rs b/substrate/frame/preimage/src/mock.rs index 2fb9f36dec45..9a20b1c0cfd5 100644 --- a/substrate/frame/preimage/src/mock.rs +++ b/substrate/frame/preimage/src/mock.rs @@ -21,7 +21,7 @@ use super::*; use crate as pallet_preimage; use frame_support::{ - ord_parameter_types, + ord_parameter_types, parameter_types, traits::{ConstU32, ConstU64, Everything}, weights::constants::RocksDbWeight, }; @@ -43,6 +43,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = Everything; type BlockWeights = (); @@ -67,6 +71,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/proxy/src/tests.rs b/substrate/frame/proxy/src/tests.rs index 0667be6e1e52..05b86ad40d70 100644 --- a/substrate/frame/proxy/src/tests.rs +++ b/substrate/frame/proxy/src/tests.rs @@ -24,7 +24,7 @@ use super::*; use crate as proxy; use codec::{Decode, Encode}; use frame_support::{ - assert_noop, assert_ok, derive_impl, + assert_noop, assert_ok, derive_impl, parameter_types, traits::{ConstU32, ConstU64, Contains}, }; use sp_core::H256; @@ -42,6 +42,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type Block = Block; @@ -54,6 +58,7 @@ impl frame_system::Config for Test { type BaseCallFilter = BaseFilter; type AccountData = pallet_balances::AccountData; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] diff --git a/substrate/frame/ranked-collective/src/tests.rs b/substrate/frame/ranked-collective/src/tests.rs index ba8c5a0f937b..9ba236414d86 100644 --- a/substrate/frame/ranked-collective/src/tests.rs +++ b/substrate/frame/ranked-collective/src/tests.rs @@ -45,6 +45,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = Everything; type BlockWeights = (); @@ -69,6 +73,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } #[derive(Clone, PartialEq, Eq, Debug)] diff --git a/substrate/frame/recovery/src/mock.rs b/substrate/frame/recovery/src/mock.rs index 2f2bd866a719..fa79833d33cd 100644 --- a/substrate/frame/recovery/src/mock.rs +++ b/substrate/frame/recovery/src/mock.rs @@ -41,6 +41,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -65,6 +69,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/referenda/src/mock.rs b/substrate/frame/referenda/src/mock.rs index e44167ed561c..4ff319099b7b 100644 --- a/substrate/frame/referenda/src/mock.rs +++ b/substrate/frame/referenda/src/mock.rs @@ -58,6 +58,7 @@ impl Contains for BaseFilter { parameter_types! { pub MaxWeight: Weight = Weight::from_parts(2_000_000_000_000, u64::MAX); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = BaseFilter; @@ -83,6 +84,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_preimage::Config for Test { type RuntimeEvent = RuntimeEvent; diff --git a/substrate/frame/remark/src/mock.rs b/substrate/frame/remark/src/mock.rs index e597a1ca4dfe..db5fcefe3ab6 100644 --- a/substrate/frame/remark/src/mock.rs +++ b/substrate/frame/remark/src/mock.rs @@ -18,7 +18,10 @@ //! Test environment for remarks pallet. use crate as pallet_remark; -use frame_support::traits::{ConstU16, ConstU32, ConstU64}; +use frame_support::{ + parameter_types, + traits::{ConstU16, ConstU32, ConstU64}, +}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -36,6 +39,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -60,6 +67,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_remark::Config for Test { diff --git a/substrate/frame/root-offences/src/mock.rs b/substrate/frame/root-offences/src/mock.rs index 2d2a5476149f..1fedb50b26c9 100644 --- a/substrate/frame/root-offences/src/mock.rs +++ b/substrate/frame/root-offences/src/mock.rs @@ -84,6 +84,10 @@ impl sp_runtime::BoundToRuntimeAppPublic for OtherSessionHandler { type Public = UintAuthorityId; } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -108,6 +112,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/safe-mode/src/mock.rs b/substrate/frame/safe-mode/src/mock.rs index 635ee0cfedc0..55b90f6dbe76 100644 --- a/substrate/frame/safe-mode/src/mock.rs +++ b/substrate/frame/safe-mode/src/mock.rs @@ -33,6 +33,10 @@ use sp_runtime::{ BuildStorage, }; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = InsideBoth; type BlockWeights = (); @@ -57,6 +61,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } /// Identifies a hold on an account's balance. diff --git a/substrate/frame/salary/src/tests.rs b/substrate/frame/salary/src/tests.rs index 1136ea746f60..1d886573461e 100644 --- a/substrate/frame/salary/src/tests.rs +++ b/substrate/frame/salary/src/tests.rs @@ -48,6 +48,7 @@ frame_support::construct_runtime!( parameter_types! { pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1_000_000, 0)); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = Everything; @@ -73,6 +74,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } thread_local! { diff --git a/substrate/frame/scheduler/src/mock.rs b/substrate/frame/scheduler/src/mock.rs index 28e334958d92..207e0101eb99 100644 --- a/substrate/frame/scheduler/src/mock.rs +++ b/substrate/frame/scheduler/src/mock.rs @@ -117,6 +117,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max( Weight::from_parts(2_000_000_000_000, u64::MAX), ); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl system::Config for Test { type BaseCallFilter = BaseFilter; @@ -142,6 +143,7 @@ impl system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl logger::Config for Test { type RuntimeEvent = RuntimeEvent; diff --git a/substrate/frame/scored-pool/src/mock.rs b/substrate/frame/scored-pool/src/mock.rs index 591c910488b1..7cf20ff83217 100644 --- a/substrate/frame/scored-pool/src/mock.rs +++ b/substrate/frame/scored-pool/src/mock.rs @@ -45,6 +45,7 @@ construct_runtime!( parameter_types! { pub const CandidateDeposit: u64 = 25; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } ord_parameter_types! { pub const KickOrigin: u64 = 2; @@ -75,6 +76,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/session/benchmarking/src/mock.rs b/substrate/frame/session/benchmarking/src/mock.rs index 24a821ac87af..87bb00627d65 100644 --- a/substrate/frame/session/benchmarking/src/mock.rs +++ b/substrate/frame/session/benchmarking/src/mock.rs @@ -45,6 +45,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -69,6 +73,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/session/src/mock.rs b/substrate/frame/session/src/mock.rs index 2db54e1a5975..3560d743e507 100644 --- a/substrate/frame/session/src/mock.rs +++ b/substrate/frame/session/src/mock.rs @@ -232,6 +232,10 @@ pub fn new_test_ext() -> sp_io::TestExternalities { sp_io::TestExternalities::new(t) } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -256,6 +260,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_timestamp::Config for Test { diff --git a/substrate/frame/society/src/mock.rs b/substrate/frame/society/src/mock.rs index a318c2e794b7..af20486ccc8b 100644 --- a/substrate/frame/society/src/mock.rs +++ b/substrate/frame/society/src/mock.rs @@ -47,6 +47,7 @@ frame_support::construct_runtime!( parameter_types! { pub const SocietyPalletId: PalletId = PalletId(*b"py/socie"); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } ord_parameter_types! { @@ -82,6 +83,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/staking/src/mock.rs b/substrate/frame/staking/src/mock.rs index cf08f8be1f27..2a831743abf1 100644 --- a/substrate/frame/staking/src/mock.rs +++ b/substrate/frame/staking/src/mock.rs @@ -119,6 +119,7 @@ parameter_types! { pub static SlashDeferDuration: EraIndex = 0; pub static Period: BlockNumber = 5; pub static Offset: BlockNumber = 0; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -145,6 +146,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { type MaxLocks = frame_support::traits::ConstU32<1024>; diff --git a/substrate/frame/state-trie-migration/src/lib.rs b/substrate/frame/state-trie-migration/src/lib.rs index 3e69b219bb52..f504e2f02442 100644 --- a/substrate/frame/state-trie-migration/src/lib.rs +++ b/substrate/frame/state-trie-migration/src/lib.rs @@ -1079,6 +1079,7 @@ mod mock { parameter_types! { pub const SS58Prefix: u8 = 42; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { @@ -1105,6 +1106,7 @@ mod mock { type SS58Prefix = SS58Prefix; type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/statement/src/mock.rs b/substrate/frame/statement/src/mock.rs index 79d2aa7d891d..1ba1365c7971 100644 --- a/substrate/frame/statement/src/mock.rs +++ b/substrate/frame/statement/src/mock.rs @@ -21,7 +21,7 @@ use super::*; use crate as pallet_statement; use frame_support::{ - ord_parameter_types, + ord_parameter_types, parameter_types, traits::{ConstU32, ConstU64, Everything}, weights::constants::RocksDbWeight, }; @@ -47,6 +47,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = Everything; type BlockWeights = (); @@ -71,6 +75,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/sudo/src/mock.rs b/substrate/frame/sudo/src/mock.rs index 9e78e474f4e5..d2726c813092 100644 --- a/substrate/frame/sudo/src/mock.rs +++ b/substrate/frame/sudo/src/mock.rs @@ -19,7 +19,10 @@ use super::*; use crate as sudo; -use frame_support::traits::{ConstU32, ConstU64, Contains}; +use frame_support::{ + parameter_types, + traits::{ConstU32, ConstU64, Contains}, +}; use sp_core::H256; use sp_io; use sp_runtime::{ @@ -108,6 +111,10 @@ impl Contains for BlockEverything { } } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = BlockEverything; type BlockWeights = (); @@ -132,6 +139,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } // Implement the logger module's `Config` on the Test runtime. diff --git a/substrate/frame/support/test/compile_pass/src/lib.rs b/substrate/frame/support/test/compile_pass/src/lib.rs index bf90d73acb32..6371a406367d 100644 --- a/substrate/frame/support/test/compile_pass/src/lib.rs +++ b/substrate/frame/support/test/compile_pass/src/lib.rs @@ -48,6 +48,7 @@ pub type BlockNumber = u64; parameter_types! { pub const Version: RuntimeVersion = VERSION; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -74,6 +75,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = ConstU32<16>; type SystemWeightInfo = (); type SS58Prefix = ConstU16<0>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } pub type Header = generic::Header; diff --git a/substrate/frame/support/test/tests/construct_runtime.rs b/substrate/frame/support/test/tests/construct_runtime.rs index 9ad51ad530eb..a504c9b7ba80 100644 --- a/substrate/frame/support/test/tests/construct_runtime.rs +++ b/substrate/frame/support/test/tests/construct_runtime.rs @@ -275,6 +275,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type AccountId = AccountId; @@ -287,6 +291,7 @@ impl frame_system::Config for Runtime { type OnSetCode = (); type Block = Block; type BlockHashCount = ConstU64<10>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl module1::Config for Runtime { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs index ea52293a6732..04e455b1d417 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -36,6 +36,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr index af9069edc80d..95e6798d98a8 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.stderr @@ -1,7 +1,7 @@ error: The number of pallets exceeds the maximum number of tuple elements. To increase this limit, enable the tuples-96 feature of [frame_support]. - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:66:2 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:71:2 | -66 | pub struct Runtime +71 | pub struct Runtime | ^^^ error[E0412]: cannot find type `RuntimeCall` in this scope @@ -22,38 +22,38 @@ error[E0412]: cannot find type `Runtime` in this scope | ^^^^^^^ not found in this scope error[E0412]: cannot find type `Runtime` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:39:31 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:43:31 | -39 | impl frame_system::Config for Runtime { +43 | impl frame_system::Config for Runtime { | ^^^^^^^ not found in this scope error[E0412]: cannot find type `RuntimeOrigin` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:41:23 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:45:23 | -41 | type RuntimeOrigin = RuntimeOrigin; +45 | type RuntimeOrigin = RuntimeOrigin; | ^^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeOrigin` error[E0412]: cannot find type `RuntimeCall` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:43:21 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:47:21 | -43 | type RuntimeCall = RuntimeCall; +47 | type RuntimeCall = RuntimeCall; | ^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeCall` error[E0412]: cannot find type `RuntimeEvent` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:49:22 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:53:22 | -49 | type RuntimeEvent = RuntimeEvent; +53 | type RuntimeEvent = RuntimeEvent; | ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent` error[E0412]: cannot find type `PalletInfo` in this scope - --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:55:20 + --> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:59:20 | -55 | type PalletInfo = PalletInfo; +59 | type PalletInfo = PalletInfo; | ^^^^^^^^^^ | help: you might have meant to use the associated type | -55 | type PalletInfo = Self::PalletInfo; +59 | type PalletInfo = Self::PalletInfo; | ~~~~~~~~~~~~~~~~ help: consider importing one of these items | diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs index 2834b5b8f2a8..c2d2593f242d 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -61,6 +61,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr index 0ad408b81230..f346840913ce 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of constant value failed - --> tests/construct_runtime_ui/pallet_error_too_large.rs:90:1 - | -90 | / construct_runtime! { -91 | | pub struct Runtime -92 | | { -93 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, -94 | | Pallet: pallet::{Pallet}, -95 | | } -96 | | } - | |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:90:1 - | - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/construct_runtime_ui/pallet_error_too_large.rs:95:1 + | +95 | / construct_runtime! { +96 | | pub struct Runtime +97 | | { +98 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, +99 | | Pallet: pallet::{Pallet}, +100 | | } +101 | | } + | |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:95:1 + | + = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs index 62c4b1327e0a..9b5f8b75300b 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -36,6 +36,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr index c6dfeb792b8e..ef8996c18a29 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_call_part.stderr @@ -4,13 +4,13 @@ error: `Pallet` does not have #[pallet::call] defined, perhaps you should remove 22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet::{Pallet, Call}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet::{Pallet, Call}, +75 | | } +76 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_call_check::is_call_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs index 893690501a83..7d81edb89788 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -36,6 +36,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr index 6dd332630ada..02a864f2b672 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_event_part.stderr @@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::event] defined, perhaps you should remov 22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Event}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Event}, +75 | | } +76 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_event_check::is_event_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Event` in module `pallet` - --> tests/construct_runtime_ui/undefined_event_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_event_part.rs:70:1 | -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Event}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Event}, +75 | | } +76 | | } | |_^ not found in `pallet` | = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs index a3501ca31a37..e7e8900b3463 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -36,6 +36,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr index 00b5a1370036..ecc8e790a336 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.stderr @@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::genesis_config] defined, perhaps you sho 22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Config}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Config}, +75 | | } +76 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_genesis_config_check::is_genesis_config_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `GenesisConfig` in module `pallet` - --> tests/construct_runtime_ui/undefined_genesis_config_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_genesis_config_part.rs:70:1 | -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Config}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Config}, +75 | | } +76 | | } | |_^ not found in `pallet` | = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs index e22745930d69..3a3515bc5635 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -36,6 +36,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr index 749d2d9c159e..54344f371176 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.stderr @@ -4,31 +4,31 @@ error: `Pallet` does not have #[pallet::inherent] defined, perhaps you should re 22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +75 | | } +76 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_inherent_check::is_inherent_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `create_inherent` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:70:1 | 28 | pub struct Pallet(_); | -------------------- function or associated item `create_inherent` not found for this struct ... -65 | construct_runtime! { +70 | construct_runtime! { | _^ -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -70 | | } -71 | | } +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +75 | | } +76 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -37,19 +37,19 @@ error[E0599]: no function or associated item named `create_inherent` found for s = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `is_inherent` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:70:1 | 28 | pub struct Pallet(_); | -------------------- function or associated item `is_inherent` not found for this struct ... -65 | construct_runtime! { +70 | construct_runtime! { | _^ -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -70 | | } -71 | | } +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +75 | | } +76 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -58,19 +58,19 @@ error[E0599]: no function or associated item named `is_inherent` found for struc = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `check_inherent` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:70:1 | 28 | pub struct Pallet(_); | -------------------- function or associated item `check_inherent` not found for this struct ... -65 | construct_runtime! { +70 | construct_runtime! { | _^ -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -70 | | } -71 | | } +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +75 | | } +76 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -79,19 +79,19 @@ error[E0599]: no function or associated item named `check_inherent` found for st = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:70:1 | 28 | pub struct Pallet(_); | -------------------- associated item `INHERENT_IDENTIFIER` not found for this struct ... -65 | construct_runtime! { +70 | construct_runtime! { | _^ -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -70 | | } -71 | | } +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +75 | | } +76 | | } | |_^ associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope @@ -100,19 +100,19 @@ error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `p = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `is_inherent_required` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_inherent_part.rs:70:1 | 28 | pub struct Pallet(_); | -------------------- function or associated item `is_inherent_required` not found for this struct ... -65 | construct_runtime! { +70 | construct_runtime! { | _^ -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, -70 | | } -71 | | } +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Inherent}, +75 | | } +76 | | } | |_^ function or associated item not found in `Pallet` | = help: items from traits can only be used if the trait is implemented and in scope diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs index 656365279b88..439a29978575 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -36,6 +36,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr index 13612233e868..dd69c04ffd74 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.stderr @@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::origin] defined, perhaps you should remo 22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Origin}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Origin}, +75 | | } +76 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_origin_check::is_origin_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Origin` in module `pallet` - --> tests/construct_runtime_ui/undefined_origin_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_origin_part.rs:70:1 | -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet expanded::{}::{Pallet, Origin}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet expanded::{}::{Pallet, Origin}, +75 | | } +76 | | } | |_^ not found in `pallet` | = note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs index 05545821ab02..00752ed41f4e 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -36,6 +36,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr index 64677728c8b7..f0ffa8203f03 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.stderr @@ -4,46 +4,46 @@ error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you 22 | #[frame_support::pallet] | ^^^^^^^^^^^^^^^^^^^^^^^^ ... -65 | / construct_runtime! { -66 | | pub struct Runtime -67 | | { -68 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, -69 | | Pallet: pallet::{Pallet, ValidateUnsigned}, -70 | | } -71 | | } +70 | / construct_runtime! { +71 | | pub struct Runtime +72 | | { +73 | | System: frame_system::{Pallet, Call, Storage, Config, Event}, +74 | | Pallet: pallet::{Pallet, ValidateUnsigned}, +75 | | } +76 | | } | |_- in this macro invocation | = note: this error originates in the macro `pallet::__substrate_validate_unsigned_check::is_validate_unsigned_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no variant or associated item named `Pallet` found for enum `RuntimeCall` in the current scope - --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:69:3 + --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:74:3 | -65 | // construct_runtime! { -66 | || pub struct Runtime -67 | || { -68 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, -69 | || Pallet: pallet::{Pallet, ValidateUnsigned}, +70 | // construct_runtime! { +71 | || pub struct Runtime +72 | || { +73 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, +74 | || Pallet: pallet::{Pallet, ValidateUnsigned}, | || -^^^^^^ variant or associated item not found in `RuntimeCall` | ||________| | | ... | error[E0599]: no function or associated item named `pre_dispatch` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:70:1 | 28 | pub struct Pallet(_); | -------------------- function or associated item `pre_dispatch` not found for this struct ... -65 | construct_runtime! { +70 | construct_runtime! { | __^ | | _| | || -66 | || pub struct Runtime -67 | || { -68 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, -69 | || Pallet: pallet::{Pallet, ValidateUnsigned}, -70 | || } -71 | || } +71 | || pub struct Runtime +72 | || { +73 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, +74 | || Pallet: pallet::{Pallet, ValidateUnsigned}, +75 | || } +76 | || } | ||_- in this macro invocation ... | | @@ -54,21 +54,21 @@ error[E0599]: no function or associated item named `pre_dispatch` found for stru = note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no function or associated item named `validate_unsigned` found for struct `pallet::Pallet` in the current scope - --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:65:1 + --> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:70:1 | 28 | pub struct Pallet(_); | -------------------- function or associated item `validate_unsigned` not found for this struct ... -65 | construct_runtime! { +70 | construct_runtime! { | __^ | | _| | || -66 | || pub struct Runtime -67 | || { -68 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, -69 | || Pallet: pallet::{Pallet, ValidateUnsigned}, -70 | || } -71 | || } +71 | || pub struct Runtime +72 | || { +73 | || System: frame_system::{Pallet, Call, Storage, Config, Event}, +74 | || Pallet: pallet::{Pallet, ValidateUnsigned}, +75 | || } +76 | || } | ||_- in this macro invocation ... | | diff --git a/substrate/frame/support/test/tests/final_keys.rs b/substrate/frame/support/test/tests/final_keys.rs index 765afaf1e660..3b47a99a677b 100644 --- a/substrate/frame/support/test/tests/final_keys.rs +++ b/substrate/frame/support/test/tests/final_keys.rs @@ -16,7 +16,7 @@ // limitations under the License. use codec::Encode; -use frame_support::{derive_impl, storage::unhashed, StoragePrefixedMap}; +use frame_support::{derive_impl, parameter_types, storage::unhashed, StoragePrefixedMap}; use frame_system::pallet_prelude::BlockNumberFor; use sp_core::{sr25519, ConstU32}; @@ -210,6 +210,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; @@ -220,6 +224,7 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl no_instance::Config for Runtime {} diff --git a/substrate/frame/support/test/tests/genesisconfig.rs b/substrate/frame/support/test/tests/genesisconfig.rs index c6781220692a..77b07c289575 100644 --- a/substrate/frame/support/test/tests/genesisconfig.rs +++ b/substrate/frame/support/test/tests/genesisconfig.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::derive_impl; +use frame_support::{derive_impl, parameter_types}; use frame_system::pallet_prelude::BlockNumberFor; use sp_core::{sr25519, ConstU32}; use sp_runtime::{ @@ -79,6 +79,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -89,6 +93,7 @@ impl frame_system::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet::Config for Test {} diff --git a/substrate/frame/support/test/tests/instance.rs b/substrate/frame/support/test/tests/instance.rs index 43a93df9dea4..1bde3ecffe31 100644 --- a/substrate/frame/support/test/tests/instance.rs +++ b/substrate/frame/support/test/tests/instance.rs @@ -20,6 +20,7 @@ use frame_support::{ derive_impl, inherent::{InherentData, InherentIdentifier, MakeFatalError, ProvideInherent}, + parameter_types, traits::ConstU32, }; use frame_system::pallet_prelude::BlockNumberFor; @@ -299,6 +300,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; @@ -309,6 +314,7 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl module1::Config for Runtime { diff --git a/substrate/frame/support/test/tests/issue2219.rs b/substrate/frame/support/test/tests/issue2219.rs index 4016707b51a8..8dcaa7f16e45 100644 --- a/substrate/frame/support/test/tests/issue2219.rs +++ b/substrate/frame/support/test/tests/issue2219.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::derive_impl; +use frame_support::{derive_impl, parameter_types}; use frame_system::pallet_prelude::BlockNumberFor; use sp_core::{sr25519, ConstU64}; use sp_runtime::{ @@ -161,6 +161,10 @@ pub type Header = generic::Header; pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; pub type Block = generic::Block; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; @@ -171,6 +175,7 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl module::Config for Runtime {} diff --git a/substrate/frame/support/test/tests/origin.rs b/substrate/frame/support/test/tests/origin.rs index 5682bb500c7e..83fa9a0db277 100644 --- a/substrate/frame/support/test/tests/origin.rs +++ b/substrate/frame/support/test/tests/origin.rs @@ -20,7 +20,7 @@ #![recursion_limit = "128"] use frame_support::{ - derive_impl, + derive_impl, parameter_types, traits::{Contains, OriginTrait}, }; use sp_core::ConstU32; @@ -170,6 +170,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for RuntimeOriginTest { type BaseCallFilter = BaseCallFilter; @@ -180,6 +184,7 @@ impl frame_system::Config for RuntimeOriginTest { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl nested::module::Config for RuntimeOriginTest { diff --git a/substrate/frame/support/test/tests/pallet.rs b/substrate/frame/support/test/tests/pallet.rs index 1898246470c7..78cf5857a902 100644 --- a/substrate/frame/support/test/tests/pallet.rs +++ b/substrate/frame/support/test/tests/pallet.rs @@ -679,6 +679,8 @@ pub mod pallet5 { frame_support::parameter_types!( pub const MyGetParam3: u32 = 12; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = + sp_core::storage::StateVersion::V0; ); impl frame_system::Config for Runtime { @@ -705,6 +707,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet::Config for Runtime { type RuntimeEvent = RuntimeEvent; diff --git a/substrate/frame/support/test/tests/pallet_instance.rs b/substrate/frame/support/test/tests/pallet_instance.rs index 8d2d52d18852..af1e4d96210a 100644 --- a/substrate/frame/support/test/tests/pallet_instance.rs +++ b/substrate/frame/support/test/tests/pallet_instance.rs @@ -291,6 +291,10 @@ pub mod pallet2 { } } +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; @@ -315,6 +319,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet::Config for Runtime { type RuntimeEvent = RuntimeEvent; diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs index a8250f8b1532..79f249d9a37f 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::{derive_impl, traits::ConstU32}; +use frame_support::{derive_impl, parameter_types, traits::ConstU32}; mod common; @@ -25,6 +25,10 @@ pub type Header = sp_runtime::generic::Header; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; @@ -35,6 +39,7 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl common::outer_enums::pallet::Config for Runtime { diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs index 191f095f5d78..590aba06ff2f 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::{derive_impl, traits::ConstU32}; +use frame_support::{derive_impl, parameter_types, traits::ConstU32}; mod common; @@ -25,6 +25,10 @@ pub type Header = sp_runtime::generic::Header; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; @@ -35,6 +39,7 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl common::outer_enums::pallet::Config for Runtime { diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs b/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs index bf26cfd95b19..9b13ef155150 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs @@ -70,6 +70,10 @@ pub mod pallet { impl Pallet {} } +frame_support::parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; @@ -94,6 +98,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } pub type Header = sp_runtime::generic::Header; 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 9ab486c718c4..636bd9d0b3a1 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 @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::construct_runtime; +use frame_support::{construct_runtime, parameter_types}; use sp_core::sr25519; use sp_runtime::{generic, traits::BlakeTwo256}; @@ -27,6 +27,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } construct_runtime! { diff --git a/substrate/frame/support/test/tests/runtime_metadata.rs b/substrate/frame/support/test/tests/runtime_metadata.rs index a545735f2b1e..dbb2776997a4 100644 --- a/substrate/frame/support/test/tests/runtime_metadata.rs +++ b/substrate/frame/support/test/tests/runtime_metadata.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use frame_support::traits::ConstU32; +use frame_support::{parameter_types, traits::ConstU32}; use scale_info::{form::MetaForm, meta_type}; use sp_metadata_ir::{ RuntimeApiMetadataIR, RuntimeApiMethodMetadataIR, RuntimeApiMethodParamMetadataIR, @@ -27,6 +27,10 @@ pub type Header = sp_runtime::generic::Header; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BlockWeights = (); type BlockLength = (); @@ -51,6 +55,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } frame_support::construct_runtime!( diff --git a/substrate/frame/support/test/tests/storage_layers.rs b/substrate/frame/support/test/tests/storage_layers.rs index b825c85f9564..cd8d788ba15b 100644 --- a/substrate/frame/support/test/tests/storage_layers.rs +++ b/substrate/frame/support/test/tests/storage_layers.rs @@ -17,7 +17,7 @@ use frame_support::{ assert_noop, assert_ok, dispatch::DispatchResult, ensure, pallet_prelude::ConstU32, - storage::with_storage_layer, + parameter_types, storage::with_storage_layer, }; use pallet::*; use sp_io::TestExternalities; @@ -64,6 +64,10 @@ pub type Header = sp_runtime::generic::Header; pub type Block = sp_runtime::generic::Block; +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -88,6 +92,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl Config for Runtime {} diff --git a/substrate/frame/support/test/tests/storage_transaction.rs b/substrate/frame/support/test/tests/storage_transaction.rs index c47743308609..9e2c37997be4 100644 --- a/substrate/frame/support/test/tests/storage_transaction.rs +++ b/substrate/frame/support/test/tests/storage_transaction.rs @@ -21,6 +21,7 @@ use frame_support::{ assert_noop, assert_ok, assert_storage_noop, derive_impl, dispatch::DispatchResult, + parameter_types, storage::{with_transaction, TransactionOutcome::*}, transactional, }; @@ -88,6 +89,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; @@ -98,6 +103,7 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl Config for Runtime {} diff --git a/substrate/frame/support/test/tests/versioned_migration.rs b/substrate/frame/support/test/tests/versioned_migration.rs index 03dbd948df92..19adfdcf99cf 100644 --- a/substrate/frame/support/test/tests/versioned_migration.rs +++ b/substrate/frame/support/test/tests/versioned_migration.rs @@ -71,6 +71,10 @@ construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -81,6 +85,7 @@ impl frame_system::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletInfo = PalletInfo; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } pub(crate) fn new_test_ext() -> sp_io::TestExternalities { diff --git a/substrate/frame/system/benches/bench.rs b/substrate/frame/system/benches/bench.rs index da8bb10fd4e4..17626a9a5d39 100644 --- a/substrate/frame/system/benches/bench.rs +++ b/substrate/frame/system/benches/bench.rs @@ -16,7 +16,10 @@ // limitations under the License. use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use frame_support::traits::{ConstU32, ConstU64}; +use frame_support::{ + parameter_types, + traits::{ConstU32, ConstU64}, +}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -57,6 +60,11 @@ frame_support::parameter_types! { 4 * 1024 * 1024, Perbill::from_percent(75), ); } + +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -81,6 +89,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl module::Config for Runtime { diff --git a/substrate/frame/system/benchmarking/src/mock.rs b/substrate/frame/system/benchmarking/src/mock.rs index 4e6b1221da35..637d5ef78413 100644 --- a/substrate/frame/system/benchmarking/src/mock.rs +++ b/substrate/frame/system/benchmarking/src/mock.rs @@ -20,6 +20,7 @@ #![cfg(test)] use codec::Encode; +use frame_support::parameter_types; use sp_runtime::{traits::IdentityLookup, BuildStorage}; type AccountId = u64; @@ -34,6 +35,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -58,6 +63,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl crate::Config for Test {} diff --git a/substrate/frame/system/src/lib.rs b/substrate/frame/system/src/lib.rs index 84b6dc031457..e11235fbca52 100644 --- a/substrate/frame/system/src/lib.rs +++ b/substrate/frame/system/src/lib.rs @@ -137,17 +137,23 @@ const LOG_TARGET: &str = "runtime::system"; /// Compute the trie root of a list of extrinsics. /// /// The merkle proof is using the same trie as runtime state with -/// `state_version` 0. -pub fn extrinsics_root(extrinsics: &[E]) -> H::Output { - extrinsics_data_root::(extrinsics.iter().map(codec::Encode::encode).collect()) +/// `state_version`. +pub fn extrinsics_root( + extrinsics: &[E], + state_version: sp_core::storage::StateVersion, +) -> H::Output { + extrinsics_data_root::(extrinsics.iter().map(codec::Encode::encode).collect(), state_version) } /// Compute the trie root of a list of extrinsics. /// /// The merkle proof is using the same trie as runtime state with -/// `state_version` 0. -pub fn extrinsics_data_root(xts: Vec>) -> H::Output { - H::ordered_trie_root(xts, sp_core::storage::StateVersion::V0) +/// `state_version`. +pub fn extrinsics_data_root( + xts: Vec>, + state_version: sp_core::storage::StateVersion, +) -> H::Output { + H::ordered_trie_root(xts, state_version) } /// An object to track the currently used extrinsic weight in a block. @@ -205,6 +211,8 @@ pub mod pallet { /// Default implementations of [`DefaultConfig`], which can be used to implement [`Config`]. pub mod config_preludes { + use sp_core::{parameter_types, storage::StateVersion}; + use super::{inject_runtime_type, DefaultConfig}; /// Provides a viable default config that can be used with @@ -215,6 +223,10 @@ pub mod pallet { /// a downstream user of this particular `TestDefaultConfig` pub struct TestDefaultConfig; + parameter_types! { + pub const ExtrinsicsRootStateVersion: StateVersion = StateVersion::V0; + } + #[frame_support::register_default_impl(TestDefaultConfig)] impl DefaultConfig for TestDefaultConfig { type Nonce = u32; @@ -243,6 +255,7 @@ pub mod pallet { type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = frame_support::traits::ConstU64<10>; type OnSetCode = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } } @@ -401,6 +414,9 @@ pub mod pallet { /// The maximum number of consumers allowed on a single account. type MaxConsumers: ConsumerLimits; + + /// State verison used to derive extrinsics root. + type ExtrinsicsRootStateVersion: Get; } #[pallet::pallet] @@ -1447,7 +1463,8 @@ impl Pallet { let extrinsics = (0..ExtrinsicCount::::take().unwrap_or_default()) .map(ExtrinsicData::::take) .collect(); - let extrinsics_root = extrinsics_data_root::(extrinsics); + let extrinsics_root = + extrinsics_data_root::(extrinsics, T::ExtrinsicsRootStateVersion::get()); // move block hash pruning window by one block let block_hash_count = T::BlockHashCount::get(); diff --git a/substrate/frame/system/src/mock.rs b/substrate/frame/system/src/mock.rs index c016ea9e1cd1..866bac314886 100644 --- a/substrate/frame/system/src/mock.rs +++ b/substrate/frame/system/src/mock.rs @@ -76,6 +76,7 @@ parameter_types! { parameter_types! { pub static Killed: Vec = vec![]; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } pub struct RecordKilled; @@ -109,6 +110,7 @@ impl Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } pub type SysEvent = frame_system::Event; diff --git a/substrate/frame/system/src/tests.rs b/substrate/frame/system/src/tests.rs index 165df688b1c2..b9133bf91210 100644 --- a/substrate/frame/system/src/tests.rs +++ b/substrate/frame/system/src/tests.rs @@ -721,7 +721,10 @@ fn extrinsics_root_is_calculated_correctly() { System::note_finished_extrinsics(); let header = System::finalize(); - let ext_root = extrinsics_data_root::(vec![vec![1], vec![2]]); + let ext_root = extrinsics_data_root::( + vec![vec![1], vec![2]], + sp_core::storage::StateVersion::V0, + ); assert_eq!(ext_root, *header.extrinsics_root()); }); } diff --git a/substrate/frame/timestamp/src/mock.rs b/substrate/frame/timestamp/src/mock.rs index 418d257b3f00..b8b74341bbed 100644 --- a/substrate/frame/timestamp/src/mock.rs +++ b/substrate/frame/timestamp/src/mock.rs @@ -42,6 +42,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -66,6 +70,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/tips/src/tests.rs b/substrate/frame/tips/src/tests.rs index a700892d4270..9d55150f4328 100644 --- a/substrate/frame/tips/src/tests.rs +++ b/substrate/frame/tips/src/tests.rs @@ -52,7 +52,9 @@ frame_support::construct_runtime!( parameter_types! { pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -77,6 +79,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs b/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs index bfbe8b4178ce..48cd0f2fcfbb 100644 --- a/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs @@ -76,6 +76,7 @@ impl Get for BlockWeights { parameter_types! { pub static WeightToFee: u64 = 1; pub static TransactionByteFee: u64 = 1; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -102,6 +103,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { 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 b8d7b523ca25..b9ae358a680b 100644 --- a/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs @@ -68,6 +68,7 @@ impl Get for BlockWeights { parameter_types! { pub static WeightToFee: u64 = 1; pub static TransactionByteFee: u64 = 1; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -94,6 +95,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/transaction-payment/src/mock.rs b/substrate/frame/transaction-payment/src/mock.rs index 97253be46305..1633680ec706 100644 --- a/substrate/frame/transaction-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/src/mock.rs @@ -67,6 +67,7 @@ parameter_types! { pub static WeightToFee: u64 = 1; pub static TransactionByteFee: u64 = 1; pub static OperationalFeeMultiplier: u8 = 5; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Runtime { @@ -93,6 +94,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Runtime { diff --git a/substrate/frame/transaction-storage/src/mock.rs b/substrate/frame/transaction-storage/src/mock.rs index 243e26b55905..ae4102fdbe9a 100644 --- a/substrate/frame/transaction-storage/src/mock.rs +++ b/substrate/frame/transaction-storage/src/mock.rs @@ -21,7 +21,10 @@ use crate::{ self as pallet_transaction_storage, TransactionStorageProof, DEFAULT_MAX_BLOCK_TRANSACTIONS, DEFAULT_MAX_TRANSACTION_SIZE, }; -use frame_support::traits::{ConstU16, ConstU32, ConstU64, OnFinalize, OnInitialize}; +use frame_support::{ + parameter_types, + traits::{ConstU16, ConstU32, ConstU64, OnFinalize, OnInitialize}, +}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -42,6 +45,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -66,6 +73,7 @@ impl frame_system::Config for Test { type SS58Prefix = ConstU16<42>; type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/treasury/src/tests.rs b/substrate/frame/treasury/src/tests.rs index ba45d5f6ff16..92ff12b5c921 100644 --- a/substrate/frame/treasury/src/tests.rs +++ b/substrate/frame/treasury/src/tests.rs @@ -48,6 +48,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -72,6 +76,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { type MaxLocks = (); diff --git a/substrate/frame/tx-pause/src/mock.rs b/substrate/frame/tx-pause/src/mock.rs index 60c5fc1eced5..b597d98c4c32 100644 --- a/substrate/frame/tx-pause/src/mock.rs +++ b/substrate/frame/tx-pause/src/mock.rs @@ -35,6 +35,7 @@ use sp_runtime::{ parameter_types! { pub const BlockHashCount: u64 = 250; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = InsideBoth; @@ -60,6 +61,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } parameter_types! { diff --git a/substrate/frame/uniques/src/mock.rs b/substrate/frame/uniques/src/mock.rs index 5c44a7ed7a53..af2879304735 100644 --- a/substrate/frame/uniques/src/mock.rs +++ b/substrate/frame/uniques/src/mock.rs @@ -21,7 +21,7 @@ use super::*; use crate as pallet_uniques; use frame_support::{ - construct_runtime, + construct_runtime, parameter_types, traits::{AsEnsureOriginWithArg, ConstU32, ConstU64}, }; use sp_core::H256; @@ -41,6 +41,10 @@ construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -65,6 +69,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/utility/src/tests.rs b/substrate/frame/utility/src/tests.rs index 183853c4e8ac..2d5dee7cfa22 100644 --- a/substrate/frame/utility/src/tests.rs +++ b/substrate/frame/utility/src/tests.rs @@ -143,6 +143,7 @@ frame_support::construct_runtime!( parameter_types! { pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::simple_max(Weight::MAX); + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; } impl frame_system::Config for Test { type BaseCallFilter = TestBaseCallFilter; @@ -168,6 +169,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/vesting/src/mock.rs b/substrate/frame/vesting/src/mock.rs index fe1779475a69..ceb102169fce 100644 --- a/substrate/frame/vesting/src/mock.rs +++ b/substrate/frame/vesting/src/mock.rs @@ -39,6 +39,10 @@ frame_support::construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type AccountData = pallet_balances::AccountData; type AccountId = u64; @@ -63,6 +67,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type SystemWeightInfo = (); type Version = (); + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/frame/whitelist/src/mock.rs b/substrate/frame/whitelist/src/mock.rs index d91f43b33af9..18bc898f480e 100644 --- a/substrate/frame/whitelist/src/mock.rs +++ b/substrate/frame/whitelist/src/mock.rs @@ -22,7 +22,7 @@ use crate as pallet_whitelist; use frame_support::{ - construct_runtime, + construct_runtime, parameter_types, traits::{ConstU32, ConstU64, Nothing}, }; use frame_system::EnsureRoot; @@ -44,6 +44,10 @@ construct_runtime!( } ); +parameter_types! { + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +} + impl frame_system::Config for Test { type BaseCallFilter = Nothing; type BlockWeights = (); @@ -68,6 +72,7 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } impl pallet_balances::Config for Test { diff --git a/substrate/test-utils/runtime/src/lib.rs b/substrate/test-utils/runtime/src/lib.rs index b116c8556815..7a9e78b3ef37 100644 --- a/substrate/test-utils/runtime/src/lib.rs +++ b/substrate/test-utils/runtime/src/lib.rs @@ -319,6 +319,7 @@ const MAXIMUM_BLOCK_WEIGHT: Weight = parameter_types! { pub const BlockHashCount: BlockNumber = 2400; pub const Version: RuntimeVersion = VERSION; + pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; pub RuntimeBlockLength: BlockLength = BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); @@ -367,6 +368,7 @@ impl frame_system::pallet::Config for Runtime { type SS58Prefix = (); type OnSetCode = (); type MaxConsumers = ConstU32<16>; + type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; } pub mod currency { diff --git a/substrate/utils/frame/rpc/support/src/lib.rs b/substrate/utils/frame/rpc/support/src/lib.rs index 2d8e45cbfc69..631f244c8718 100644 --- a/substrate/utils/frame/rpc/support/src/lib.rs +++ b/substrate/utils/frame/rpc/support/src/lib.rs @@ -34,7 +34,7 @@ use sp_storage::{StorageData, StorageKey}; /// # use jsonrpsee::core::Error as RpcError; /// # use jsonrpsee::ws_client::WsClientBuilder; /// # use codec::Encode; -/// # use frame_support::{construct_runtime, traits::ConstU32}; +/// # use frame_support::{construct_runtime, traits::ConstU32, parameter_types}; /// # use substrate_frame_rpc_support::StorageQuery; /// # use sc_rpc_api::state::StateApiClient; /// # use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::Header}; @@ -48,6 +48,9 @@ use sp_storage::{StorageData, StorageKey}; /// # ); /// # /// # type Hash = sp_core::H256; +/// # parameter_types! { +/// # pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0; +/// # } /// # /// # impl frame_system::Config for TestRuntime { /// # type BaseCallFilter = (); @@ -73,6 +76,7 @@ use sp_storage::{StorageData, StorageKey}; /// # type SS58Prefix = (); /// # type OnSetCode = (); /// # type MaxConsumers = ConstU32<16>; +/// # type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion; /// # } /// # /// # impl pallet_test::Config for TestRuntime {}