Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into remove-sc-network-c…
Browse files Browse the repository at this point in the history
…ommon
  • Loading branch information
altonen committed Mar 14, 2023
2 parents 92744bb + 2c3cd02 commit daf495c
Show file tree
Hide file tree
Showing 32 changed files with 301 additions and 311 deletions.
542 changes: 270 additions & 272 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/relay-chain-inprocess-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master
# Polkadot
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-test-client = { git = "https://github.com/paritytech/polkadot", branch = "master" }
metered = { package = "prioritized-metered-channel", version = "0.2.0" }
metered = { package = "prioritized-metered-channel", version = "0.4.0" }

# Cumulus
cumulus-test-service = { path = "../../test/service" }
1 change: 0 additions & 1 deletion pallets/collator-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ pub mod pallet {
}

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

/// The invulnerable, fixed collators.
Expand Down
1 change: 0 additions & 1 deletion pallets/dmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ pub mod pallet {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(migration::STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
Expand Down
6 changes: 3 additions & 3 deletions pallets/dmp-queue/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! A module that is responsible for migration of storage.

use crate::{Config, Pallet, Store, DEFAULT_POV_SIZE};
use crate::{Config, Configuration, Overweight, Pallet, DEFAULT_POV_SIZE};
use frame_support::{
pallet_prelude::*,
traits::StorageVersion,
Expand Down Expand Up @@ -74,7 +74,7 @@ pub fn migrate_to_v1<T: Config>() -> Weight {
}
};

if let Err(_) = <Pallet<T> as Store>::Configuration::translate(|pre| pre.map(translate)) {
if let Err(_) = Configuration::<T>::translate(|pre| pre.map(translate)) {
log::error!(
target: "dmp_queue",
"unexpected error when performing translation of the QueueConfig type during storage upgrade to v2"
Expand All @@ -89,7 +89,7 @@ pub fn migrate_to_v1<T: Config>() -> Weight {
/// NOTE: Only use this function if you know what you're doing. Default to using
/// `migrate_to_latest`.
pub fn migrate_to_v2<T: Config>() -> Weight {
let overweight_messages = <Pallet<T> as Store>::Overweight::initialize_counter() as u64;
let overweight_messages = Overweight::<T>::initialize_counter() as u64;

T::DbWeight::get().reads_writes(overweight_messages, 1)
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/parachain-system/proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ proc-macro = true

[dependencies]
syn = "1.0.109"
proc-macro2 = "1.0.50"
proc-macro2 = "1.0.52"
quote = "1.0.23"
proc-macro-crate = "1.3.1"

Expand Down
1 change: 0 additions & 1 deletion pallets/parachain-system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::storage_version(migration::STORAGE_VERSION)]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);

Expand Down
10 changes: 3 additions & 7 deletions pallets/parachain-system/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

use crate::{Config, Pallet, Store};
use crate::{Config, Pallet, ReservedDmpWeightOverride, ReservedXcmpWeightOverride};
use frame_support::{
traits::{Get, StorageVersion},
weights::Weight,
Expand Down Expand Up @@ -52,18 +52,14 @@ mod v2 {
pub fn migrate<T: Config>() -> Weight {
let translate = |pre: u64| -> Weight { Weight::from_parts(pre, DEFAULT_POV_SIZE) };

if <Pallet<T> as Store>::ReservedXcmpWeightOverride::translate(|pre| pre.map(translate))
.is_err()
{
if ReservedXcmpWeightOverride::<T>::translate(|pre| pre.map(translate)).is_err() {
log::error!(
target: "parachain_system",
"unexpected error when performing translation of the ReservedXcmpWeightOverride type during storage upgrade to v2"
);
}

if <Pallet<T> as Store>::ReservedDmpWeightOverride::translate(|pre| pre.map(translate))
.is_err()
{
if ReservedDmpWeightOverride::<T>::translate(|pre| pre.map(translate)).is_err() {
log::error!(
target: "parachain_system",
"unexpected error when performing translation of the ReservedDmpWeightOverride type during storage upgrade to v2"
Expand Down
1 change: 0 additions & 1 deletion pallets/solo-to-para/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pub mod pallet {
}

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);

Expand Down
1 change: 0 additions & 1 deletion pallets/xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ pub mod pallet {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

/// The module configuration trait.
Expand Down
5 changes: 2 additions & 3 deletions pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ pub mod pallet {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(migration::STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
Expand Down Expand Up @@ -763,13 +762,13 @@ impl<T: Config> Pallet<T> {
sent_at: RelayBlockNumber,
xcm: Vec<u8>,
) -> OverweightIndex {
let index = <Self as Store>::OverweightCount::mutate(|count| {
let index = OverweightCount::<T>::mutate(|count| {
let index = *count;
*count += 1;
index
});

<Self as Store>::Overweight::insert(index, (sender, sent_at, xcm));
Overweight::<T>::insert(index, (sender, sent_at, xcm));
index
}

Expand Down
6 changes: 3 additions & 3 deletions pallets/xcmp-queue/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! A module that is responsible for migration of storage.

use crate::{Config, Pallet, Store, DEFAULT_POV_SIZE};
use crate::{Config, Overweight, Pallet, QueueConfig, DEFAULT_POV_SIZE};
use frame_support::{
pallet_prelude::*,
traits::StorageVersion,
Expand Down Expand Up @@ -94,7 +94,7 @@ pub fn migrate_to_v2<T: Config>() -> Weight {
}
};

if let Err(_) = <Pallet<T> as Store>::QueueConfig::translate(|pre| pre.map(translate)) {
if let Err(_) = QueueConfig::<T>::translate(|pre| pre.map(translate)) {
log::error!(
target: super::LOG_TARGET,
"unexpected error when performing translation of the QueueConfig type during storage upgrade to v2"
Expand All @@ -105,7 +105,7 @@ pub fn migrate_to_v2<T: Config>() -> Weight {
}

pub fn migrate_to_v3<T: Config>() -> Weight {
let overweight_messages = <Pallet<T> as Store>::Overweight::initialize_counter() as u64;
let overweight_messages = Overweight::<T>::initialize_counter() as u64;

T::DbWeight::get().reads_writes(overweight_messages, 1)
}
Expand Down
1 change: 0 additions & 1 deletion parachain-template/pallets/template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub mod pallet {
}

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

// The pallet's runtime storage items.
Expand Down
1 change: 0 additions & 1 deletion parachains/pallets/parachain-info/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub mod pallet {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

#[pallet::config]
Expand Down
1 change: 0 additions & 1 deletion parachains/pallets/ping/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pub mod pallet {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

/// The module configuration trait.
Expand Down
4 changes: 2 additions & 2 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 11,
transaction_version: 12,
state_version: 1,
};

Expand All @@ -105,7 +105,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 11,
transaction_version: 12,
state_version: 0,
};

Expand Down
1 change: 1 addition & 0 deletions parachains/runtimes/assets/statemine/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
}

match call {
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 11,
transaction_version: 12,
state_version: 0,
};

Expand Down
1 change: 1 addition & 0 deletions parachains/runtimes/assets/statemint/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
}

match call {
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 11,
transaction_version: 12,
state_version: 0,
};

Expand Down
1 change: 1 addition & 0 deletions parachains/runtimes/assets/westmint/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
}

match call {
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 1,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
}

match call {
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
}

match call {
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 1,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
}

match call {
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
transaction_version: 3,
state_version: 0,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
pallet_collator_selection::Call::leave_intent { .. },
) |
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
RuntimeCall::XcmpQueue(..) |
RuntimeCall::DmpQueue(..) |
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
Expand Down Expand Up @@ -178,8 +179,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
pallet_collective::Call::close_old_weight { .. } |
pallet_collective::Call::disapprove_proposal { .. } |
pallet_collective::Call::close { .. },
) |
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) => true,
) => true,
_ => false,
}
}
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
transaction_version: 5,
state_version: 1,
};

Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/testing/rococo-parachain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9381,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
transaction_version: 5,
state_version: 0,
};

Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-parachain-bin"
version = "0.9.370"
version = "0.9.380"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
edition = "2021"
Expand Down
1 change: 0 additions & 1 deletion test/runtime/src/test_pallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub mod pallet {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

#[pallet::config]
Expand Down

0 comments on commit daf495c

Please sign in to comment.