From 7f0eb5f06e4a403b10be1f7893859dde79f4d813 Mon Sep 17 00:00:00 2001 From: Juan Date: Wed, 23 Aug 2023 13:39:43 +0200 Subject: [PATCH 1/4] Companion: restructure macro related exports (#7626) * move RuntimeDebug out of frame_support * move RuntimeDebug out of frame_support * fix xcm export * ".git/.scripts/commands/fmt/fmt.sh" * fix xcm intefration tests * fix cargo lock for xcm intefration tests * wip * restructure benchmarking macro related exports * update cargo lock --------- Co-authored-by: parity-processbot <> --- Cargo.lock | 5 +++++ runtime/kusama/Cargo.toml | 1 + runtime/kusama/src/lib.rs | 7 ++++--- runtime/polkadot/Cargo.toml | 1 + runtime/polkadot/src/lib.rs | 7 ++++--- runtime/rococo/Cargo.toml | 1 + runtime/rococo/src/lib.rs | 7 ++++--- runtime/westend/Cargo.toml | 1 + runtime/westend/src/lib.rs | 3 ++- xcm/xcm-executor/integration-tests/Cargo.toml | 1 + xcm/xcm-executor/integration-tests/src/lib.rs | 3 ++- xcm/xcm-simulator/example/src/lib.rs | 2 +- 12 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b19bc139384..61f838f8c35e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4387,6 +4387,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-trie", @@ -8405,6 +8406,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-trie", @@ -9834,6 +9836,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-trie", @@ -14745,6 +14748,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-version", @@ -15184,6 +15188,7 @@ dependencies = [ "frame-system", "futures", "pallet-xcm", + "parity-scale-codec", "polkadot-test-client", "polkadot-test-runtime", "polkadot-test-service", diff --git a/runtime/kusama/Cargo.toml b/runtime/kusama/Cargo.toml index a88654d26121..3a253f47dde6 100644 --- a/runtime/kusama/Cargo.toml +++ b/runtime/kusama/Cargo.toml @@ -34,6 +34,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 3d6a56cfecbd..e9e3fb2d2026 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -67,7 +67,7 @@ use frame_support::{ PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons, }, weights::{ConstantMultiplier, WeightMeter}, - PalletId, RuntimeDebug, + PalletId, }; use frame_system::EnsureRoot; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; @@ -82,7 +82,7 @@ use sp_runtime::{ Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; #[cfg(any(feature = "std", test))] @@ -2330,7 +2330,8 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; + use sp_storage::TrackedStorageKey; // Trying to add benchmarks directly to some pallets caused cyclic dependency issues. // To get around that, we separated the benchmarks into its own crate. use pallet_session_benchmarking::Pallet as SessionBench; diff --git a/runtime/polkadot/Cargo.toml b/runtime/polkadot/Cargo.toml index 5d343811fb14..76a01051a122 100644 --- a/runtime/polkadot/Cargo.toml +++ b/runtime/polkadot/Cargo.toml @@ -33,6 +33,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-npos-elections = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index dca0d0d986da..c4458076cb3d 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -51,7 +51,7 @@ use frame_support::{ ProcessMessage, ProcessMessageError, WithdrawReasons, }, weights::{ConstantMultiplier, WeightMeter}, - PalletId, RuntimeDebug, + PalletId, }; use frame_system::EnsureRoot; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; @@ -78,7 +78,7 @@ use sp_runtime::{ OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*}; @@ -2077,7 +2077,8 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; + use sp_storage::TrackedStorageKey; // Trying to add benchmarks directly to some pallets caused cyclic dependency issues. // To get around that, we separated the benchmarks into its own crate. use pallet_session_benchmarking::Pallet as SessionBench; diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index 95791edda710..527bc1af9ccc 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -30,6 +30,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 145b25d8aa9a..6894bd7bbf44 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -64,7 +64,7 @@ use frame_support::{ PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons, }, weights::{ConstantMultiplier, WeightMeter}, - PalletId, RuntimeDebug, + PalletId, }; use frame_system::EnsureRoot; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; @@ -79,7 +79,7 @@ use sp_runtime::{ Extrinsic as ExtrinsicT, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; #[cfg(any(feature = "std", test))] @@ -2114,9 +2114,10 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; use frame_system_benchmarking::Pallet as SystemBench; use frame_benchmarking::baseline::Pallet as Baseline; + use sp_storage::TrackedStorageKey; use xcm::latest::prelude::*; use xcm_config::{ LocalCheckAccount, LocationConverter, Rockmine, TokenLocation, XcmConfig, diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index a0b13145578d..0231198ba820 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -31,6 +31,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 62770e0992fb..9ae30c376010 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -2006,7 +2006,8 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; + use sp_storage::TrackedStorageKey; // Trying to add benchmarks directly to some pallets caused cyclic dependency issues. // To get around that, we separated the benchmarks into its own crate. use pallet_session_benchmarking::Pallet as SessionBench; diff --git a/xcm/xcm-executor/integration-tests/Cargo.toml b/xcm/xcm-executor/integration-tests/Cargo.toml index 18a729e082d2..cec9754baa31 100644 --- a/xcm/xcm-executor/integration-tests/Cargo.toml +++ b/xcm/xcm-executor/integration-tests/Cargo.toml @@ -8,6 +8,7 @@ version.workspace = true publish = false [dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1" } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } futures = "0.3.21" diff --git a/xcm/xcm-executor/integration-tests/src/lib.rs b/xcm/xcm-executor/integration-tests/src/lib.rs index 111833e67cfb..d8c77f8317e1 100644 --- a/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/xcm/xcm-executor/integration-tests/src/lib.rs @@ -17,7 +17,8 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(test)] -use frame_support::{codec::Encode, dispatch::GetDispatchInfo, weights::Weight}; +use codec::Encode; +use frame_support::{dispatch::GetDispatchInfo, weights::Weight}; use polkadot_test_client::{ BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt, diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index 1f6956485a84..85b8ad1c5cb7 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -17,8 +17,8 @@ mod parachain; mod relay_chain; -use frame_support::sp_tracing; use sp_runtime::BuildStorage; +use sp_tracing; use xcm::prelude::*; use xcm_executor::traits::ConvertLocation; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt}; From 52034bde2adec776ee68dc9595015b2514eca6b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:19:27 +0000 Subject: [PATCH 2/4] Bump chevdor/srtool-actions from 0.7.0 to 0.8.0 (#7660) Bumps [chevdor/srtool-actions](https://github.com/chevdor/srtool-actions) from 0.7.0 to 0.8.0. - [Release notes](https://github.com/chevdor/srtool-actions/releases) - [Commits](https://github.com/chevdor/srtool-actions/compare/v0.7.0...v0.8.0) --- updated-dependencies: - dependency-name: chevdor/srtool-actions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-30_publish-draft-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-30_publish-draft-release.yml b/.github/workflows/release-30_publish-draft-release.yml index ce6f31fa5483..206b1871d80a 100644 --- a/.github/workflows/release-30_publish-draft-release.yml +++ b/.github/workflows/release-30_publish-draft-release.yml @@ -40,7 +40,7 @@ jobs: - name: Build ${{ matrix.runtime }} runtime id: srtool_build - uses: chevdor/srtool-actions@v0.7.0 + uses: chevdor/srtool-actions@v0.8.0 with: image: paritytech/srtool chain: ${{ matrix.runtime }} From ebb610fc320c533dee7383b0aa687a29a61dceb0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 13:08:44 +0200 Subject: [PATCH 3/4] Bump rustls-webpki from 0.101.2 to 0.101.4 (#7653) Bumps [rustls-webpki](https://github.com/rustls/webpki) from 0.101.2 to 0.101.4. - [Release notes](https://github.com/rustls/webpki/releases) - [Commits](https://github.com/rustls/webpki/compare/v/0.101.2...v/0.101.4) --- updated-dependencies: - dependency-name: rustls-webpki dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61f838f8c35e..3271f6671401 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10061,9 +10061,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.2" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ "ring 0.16.20", "untrusted", From f3da93d3e28e990fc52c5e9d5fb0fac7154d97e4 Mon Sep 17 00:00:00 2001 From: Chris Sosnin <48099298+slumber@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:00:10 +0300 Subject: [PATCH 4/4] extend abridged host config (#7659) added asynchronous backing params --- primitives/src/v5/mod.rs | 2 ++ runtime/parachains/src/configuration.rs | 4 ++-- runtime/parachains/src/configuration/tests.rs | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/primitives/src/v5/mod.rs b/primitives/src/v5/mod.rs index 4e107c881d4e..59fb6c927b2d 100644 --- a/primitives/src/v5/mod.rs +++ b/primitives/src/v5/mod.rs @@ -1165,6 +1165,8 @@ pub struct AbridgedHostConfiguration { pub validation_upgrade_cooldown: BlockNumber, /// The delay, in blocks, before a validation upgrade is applied. pub validation_upgrade_delay: BlockNumber, + /// Asynchronous backing parameters. + pub async_backing_params: super::vstaging::AsyncBackingParams, } /// Abridged version of `HrmpChannel` (from the `Hrmp` parachains host runtime module) meant to be diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index 03d1ae420495..accc01a2b180 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -124,13 +124,13 @@ pub struct HostConfiguration { /// /// [#4601]: https://github.com/paritytech/polkadot/issues/4601 pub validation_upgrade_delay: BlockNumber, + /// Asynchronous backing parameters. + pub async_backing_params: AsyncBackingParams, /** * The parameters that are not essential, but still may be of interest for parachains. */ - /// Asynchronous backing parameters. - pub async_backing_params: AsyncBackingParams, /// The maximum POV block size, in bytes. pub max_pov_size: u32, /// The maximum size of a message that can be put in a downward message queue. diff --git a/runtime/parachains/src/configuration/tests.rs b/runtime/parachains/src/configuration/tests.rs index 83de7db932b4..43c03067a9a7 100644 --- a/runtime/parachains/src/configuration/tests.rs +++ b/runtime/parachains/src/configuration/tests.rs @@ -487,7 +487,9 @@ fn verify_externally_accessible() { use primitives::{well_known_keys, AbridgedHostConfiguration}; new_test_ext(Default::default()).execute_with(|| { - let ground_truth = HostConfiguration::default(); + let mut ground_truth = HostConfiguration::default(); + ground_truth.async_backing_params = + AsyncBackingParams { allowed_ancestry_len: 111, max_candidate_depth: 222 }; // Make sure that the configuration is stored in the storage. ActiveConfig::::put(ground_truth.clone()); @@ -511,6 +513,7 @@ fn verify_externally_accessible() { hrmp_max_message_num_per_candidate: ground_truth.hrmp_max_message_num_per_candidate, validation_upgrade_cooldown: ground_truth.validation_upgrade_cooldown, validation_upgrade_delay: ground_truth.validation_upgrade_delay, + async_backing_params: ground_truth.async_backing_params, }, ); });