From 5a50c5aae8540bc992d8f807d14df074e69ee86d Mon Sep 17 00:00:00 2001 From: Adrian Catangiu Date: Tue, 7 May 2024 11:02:56 +0300 Subject: [PATCH 01/15] kusama chains: allow arbitrary XCM execution (#261) Kusama relay is the only chain here allowing arbitrary XCM execution. This was enabled in https://github.com/paritytech/polkadot/pull/4809 for (afaict) allowing crafting and executing XCM DOT transfers. Now, these are done through dedicated extrinsics and manual `pallet_xcm::execute` is not required (for transfers at least). AFAICT, allowing `Everything` on Kusama should also be safe at this point (XCM is pretty mature) and fosters experimentation and more flexibility on Kusama. But in that case, maybe we should also allow it on Kusama system chains? Thoughts? --- CHANGELOG.md | 1 + .../asset-hubs/asset-hub-kusama/src/xcm_config.rs | 6 ++---- .../bridge-hubs/bridge-hub-kusama/src/xcm_config.rs | 5 ++--- .../coretime/coretime-kusama/src/xcm_config.rs | 5 ++--- system-parachains/encointer/src/xcm_config.rs | 6 ++---- system-parachains/people/people-kusama/src/xcm_config.rs | 5 ++--- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caaec5bd1e..afbc92f51b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Remove DMP queue and allow `system::authorize_upgrade` in XCM's call filter ([polkadot-fellows/runtimes#280](https://github.com/polkadot-fellows/runtimes/pull/280)) - Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) - Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) +- Kusama chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#261](https://github.com/polkadot-fellows/runtimes/pull/261)) ## [1.2.3] 29.04.2024 diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs index b1c10cda6e..c56e477b7c 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs @@ -647,11 +647,9 @@ impl pallet_xcm::Config for Runtime { // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are - // allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index 11d9710fed..aec2728cc3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -338,10 +338,9 @@ impl pallet_xcm::Config for Runtime { // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports are allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. diff --git a/system-parachains/coretime/coretime-kusama/src/xcm_config.rs b/system-parachains/coretime/coretime-kusama/src/xcm_config.rs index 787a7224be..cde44f46a3 100644 --- a/system-parachains/coretime/coretime-kusama/src/xcm_config.rs +++ b/system-parachains/coretime/coretime-kusama/src/xcm_config.rs @@ -286,10 +286,9 @@ impl pallet_xcm::Config for Runtime { // We want to disallow users sending (arbitrary) XCM programs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports are allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. diff --git a/system-parachains/encointer/src/xcm_config.rs b/system-parachains/encointer/src/xcm_config.rs index c50c5c6b69..22fd1f103b 100644 --- a/system-parachains/encointer/src/xcm_config.rs +++ b/system-parachains/encointer/src/xcm_config.rs @@ -216,11 +216,9 @@ impl pallet_xcm::Config for Runtime { // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are - // allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; diff --git a/system-parachains/people/people-kusama/src/xcm_config.rs b/system-parachains/people/people-kusama/src/xcm_config.rs index bf61061d34..a33ce1d692 100644 --- a/system-parachains/people/people-kusama/src/xcm_config.rs +++ b/system-parachains/people/people-kusama/src/xcm_config.rs @@ -296,10 +296,9 @@ impl pallet_xcm::Config for Runtime { // We want to disallow users sending (arbitrary) XCM programs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports are allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. From a0504f47f7fcb41fde3a23322ad40722f860be27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Tue, 7 May 2024 10:50:11 +0100 Subject: [PATCH 02/15] Remove one-shot migrations from Kusama Coretime (#300) Several one-shot (single use) migrations were used in the launch of Coretime on Kusama. This PR removes them from the codebase since they are no longer relevant. I've intentionally not bumped the spec_version, since I'm not suggesting this be released. - [ ] Does not require a CHANGELOG entry --- CHANGELOG.md | 4 + .../coretime/coretime-kusama/src/lib.rs | 3 - .../coretime-kusama/src/migrations.rs | 263 ------------------ 3 files changed, 4 insertions(+), 266 deletions(-) delete mode 100644 system-parachains/coretime/coretime-kusama/src/migrations.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index afbc92f51b..ac195fd95d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) - Kusama chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#261](https://github.com/polkadot-fellows/runtimes/pull/261)) +### Removed + +- Remove one-shot migrations from Kusama Coretime ([polkadot-fellows/runtimes#300](https://github.com/polkadot-fellows/runtimes/pull/300)) + ## [1.2.3] 29.04.2024 ### Added diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index ec946250ac..a0871ce399 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -23,7 +23,6 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); mod coretime; -mod migrations; #[cfg(test)] mod tests; mod weights; @@ -110,8 +109,6 @@ pub type UncheckedExtrinsic = pub type Migrations = ( pallet_xcm::migration::MigrateToLatestXcmVersion, pallet_collator_selection::migration::v2::MigrationToV2, - migrations::bootstrapping::RemoveOutdatedPoolAssignment, - migrations::bootstrapping::OnboardPeople, ); /// Executive: handles dispatch to the various modules. diff --git a/system-parachains/coretime/coretime-kusama/src/migrations.rs b/system-parachains/coretime/coretime-kusama/src/migrations.rs deleted file mode 100644 index 5caa111580..0000000000 --- a/system-parachains/coretime/coretime-kusama/src/migrations.rs +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md -// for a list of specific contributors. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/// The Kusama Coretime chain had some launch issues. These migrations clean up state and enable -/// immediate onboarding of system parachains. -/// -/// None of these migrations affect storage structure, only values. -pub mod bootstrapping { - use crate::{weights, Runtime, RuntimeOrigin}; - use frame_support::{pallet_prelude::*, traits::OnRuntimeUpgrade}; - #[cfg(feature = "try-runtime")] - use pallet_broker::StatusRecord; - use pallet_broker::{ - AllowedRenewals, - CoreAssignment::{Pool, Task}, - CoreIndex, CoreMask, Leases, Reservations, SaleInfo, Schedule, ScheduleItem, Status, - Timeslice, WeightInfo, Workplan, - }; - #[cfg(feature = "try-runtime")] - use sp_runtime::TryRuntimeError; - use sp_std::vec::Vec; - - /// The log target. - const TARGET: &str = "runtime::bootstrapping::onboard-people"; - - // The key in Workplan with the outdated assignment. - const WORKPLAN_KEY: (Timeslice, CoreIndex) = (289960, 4); - - // Alias to the broker weights for this runtime. - type BrokerWeights = weights::pallet_broker::WeightInfo; - type RuntimeDbWeight = ::DbWeight; - - /// This migration cleans up an outdated pool assignment in state from the update to Kusama - /// Coretime 1002002. - pub struct RemoveOutdatedPoolAssignment; - - impl OnRuntimeUpgrade for RemoveOutdatedPoolAssignment { - fn on_runtime_upgrade() -> Weight { - let schedule_pool = Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment: Pool, - }])); - if Workplan::::get(WORKPLAN_KEY) != Some(schedule_pool) { - // Erroneous pool core assignment is not in state. Bailing. - log::error!(target: TARGET, "This migration includes hardcoded values not relevant to this runtime. Bailing."); - return RuntimeDbWeight::get().reads(1); - } - - // Overwrite outdated pool core assignment to keep parachain 2000 on core. - let schedule_2000 = Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment: Task(2000), - }])); - Workplan::::insert(WORKPLAN_KEY, schedule_2000); - - log::info!(target: TARGET, "Outdated Workplan entry has been overwritten."); - - RuntimeDbWeight::get().reads(1).saturating_add(RuntimeDbWeight::get().writes(1)) - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, TryRuntimeError> { - let schedule_pool = Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment: Pool, - }])); - if Workplan::::get(WORKPLAN_KEY) != Some(schedule_pool) { - return Ok(Vec::new()) - } - let sale_info = SaleInfo::::get().unwrap(); - Ok(sale_info.encode()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), TryRuntimeError> { - if state.is_empty() { - return Ok(()) - } - log::info!(target: TARGET, "Checking migration."); - - // Check that cores 0-4 are now all reassigned to themselves at the end of the original - // period 0 before sales were restarted. - let expected_assignments = [Task(1000), Task(1001), Task(1002), Task(1005), Task(2000)]; - for (core, assignment) in expected_assignments.into_iter().enumerate() { - assert_eq!( - Workplan::::get((289960, core as u16)), - Some(Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment - }]))) - ); - } - - // There are no more surprise entries in the Workplan - the only cores which have - // reassignments before start sales kicks in are the five checked above. - assert_eq!( - Workplan::::iter_keys() - .filter(|(timeslice, _)| *timeslice != 290808) - .count(), - 5 - ); - - Ok(()) - } - } - - /// The People Chain should be onboarded ASAP to Kusama, however the reserve extrinsic - /// takes two sale period boundaries to actually put new reservations on core. This - /// migration adds the People Chain immediately. - /// - /// This is achieved in three steps: - /// 1. Reserve a core for People (from period 2) - /// 2. Add People Chain to the workplan for period 1 - /// 3. Add People Chain to the workplan for the remainder of period 0 - pub struct OnboardPeople; - - impl OnRuntimeUpgrade for OnboardPeople { - fn on_runtime_upgrade() -> Weight { - // Make sure People Chain is not already reserved. - let schedule_people = Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment: Task(1004), - }])); - if Reservations::::get().iter().any(|res| *res == schedule_people) { - log::error!(target: TARGET, "The people chain is already reserved. Bailing."); - return RuntimeDbWeight::get().reads(1); - } - - let next_period = SaleInfo::::get() - .map(|sale_info| sale_info.region_begin) - .expect("Sales have started on Kusama."); - - // Request an extra core for the People Chain. - let core_count = Reservations::::decode_len().unwrap_or(0) as u16 + - Leases::::decode_len().unwrap_or(0) as u16 + - AllowedRenewals::::iter_keys() - .filter(|renewal| renewal.when >= next_period) - .count() as u16 + 4; - - match pallet_broker::Pallet::::request_core_count( - RuntimeOrigin::root(), - core_count, - ) { - Ok(_) => log::info!(target: TARGET, "Request for 56 cores sent."), - Err(_) => log::error!(target: TARGET, "Request for 56 cores failed to send."), - } - - // People core should be assigned the new core to avoid clashes with the cores sold in - // period 0. - let people_core = core_count.saturating_sub(1); - - // 1. Schedule People Chain for period 2 and beyond. - let schedule_people = Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment: Task(1004), - }])); - match pallet_broker::Pallet::::reserve( - RuntimeOrigin::root(), - schedule_people.clone(), - ) { - Ok(_) => log::info!(target: TARGET, "People Chain reserved"), - Err(_) => log::error!(target: TARGET, "People Chain reservation failed!"), - } - - // 2. Schedule People Chain for period 1. - Workplan::::insert((next_period, people_core), schedule_people.clone()); - - // 3. Schedule People for the rest of period 0. Take the timeslice after the next tick - // so we the core definitely gets processed. - let now_ish = Status::::get() - .map(|status| status.last_committed_timeslice.saturating_add(2)) - .expect("Sales have started on Kusama."); - Workplan::::insert((now_ish, people_core), schedule_people); - - BrokerWeights::reserve() - .saturating_add(BrokerWeights::request_core_count(56)) - .saturating_add(RuntimeDbWeight::get().reads(6)) - .saturating_add(RuntimeDbWeight::get().writes(2)) - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { - let schedule_people = Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment: Task(1004), - }])); - if Reservations::::get().iter().any(|res| *res == schedule_people) { - return Ok(Vec::new()) - } - let status = Status::::get().unwrap(); - Ok(status.encode()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), TryRuntimeError> { - if state.is_empty() { - return Ok(()) - } - log::info!(target: TARGET, "Checking migration."); - - let prev_status = ::decode(&mut &state[..]).unwrap(); - - // People Chain is reserved exactly once. - let schedule_people = Schedule::truncate_from(Vec::from([ScheduleItem { - mask: CoreMask::complete(), - assignment: Task(1004), - }])); - assert_eq!( - Reservations::::get() - .iter() - .filter(|&res| *res == schedule_people.clone()) - .count(), - 1 - ); - - // And is in the Workplan for periods 0 and 1. - assert_eq!( - Workplan::::get((prev_status.last_committed_timeslice + 2, 55)), - Some(schedule_people.clone()) - ); - - let next_period = - SaleInfo::::get().map(|sale_info| sale_info.region_begin).unwrap(); - - assert_eq!(Workplan::::get((next_period, 55)), Some(schedule_people.clone())); - - // Ensure we have requested the correct number of cores. - assert!(frame_system::Pallet::::read_events_no_consensus().any(|e| { - match e.event { - crate::RuntimeEvent::Broker( - pallet_broker::Event::::CoreCountRequested { core_count }, - ) => { - log::info!(target: TARGET, "Reserved {core_count:?} cores."); - - // Ensure that both of these are correct as a sanity check since we hardcode - // core 55 elsewhere. - core_count == prev_status.core_count + 1 && core_count == 56 - }, - _ => false, - } - })); - - // And ensure this core isn't overwritten at any stage, it should only have the two - // entries in the workload that we just checked. - assert_eq!(Workplan::::iter_keys().filter(|(_, core)| *core == 55).count(), 2); - - Ok(()) - } - } -} From d57f9625977bb6a16db1a9aab85332d23bbd5558 Mon Sep 17 00:00:00 2001 From: Adrian Catangiu Date: Tue, 7 May 2024 14:53:24 +0300 Subject: [PATCH 03/15] Remove XCM SafeCallFilter for chains using Weights::v2 (#285) Remove `SafeCallFilter` from system chains as they all now use Weights::v2 which already accounts for call PoV size. This effectively removes artificial limitations on what users can`XCM::Transact` on these chains (blockspace limitations are still upheld). Fixes https://github.com/polkadot-fellows/runtimes/issues/273 --------- Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com> --- CHANGELOG.md | 1 + .../asset-hub-kusama/src/xcm_config.rs | 232 +----------------- .../asset-hub-polkadot/src/xcm_config.rs | 192 +-------------- .../bridge-hub-kusama/src/xcm_config.rs | 108 +------- .../bridge-hub-polkadot/src/xcm_config.rs | 111 +-------- .../collectives-polkadot/src/xcm_config.rs | 92 +------ .../coretime-kusama/src/xcm_config.rs | 49 +--- system-parachains/encointer/src/xcm_config.rs | 11 +- .../people/people-kusama/src/xcm_config.rs | 58 +---- 9 files changed, 30 insertions(+), 824 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac195fd95d..7843d2668b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) - Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) - Kusama chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#261](https://github.com/polkadot-fellows/runtimes/pull/261)) +- Allow everything through XCM SafeCallFilter ([polkadot-fellows/runtimes#285](https://github.com/polkadot-fellows/runtimes/pull/285)) ### Removed diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs index c56e477b7c..22928d7405 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs @@ -57,10 +57,7 @@ use xcm_builder::{ WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{ - traits::{ConvertLocation, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; parameter_types! { pub const KsmLocation: Location = Location::parent(); @@ -240,229 +237,6 @@ impl Contains for ParentOrParentsPlurality { } } -/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly -/// account for proof size weights. -/// -/// Calls that are allowed through this filter must: -/// 1. Have a fixed weight; -/// 2. Cannot lead to another call being made; -/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. -pub struct SafeCallFilter; -impl Contains for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true - } - } - - // Allow to change dedicated storage items (called by governance-like) - match call { - RuntimeCall::System(frame_system::Call::set_storage { items }) - if items.iter().all(|(k, _)| { - k.eq(&bridging::XcmBridgeHubRouterByteFee::key()) || - k.eq(&bridging::XcmBridgeHubRouterBaseFee::key()) || - k.eq(&bridging::to_ethereum::BridgeHubEthereumBaseFee::key()) - }) => - return true, - _ => (), - }; - - matches!( - call, - RuntimeCall::PolkadotXcm( - pallet_xcm::Call::force_xcm_version { .. } | - pallet_xcm::Call::force_default_xcm_version { .. } - ) | RuntimeCall::System( - frame_system::Call::set_heap_pages { .. } | - frame_system::Call::set_code { .. } | - frame_system::Call::set_code_without_checks { .. } | - frame_system::Call::authorize_upgrade { .. } | - frame_system::Call::authorize_upgrade_without_checks { .. } | - frame_system::Call::kill_prefix { .. }, - ) | RuntimeCall::ParachainSystem(..) | - RuntimeCall::Timestamp(..) | - RuntimeCall::Balances(..) | - RuntimeCall::CollatorSelection( - pallet_collator_selection::Call::set_desired_candidates { .. } | - pallet_collator_selection::Call::set_candidacy_bond { .. } | - pallet_collator_selection::Call::register_as_candidate { .. } | - pallet_collator_selection::Call::leave_intent { .. } | - pallet_collator_selection::Call::set_invulnerables { .. } | - pallet_collator_selection::Call::add_invulnerable { .. } | - pallet_collator_selection::Call::remove_invulnerable { .. }, - ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | - RuntimeCall::XcmpQueue(..) | - RuntimeCall::Assets( - pallet_assets::Call::create { .. } | - pallet_assets::Call::force_create { .. } | - pallet_assets::Call::start_destroy { .. } | - pallet_assets::Call::destroy_accounts { .. } | - pallet_assets::Call::destroy_approvals { .. } | - pallet_assets::Call::finish_destroy { .. } | - pallet_assets::Call::block { .. } | - pallet_assets::Call::mint { .. } | - pallet_assets::Call::burn { .. } | - pallet_assets::Call::transfer { .. } | - pallet_assets::Call::transfer_keep_alive { .. } | - pallet_assets::Call::force_transfer { .. } | - pallet_assets::Call::freeze { .. } | - pallet_assets::Call::thaw { .. } | - pallet_assets::Call::freeze_asset { .. } | - pallet_assets::Call::thaw_asset { .. } | - pallet_assets::Call::transfer_ownership { .. } | - pallet_assets::Call::set_team { .. } | - pallet_assets::Call::set_metadata { .. } | - pallet_assets::Call::clear_metadata { .. } | - pallet_assets::Call::force_set_metadata { .. } | - pallet_assets::Call::force_clear_metadata { .. } | - pallet_assets::Call::force_asset_status { .. } | - pallet_assets::Call::approve_transfer { .. } | - pallet_assets::Call::cancel_approval { .. } | - pallet_assets::Call::force_cancel_approval { .. } | - pallet_assets::Call::transfer_approved { .. } | - pallet_assets::Call::touch { .. } | - pallet_assets::Call::touch_other { .. } | - pallet_assets::Call::refund { .. } | - pallet_assets::Call::refund_other { .. }, - ) | RuntimeCall::ForeignAssets( - pallet_assets::Call::create { .. } | - pallet_assets::Call::force_create { .. } | - pallet_assets::Call::start_destroy { .. } | - pallet_assets::Call::destroy_accounts { .. } | - pallet_assets::Call::destroy_approvals { .. } | - pallet_assets::Call::finish_destroy { .. } | - pallet_assets::Call::block { .. } | - pallet_assets::Call::mint { .. } | - pallet_assets::Call::burn { .. } | - pallet_assets::Call::transfer { .. } | - pallet_assets::Call::transfer_keep_alive { .. } | - pallet_assets::Call::force_transfer { .. } | - pallet_assets::Call::freeze { .. } | - pallet_assets::Call::thaw { .. } | - pallet_assets::Call::freeze_asset { .. } | - pallet_assets::Call::thaw_asset { .. } | - pallet_assets::Call::transfer_ownership { .. } | - pallet_assets::Call::set_team { .. } | - pallet_assets::Call::set_metadata { .. } | - pallet_assets::Call::clear_metadata { .. } | - pallet_assets::Call::force_set_metadata { .. } | - pallet_assets::Call::force_clear_metadata { .. } | - pallet_assets::Call::force_asset_status { .. } | - pallet_assets::Call::approve_transfer { .. } | - pallet_assets::Call::cancel_approval { .. } | - pallet_assets::Call::force_cancel_approval { .. } | - pallet_assets::Call::transfer_approved { .. } | - pallet_assets::Call::touch { .. } | - pallet_assets::Call::touch_other { .. } | - pallet_assets::Call::refund { .. } | - pallet_assets::Call::refund_other { .. }, - ) | RuntimeCall::PoolAssets( - pallet_assets::Call::force_create { .. } | - pallet_assets::Call::block { .. } | - pallet_assets::Call::burn { .. } | - pallet_assets::Call::transfer { .. } | - pallet_assets::Call::transfer_keep_alive { .. } | - pallet_assets::Call::force_transfer { .. } | - pallet_assets::Call::freeze { .. } | - pallet_assets::Call::thaw { .. } | - pallet_assets::Call::freeze_asset { .. } | - pallet_assets::Call::thaw_asset { .. } | - pallet_assets::Call::transfer_ownership { .. } | - pallet_assets::Call::set_team { .. } | - pallet_assets::Call::set_metadata { .. } | - pallet_assets::Call::clear_metadata { .. } | - pallet_assets::Call::force_set_metadata { .. } | - pallet_assets::Call::force_clear_metadata { .. } | - pallet_assets::Call::force_asset_status { .. } | - pallet_assets::Call::approve_transfer { .. } | - pallet_assets::Call::cancel_approval { .. } | - pallet_assets::Call::force_cancel_approval { .. } | - pallet_assets::Call::transfer_approved { .. } | - pallet_assets::Call::touch { .. } | - pallet_assets::Call::touch_other { .. } | - pallet_assets::Call::refund { .. } | - pallet_assets::Call::refund_other { .. }, - ) | RuntimeCall::AssetConversion( - pallet_asset_conversion::Call::create_pool { .. } | - pallet_asset_conversion::Call::add_liquidity { .. } | - pallet_asset_conversion::Call::remove_liquidity { .. } | - pallet_asset_conversion::Call::swap_tokens_for_exact_tokens { .. } | - pallet_asset_conversion::Call::swap_exact_tokens_for_tokens { .. }, - ) | RuntimeCall::NftFractionalization( - pallet_nft_fractionalization::Call::fractionalize { .. } | - pallet_nft_fractionalization::Call::unify { .. }, - ) | RuntimeCall::Nfts( - pallet_nfts::Call::create { .. } | - pallet_nfts::Call::force_create { .. } | - pallet_nfts::Call::destroy { .. } | - pallet_nfts::Call::mint { .. } | - pallet_nfts::Call::force_mint { .. } | - pallet_nfts::Call::burn { .. } | - pallet_nfts::Call::transfer { .. } | - pallet_nfts::Call::lock_item_transfer { .. } | - pallet_nfts::Call::unlock_item_transfer { .. } | - pallet_nfts::Call::lock_collection { .. } | - pallet_nfts::Call::transfer_ownership { .. } | - pallet_nfts::Call::set_team { .. } | - pallet_nfts::Call::force_collection_owner { .. } | - pallet_nfts::Call::force_collection_config { .. } | - pallet_nfts::Call::approve_transfer { .. } | - pallet_nfts::Call::cancel_approval { .. } | - pallet_nfts::Call::clear_all_transfer_approvals { .. } | - pallet_nfts::Call::lock_item_properties { .. } | - pallet_nfts::Call::set_attribute { .. } | - pallet_nfts::Call::force_set_attribute { .. } | - pallet_nfts::Call::clear_attribute { .. } | - pallet_nfts::Call::approve_item_attributes { .. } | - pallet_nfts::Call::cancel_item_attributes_approval { .. } | - pallet_nfts::Call::set_metadata { .. } | - pallet_nfts::Call::clear_metadata { .. } | - pallet_nfts::Call::set_collection_metadata { .. } | - pallet_nfts::Call::clear_collection_metadata { .. } | - pallet_nfts::Call::set_accept_ownership { .. } | - pallet_nfts::Call::set_collection_max_supply { .. } | - pallet_nfts::Call::update_mint_settings { .. } | - pallet_nfts::Call::set_price { .. } | - pallet_nfts::Call::buy_item { .. } | - pallet_nfts::Call::pay_tips { .. } | - pallet_nfts::Call::create_swap { .. } | - pallet_nfts::Call::cancel_swap { .. } | - pallet_nfts::Call::claim_swap { .. }, - ) | RuntimeCall::Uniques( - pallet_uniques::Call::create { .. } | - pallet_uniques::Call::force_create { .. } | - pallet_uniques::Call::destroy { .. } | - pallet_uniques::Call::mint { .. } | - pallet_uniques::Call::burn { .. } | - pallet_uniques::Call::transfer { .. } | - pallet_uniques::Call::freeze { .. } | - pallet_uniques::Call::thaw { .. } | - pallet_uniques::Call::freeze_collection { .. } | - pallet_uniques::Call::thaw_collection { .. } | - pallet_uniques::Call::transfer_ownership { .. } | - pallet_uniques::Call::set_team { .. } | - pallet_uniques::Call::approve_transfer { .. } | - pallet_uniques::Call::cancel_approval { .. } | - pallet_uniques::Call::force_item_status { .. } | - pallet_uniques::Call::set_attribute { .. } | - pallet_uniques::Call::clear_attribute { .. } | - pallet_uniques::Call::set_metadata { .. } | - pallet_uniques::Call::clear_metadata { .. } | - pallet_uniques::Call::set_collection_metadata { .. } | - pallet_uniques::Call::clear_collection_metadata { .. } | - pallet_uniques::Call::set_accept_ownership { .. } | - pallet_uniques::Call::set_collection_max_supply { .. } | - pallet_uniques::Call::set_price { .. } | - pallet_uniques::Call::buy_item { .. } - ) | RuntimeCall::ToPolkadotXcmRouter( - pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. } - ) - ) - } -} - pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyReserveTransferToRelayChain, @@ -606,8 +380,8 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (); type UniversalAliases = (bridging::to_polkadot::UniversalAliases, bridging::to_ethereum::UniversalAliases); - type CallDispatcher = WithOriginFilter; - type SafeCallFilter = SafeCallFilter; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs index 7e371ca9ed..9d56a5477b 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs @@ -58,10 +58,7 @@ use xcm_builder::{ WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{ - traits::{ConvertLocation, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; parameter_types! { pub const DotLocation: Location = Location::parent(); @@ -271,189 +268,6 @@ impl Contains for ParentOrParentsPlurality { } } -/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly -/// account for proof size weights. -/// -/// Calls that are allowed through this filter must: -/// 1. Have a fixed weight; -/// 2. Cannot lead to another call being made; -/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. -pub struct SafeCallFilter; -impl Contains for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true - } - } - - // Allow to change dedicated storage items (called by governance-like) - match call { - RuntimeCall::System(frame_system::Call::set_storage { items }) - if items.iter().all(|(k, _)| { - k.eq(&bridging::XcmBridgeHubRouterByteFee::key()) || - k.eq(&bridging::XcmBridgeHubRouterBaseFee::key()) || - k.eq(&bridging::to_ethereum::BridgeHubEthereumBaseFee::key()) - }) => - return true, - _ => (), - }; - - matches!( - call, - RuntimeCall::PolkadotXcm( - pallet_xcm::Call::force_xcm_version { .. } | - pallet_xcm::Call::force_default_xcm_version { .. } - ) | RuntimeCall::System( - frame_system::Call::set_heap_pages { .. } | - frame_system::Call::set_code { .. } | - frame_system::Call::set_code_without_checks { .. } | - frame_system::Call::authorize_upgrade { .. } | - frame_system::Call::authorize_upgrade_without_checks { .. } | - frame_system::Call::kill_prefix { .. }, - ) | RuntimeCall::ParachainSystem(..) | - RuntimeCall::Timestamp(..) | - RuntimeCall::Balances(..) | - RuntimeCall::CollatorSelection( - pallet_collator_selection::Call::set_desired_candidates { .. } | - pallet_collator_selection::Call::set_candidacy_bond { .. } | - pallet_collator_selection::Call::register_as_candidate { .. } | - pallet_collator_selection::Call::leave_intent { .. } | - pallet_collator_selection::Call::set_invulnerables { .. } | - pallet_collator_selection::Call::add_invulnerable { .. } | - pallet_collator_selection::Call::remove_invulnerable { .. }, - ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | - RuntimeCall::XcmpQueue(..) | - RuntimeCall::Assets( - pallet_assets::Call::create { .. } | - pallet_assets::Call::force_create { .. } | - pallet_assets::Call::start_destroy { .. } | - pallet_assets::Call::destroy_accounts { .. } | - pallet_assets::Call::destroy_approvals { .. } | - pallet_assets::Call::finish_destroy { .. } | - pallet_assets::Call::mint { .. } | - pallet_assets::Call::burn { .. } | - pallet_assets::Call::transfer { .. } | - pallet_assets::Call::transfer_keep_alive { .. } | - pallet_assets::Call::force_transfer { .. } | - pallet_assets::Call::freeze { .. } | - pallet_assets::Call::thaw { .. } | - pallet_assets::Call::freeze_asset { .. } | - pallet_assets::Call::thaw_asset { .. } | - pallet_assets::Call::transfer_ownership { .. } | - pallet_assets::Call::set_team { .. } | - pallet_assets::Call::set_metadata { .. } | - pallet_assets::Call::clear_metadata { .. } | - pallet_assets::Call::force_set_metadata { .. } | - pallet_assets::Call::force_clear_metadata { .. } | - pallet_assets::Call::force_asset_status { .. } | - pallet_assets::Call::approve_transfer { .. } | - pallet_assets::Call::cancel_approval { .. } | - pallet_assets::Call::force_cancel_approval { .. } | - pallet_assets::Call::transfer_approved { .. } | - pallet_assets::Call::touch { .. } | - pallet_assets::Call::refund { .. }, - ) | RuntimeCall::ForeignAssets( - pallet_assets::Call::create { .. } | - pallet_assets::Call::force_create { .. } | - pallet_assets::Call::start_destroy { .. } | - pallet_assets::Call::destroy_accounts { .. } | - pallet_assets::Call::destroy_approvals { .. } | - pallet_assets::Call::finish_destroy { .. } | - pallet_assets::Call::mint { .. } | - pallet_assets::Call::burn { .. } | - pallet_assets::Call::transfer { .. } | - pallet_assets::Call::transfer_keep_alive { .. } | - pallet_assets::Call::force_transfer { .. } | - pallet_assets::Call::freeze { .. } | - pallet_assets::Call::thaw { .. } | - pallet_assets::Call::freeze_asset { .. } | - pallet_assets::Call::thaw_asset { .. } | - pallet_assets::Call::transfer_ownership { .. } | - pallet_assets::Call::set_team { .. } | - pallet_assets::Call::set_metadata { .. } | - pallet_assets::Call::clear_metadata { .. } | - pallet_assets::Call::force_set_metadata { .. } | - pallet_assets::Call::force_clear_metadata { .. } | - pallet_assets::Call::force_asset_status { .. } | - pallet_assets::Call::approve_transfer { .. } | - pallet_assets::Call::cancel_approval { .. } | - pallet_assets::Call::force_cancel_approval { .. } | - pallet_assets::Call::transfer_approved { .. } | - pallet_assets::Call::touch { .. } | - pallet_assets::Call::refund { .. }, - ) | RuntimeCall::Nfts( - pallet_nfts::Call::create { .. } | - pallet_nfts::Call::force_create { .. } | - pallet_nfts::Call::destroy { .. } | - pallet_nfts::Call::mint { .. } | - pallet_nfts::Call::force_mint { .. } | - pallet_nfts::Call::burn { .. } | - pallet_nfts::Call::transfer { .. } | - pallet_nfts::Call::lock_item_transfer { .. } | - pallet_nfts::Call::unlock_item_transfer { .. } | - pallet_nfts::Call::lock_collection { .. } | - pallet_nfts::Call::transfer_ownership { .. } | - pallet_nfts::Call::set_team { .. } | - pallet_nfts::Call::force_collection_owner { .. } | - pallet_nfts::Call::force_collection_config { .. } | - pallet_nfts::Call::approve_transfer { .. } | - pallet_nfts::Call::cancel_approval { .. } | - pallet_nfts::Call::clear_all_transfer_approvals { .. } | - pallet_nfts::Call::lock_item_properties { .. } | - pallet_nfts::Call::set_attribute { .. } | - pallet_nfts::Call::force_set_attribute { .. } | - pallet_nfts::Call::clear_attribute { .. } | - pallet_nfts::Call::approve_item_attributes { .. } | - pallet_nfts::Call::cancel_item_attributes_approval { .. } | - pallet_nfts::Call::set_metadata { .. } | - pallet_nfts::Call::clear_metadata { .. } | - pallet_nfts::Call::set_collection_metadata { .. } | - pallet_nfts::Call::clear_collection_metadata { .. } | - pallet_nfts::Call::set_accept_ownership { .. } | - pallet_nfts::Call::set_collection_max_supply { .. } | - pallet_nfts::Call::update_mint_settings { .. } | - pallet_nfts::Call::set_price { .. } | - pallet_nfts::Call::buy_item { .. } | - pallet_nfts::Call::pay_tips { .. } | - pallet_nfts::Call::create_swap { .. } | - pallet_nfts::Call::cancel_swap { .. } | - pallet_nfts::Call::claim_swap { .. }, - ) | RuntimeCall::Uniques( - pallet_uniques::Call::create { .. } | - pallet_uniques::Call::force_create { .. } | - pallet_uniques::Call::destroy { .. } | - pallet_uniques::Call::mint { .. } | - pallet_uniques::Call::burn { .. } | - pallet_uniques::Call::transfer { .. } | - pallet_uniques::Call::freeze { .. } | - pallet_uniques::Call::thaw { .. } | - pallet_uniques::Call::freeze_collection { .. } | - pallet_uniques::Call::thaw_collection { .. } | - pallet_uniques::Call::transfer_ownership { .. } | - pallet_uniques::Call::set_team { .. } | - pallet_uniques::Call::approve_transfer { .. } | - pallet_uniques::Call::cancel_approval { .. } | - pallet_uniques::Call::force_item_status { .. } | - pallet_uniques::Call::set_attribute { .. } | - pallet_uniques::Call::clear_attribute { .. } | - pallet_uniques::Call::set_metadata { .. } | - pallet_uniques::Call::clear_metadata { .. } | - pallet_uniques::Call::set_collection_metadata { .. } | - pallet_uniques::Call::clear_collection_metadata { .. } | - pallet_uniques::Call::set_accept_ownership { .. } | - pallet_uniques::Call::set_collection_max_supply { .. } | - pallet_uniques::Call::set_price { .. } | - pallet_uniques::Call::buy_item { .. } - ) | RuntimeCall::ToKusamaXcmRouter( - pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. } - ) | RuntimeCall::PoolAssets(..) | - RuntimeCall::AssetConversion(..) - ) - } -} - pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyReserveTransferToRelayChain, @@ -600,8 +414,8 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (); type UniversalAliases = (bridging::to_kusama::UniversalAliases, bridging::to_ethereum::UniversalAliases); - type CallDispatcher = WithOriginFilter; - type SafeCallFilter = SafeCallFilter; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index aec2728cc3..5a7f15bd38 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -15,17 +15,14 @@ // along with Cumulus. If not, see . use super::{ - bridge_to_ethereum_config::{EthereumGatewayAddress, EthereumNetwork}, - bridge_to_polkadot_config::{ - DeliveryRewardInBalance, RequiredStakeForStakeAndSlash, ToBridgeHubPolkadotHaulBlobExporter, - }, - AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, + bridge_to_ethereum_config::EthereumNetwork, + bridge_to_polkadot_config::ToBridgeHubPolkadotHaulBlobExporter, AccountId, + AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, PriceForParentDelivery, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ parameter_types, - storage::generator::StorageValue, traits::{ConstU32, Contains, Equals, Everything, Nothing}, }; use frame_system::EnsureRoot; @@ -54,7 +51,7 @@ use xcm_builder::{ XcmFeeToAccount, }; use xcm_executor::{ - traits::{ConvertLocation, FeeManager, FeeReason, FeeReason::Export, WithOriginFilter}, + traits::{ConvertLocation, FeeManager, FeeReason, FeeReason::Export}, XcmExecutor, }; @@ -136,99 +133,6 @@ impl Contains for ParentOrParentsPlurality { } } -/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly -/// account for proof size weights. -/// -/// Calls that are allowed through this filter must: -/// 1. Have a fixed weight; -/// 2. Cannot lead to another call being made; -/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. -pub struct SafeCallFilter; -impl Contains for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true - } - } - - // Allow to change dedicated storage items (called by governance-like) - match call { - RuntimeCall::System(frame_system::Call::set_storage { items }) - if items.iter().all(|(k, _)| { - k.eq(&DeliveryRewardInBalance::key()) || - k.eq(&RequiredStakeForStakeAndSlash::key()) || - k.eq(&EthereumGatewayAddress::key()) || - k.eq(&pallet_bridge_grandpa::CurrentAuthoritySet::< - Runtime, - crate::bridge_to_polkadot_config::BridgeGrandpaPolkadotInstance, - >::storage_value_final_key()) - }) => - return true, - _ => (), - }; - - matches!( - call, - RuntimeCall::PolkadotXcm( - pallet_xcm::Call::force_xcm_version { .. } | - pallet_xcm::Call::force_default_xcm_version { .. } - ) | RuntimeCall::System( - frame_system::Call::set_heap_pages { .. } | - frame_system::Call::set_code { .. } | - frame_system::Call::set_code_without_checks { .. } | - frame_system::Call::authorize_upgrade { .. } | - frame_system::Call::authorize_upgrade_without_checks { .. } | - frame_system::Call::kill_prefix { .. }, - ) | RuntimeCall::ParachainSystem(..) | - RuntimeCall::Timestamp(..) | - RuntimeCall::Balances(..) | - RuntimeCall::CollatorSelection( - pallet_collator_selection::Call::set_desired_candidates { .. } | - pallet_collator_selection::Call::set_candidacy_bond { .. } | - pallet_collator_selection::Call::register_as_candidate { .. } | - pallet_collator_selection::Call::leave_intent { .. } | - pallet_collator_selection::Call::set_invulnerables { .. } | - pallet_collator_selection::Call::add_invulnerable { .. } | - pallet_collator_selection::Call::remove_invulnerable { .. }, - ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | - RuntimeCall::XcmpQueue(..) | - RuntimeCall::BridgePolkadotGrandpa(pallet_bridge_grandpa::Call::< - Runtime, - crate::bridge_to_polkadot_config::BridgeGrandpaPolkadotInstance, - >::initialize { .. }) | - RuntimeCall::BridgePolkadotGrandpa(pallet_bridge_grandpa::Call::< - Runtime, - crate::bridge_to_polkadot_config::BridgeGrandpaPolkadotInstance, - >::set_operating_mode { .. }) | - RuntimeCall::BridgePolkadotParachains(pallet_bridge_parachains::Call::< - Runtime, - crate::bridge_to_polkadot_config::BridgeParachainPolkadotInstance, - >::set_operating_mode { .. }) | - RuntimeCall::BridgePolkadotMessages(pallet_bridge_messages::Call::< - Runtime, - crate::bridge_to_polkadot_config::WithBridgeHubPolkadotMessagesInstance, - >::set_operating_mode { .. }) | - RuntimeCall::EthereumBeaconClient( - snowbridge_pallet_ethereum_client::Call::force_checkpoint { .. } | - snowbridge_pallet_ethereum_client::Call::set_operating_mode { .. }, - ) | RuntimeCall::EthereumInboundQueue( - snowbridge_pallet_inbound_queue::Call::set_operating_mode { .. }, - ) | RuntimeCall::EthereumOutboundQueue( - snowbridge_pallet_outbound_queue::Call::set_operating_mode { .. }, - ) | RuntimeCall::EthereumSystem( - snowbridge_pallet_system::Call::upgrade { .. } | - snowbridge_pallet_system::Call::set_operating_mode { .. } | - snowbridge_pallet_system::Call::set_pricing_parameters { .. } | - snowbridge_pallet_system::Call::force_update_channel { .. } | - snowbridge_pallet_system::Call::force_transfer_native_from_agent { .. } | - snowbridge_pallet_system::Call::set_token_transfer_fees { .. }, - ) - ) - } -} - pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyReserveTransferToRelayChain, @@ -314,8 +218,8 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (ToBridgeHubPolkadotHaulBlobExporter, crate::bridge_to_ethereum_config::SnowbridgeExporter); type UniversalAliases = Nothing; - type CallDispatcher = WithOriginFilter; - type SafeCallFilter = SafeCallFilter; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 6e2e96d2ac..e3d3778aac 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -15,17 +15,13 @@ // along with Cumulus. If not, see . use super::{ - bridge_to_ethereum_config::{EthereumGatewayAddress, EthereumNetwork}, - bridge_to_kusama_config::{ - DeliveryRewardInBalance, RequiredStakeForStakeAndSlash, ToBridgeHubKusamaHaulBlobExporter, - }, - AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, - PriceForParentDelivery, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, - XcmpQueue, + bridge_to_ethereum_config::EthereumNetwork, + bridge_to_kusama_config::ToBridgeHubKusamaHaulBlobExporter, AccountId, AllPalletsWithSystem, + Balances, ParachainInfo, ParachainSystem, PolkadotXcm, PriceForParentDelivery, Runtime, + RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use frame_support::{ parameter_types, - storage::generator::StorageValue, traits::{ConstU32, Contains, Equals, Everything, Nothing}, }; use frame_system::EnsureRoot; @@ -55,7 +51,7 @@ use xcm_builder::{ XcmFeeToAccount, }; use xcm_executor::{ - traits::{ConvertLocation, FeeManager, FeeReason, FeeReason::Export, WithOriginFilter}, + traits::{ConvertLocation, FeeManager, FeeReason, FeeReason::Export}, XcmExecutor, }; @@ -153,99 +149,6 @@ impl Contains for FellowsPlurality { } } -/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly -/// account for proof size weights. -/// -/// Calls that are allowed through this filter must: -/// 1. Have a fixed weight; -/// 2. Cannot lead to another call being made; -/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. -pub struct SafeCallFilter; -impl Contains for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true - } - } - - // Allow to change dedicated storage items (called by governance-like) - match call { - RuntimeCall::System(frame_system::Call::set_storage { items }) - if items.iter().all(|(k, _)| { - k.eq(&DeliveryRewardInBalance::key()) || - k.eq(&RequiredStakeForStakeAndSlash::key()) || - k.eq(&EthereumGatewayAddress::key()) || - k.eq(&pallet_bridge_grandpa::CurrentAuthoritySet::< - Runtime, - crate::bridge_to_kusama_config::BridgeGrandpaKusamaInstance, - >::storage_value_final_key()) - }) => - return true, - _ => (), - }; - - matches!( - call, - RuntimeCall::PolkadotXcm( - pallet_xcm::Call::force_xcm_version { .. } | - pallet_xcm::Call::force_default_xcm_version { .. } - ) | RuntimeCall::System( - frame_system::Call::set_heap_pages { .. } | - frame_system::Call::set_code { .. } | - frame_system::Call::set_code_without_checks { .. } | - frame_system::Call::authorize_upgrade { .. } | - frame_system::Call::authorize_upgrade_without_checks { .. } | - frame_system::Call::kill_prefix { .. }, - ) | RuntimeCall::ParachainSystem(..) | - RuntimeCall::Timestamp(..) | - RuntimeCall::Balances(..) | - RuntimeCall::CollatorSelection( - pallet_collator_selection::Call::set_desired_candidates { .. } | - pallet_collator_selection::Call::set_candidacy_bond { .. } | - pallet_collator_selection::Call::register_as_candidate { .. } | - pallet_collator_selection::Call::leave_intent { .. } | - pallet_collator_selection::Call::set_invulnerables { .. } | - pallet_collator_selection::Call::add_invulnerable { .. } | - pallet_collator_selection::Call::remove_invulnerable { .. }, - ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | - RuntimeCall::XcmpQueue(..) | - RuntimeCall::BridgeKusamaGrandpa(pallet_bridge_grandpa::Call::< - Runtime, - crate::bridge_to_kusama_config::BridgeGrandpaKusamaInstance, - >::initialize { .. }) | - RuntimeCall::BridgeKusamaGrandpa(pallet_bridge_grandpa::Call::< - Runtime, - crate::bridge_to_kusama_config::BridgeGrandpaKusamaInstance, - >::set_operating_mode { .. }) | - RuntimeCall::BridgeKusamaParachains(pallet_bridge_parachains::Call::< - Runtime, - crate::bridge_to_kusama_config::BridgeParachainKusamaInstance, - >::set_operating_mode { .. }) | - RuntimeCall::BridgeKusamaMessages(pallet_bridge_messages::Call::< - Runtime, - crate::bridge_to_kusama_config::WithBridgeHubKusamaMessagesInstance, - >::set_operating_mode { .. }) | - RuntimeCall::EthereumBeaconClient( - snowbridge_pallet_ethereum_client::Call::force_checkpoint { .. } | - snowbridge_pallet_ethereum_client::Call::set_operating_mode { .. }, - ) | RuntimeCall::EthereumInboundQueue( - snowbridge_pallet_inbound_queue::Call::set_operating_mode { .. }, - ) | RuntimeCall::EthereumOutboundQueue( - snowbridge_pallet_outbound_queue::Call::set_operating_mode { .. }, - ) | RuntimeCall::EthereumSystem( - snowbridge_pallet_system::Call::upgrade { .. } | - snowbridge_pallet_system::Call::set_operating_mode { .. } | - snowbridge_pallet_system::Call::set_pricing_parameters { .. } | - snowbridge_pallet_system::Call::force_update_channel { .. } | - snowbridge_pallet_system::Call::force_transfer_native_from_agent { .. } | - snowbridge_pallet_system::Call::set_token_transfer_fees { .. }, - ) - ) - } -} - pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyReserveTransferToRelayChain, @@ -333,8 +236,8 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (ToBridgeHubKusamaHaulBlobExporter, crate::bridge_to_ethereum_config::SnowbridgeExporter); type UniversalAliases = Nothing; - type CallDispatcher = WithOriginFilter; - type SafeCallFilter = SafeCallFilter; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } diff --git a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs index d71fd2c2be..e49e41121e 100644 --- a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs +++ b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs @@ -47,10 +47,7 @@ use xcm_builder::{ UsingComponents, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{ - traits::{ConvertLocation, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; parameter_types! { pub const RootLocation: Location = Location::here(); @@ -151,89 +148,6 @@ impl Contains for LocalPlurality { } } -/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly -/// account for proof size weights. -/// -/// Calls that are allowed through this filter must: -/// 1. Have a fixed weight; -/// 2. Cannot lead to another call being made; -/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. -pub struct SafeCallFilter; -impl Contains for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true - } - } - - matches!( - call, - RuntimeCall::System( - frame_system::Call::set_heap_pages { .. } | - frame_system::Call::set_code { .. } | - frame_system::Call::set_code_without_checks { .. } | - frame_system::Call::authorize_upgrade { .. } | - frame_system::Call::authorize_upgrade_without_checks { .. } | - frame_system::Call::kill_prefix { .. }, - ) | RuntimeCall::ParachainSystem(..) | - RuntimeCall::Timestamp(..) | - RuntimeCall::Balances(..) | - RuntimeCall::CollatorSelection( - pallet_collator_selection::Call::set_desired_candidates { .. } | - pallet_collator_selection::Call::set_candidacy_bond { .. } | - pallet_collator_selection::Call::register_as_candidate { .. } | - pallet_collator_selection::Call::leave_intent { .. } | - pallet_collator_selection::Call::set_invulnerables { .. } | - pallet_collator_selection::Call::add_invulnerable { .. } | - pallet_collator_selection::Call::remove_invulnerable { .. }, - ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | - RuntimeCall::PolkadotXcm( - pallet_xcm::Call::force_xcm_version { .. } | - pallet_xcm::Call::force_default_xcm_version { .. } - ) | RuntimeCall::XcmpQueue(..) | - RuntimeCall::Alliance( - // `init_members` accepts unbounded vecs as arguments, - // but the call can be initiated only by root origin. - pallet_alliance::Call::init_members { .. } | - pallet_alliance::Call::vote { .. } | - pallet_alliance::Call::disband { .. } | - pallet_alliance::Call::set_rule { .. } | - pallet_alliance::Call::announce { .. } | - pallet_alliance::Call::remove_announcement { .. } | - pallet_alliance::Call::join_alliance { .. } | - pallet_alliance::Call::nominate_ally { .. } | - pallet_alliance::Call::elevate_ally { .. } | - pallet_alliance::Call::give_retirement_notice { .. } | - pallet_alliance::Call::retire { .. } | - pallet_alliance::Call::kick_member { .. } | - pallet_alliance::Call::close { .. } | - pallet_alliance::Call::abdicate_fellow_status { .. }, - ) | RuntimeCall::AllianceMotion( - pallet_collective::Call::vote { .. } | - pallet_collective::Call::disapprove_proposal { .. } | - pallet_collective::Call::close { .. }, - ) | RuntimeCall::FellowshipCollective( - pallet_ranked_collective::Call::add_member { .. } | - pallet_ranked_collective::Call::promote_member { .. } | - pallet_ranked_collective::Call::demote_member { .. } | - pallet_ranked_collective::Call::remove_member { .. }, - ) | RuntimeCall::FellowshipCore( - pallet_core_fellowship::Call::bump { .. } | - pallet_core_fellowship::Call::set_params { .. } | - pallet_core_fellowship::Call::set_active { .. } | - pallet_core_fellowship::Call::approve { .. } | - pallet_core_fellowship::Call::induct { .. } | - pallet_core_fellowship::Call::promote { .. } | - pallet_core_fellowship::Call::offboard { .. } | - pallet_core_fellowship::Call::submit_evidence { .. } | - pallet_core_fellowship::Call::import { .. }, - ) - ) - } -} - pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyReserveTransferToRelayChain, @@ -307,8 +221,8 @@ impl xcm_executor::Config for XcmConfig { >; type MessageExporter = (); type UniversalAliases = Nothing; - type CallDispatcher = WithOriginFilter; - type SafeCallFilter = SafeCallFilter; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } diff --git a/system-parachains/coretime/coretime-kusama/src/xcm_config.rs b/system-parachains/coretime/coretime-kusama/src/xcm_config.rs index cde44f46a3..14961f0166 100644 --- a/system-parachains/coretime/coretime-kusama/src/xcm_config.rs +++ b/system-parachains/coretime/coretime-kusama/src/xcm_config.rs @@ -48,10 +48,7 @@ use xcm_builder::{ UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{ - traits::{ConvertLocation, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; parameter_types! { pub const KsmRelayLocation: Location = Location::parent(); @@ -146,46 +143,6 @@ impl Contains for ParentOrParentsPlurality { } } -/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly -/// account for proof size weights. -/// -/// Calls that are allowed through this filter must: -/// 1. Have a fixed weight; -/// 2. Cannot lead to another call being made; -/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. -pub struct SafeCallFilter; -impl Contains for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true; - } - } - - matches!( - call, - RuntimeCall::PolkadotXcm( - pallet_xcm::Call::force_xcm_version { .. } | - pallet_xcm::Call::force_default_xcm_version { .. } - ) | RuntimeCall::System( - frame_system::Call::set_heap_pages { .. } | - frame_system::Call::set_code { .. } | - frame_system::Call::set_code_without_checks { .. } | - frame_system::Call::authorize_upgrade { .. } | - frame_system::Call::authorize_upgrade_without_checks { .. } | - frame_system::Call::kill_prefix { .. } - ) | RuntimeCall::ParachainSystem(..) | - RuntimeCall::Timestamp(..) | - RuntimeCall::Balances(..) | - RuntimeCall::CollatorSelection(..) | - RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | - RuntimeCall::XcmpQueue(..) | - RuntimeCall::Broker(..) - ) - } -} - pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyReserveTransferToRelayChain, @@ -262,8 +219,8 @@ impl xcm_executor::Config for XcmConfig { >; type MessageExporter = (); type UniversalAliases = Nothing; - type CallDispatcher = WithOriginFilter; - type SafeCallFilter = SafeCallFilter; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } diff --git a/system-parachains/encointer/src/xcm_config.rs b/system-parachains/encointer/src/xcm_config.rs index 22fd1f103b..a53c78d047 100644 --- a/system-parachains/encointer/src/xcm_config.rs +++ b/system-parachains/encointer/src/xcm_config.rs @@ -144,15 +144,6 @@ pub type Barrier = TrailingSetTopicAsId< >, >; -pub struct SafeCallFilter; -impl frame_support::traits::Contains for SafeCallFilter { - fn contains(_call: &RuntimeCall) -> bool { - // This is safe, as we prevent arbitrary xcm-transact executions. - // For rationale, see:https://github.com/paritytech/polkadot/blob/19fdd197aff085f7f66e54942999fd536e7df475/runtime/kusama/src/xcm_config.rs#L171 - true - } -} - parameter_types! { pub const MaxAssetsIntoHolding: u32 = 64; pub const KsmRelayLocation: Location = Location::parent(); @@ -188,7 +179,7 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (); type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; - type SafeCallFilter = SafeCallFilter; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } diff --git a/system-parachains/people/people-kusama/src/xcm_config.rs b/system-parachains/people/people-kusama/src/xcm_config.rs index a33ce1d692..f76ed06b7e 100644 --- a/system-parachains/people/people-kusama/src/xcm_config.rs +++ b/system-parachains/people/people-kusama/src/xcm_config.rs @@ -45,10 +45,7 @@ use xcm_builder::{ TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount, }; -use xcm_executor::{ - traits::{ConvertLocation, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; parameter_types! { pub const RootLocation: Location = Location::here(); @@ -155,55 +152,6 @@ impl Contains for ParentOrParentsPlurality { } } -/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly -/// account for proof size weights. -/// -/// Calls that are allowed through this filter must: -/// 1. Have a fixed weight; -/// 2. Cannot lead to another call being made; -/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. -pub struct SafeCallFilter; -impl Contains for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true - } - } - - matches!( - call, - RuntimeCall::PolkadotXcm( - pallet_xcm::Call::force_xcm_version { .. } | - pallet_xcm::Call::force_default_xcm_version { .. } - ) | RuntimeCall::System( - frame_system::Call::set_heap_pages { .. } | - frame_system::Call::set_code { .. } | - frame_system::Call::set_code_without_checks { .. } | - frame_system::Call::authorize_upgrade { .. } | - frame_system::Call::authorize_upgrade_without_checks { .. } | - frame_system::Call::kill_prefix { .. }, - ) | RuntimeCall::ParachainSystem(..) | - RuntimeCall::Timestamp(..) | - RuntimeCall::Balances(..) | - RuntimeCall::CollatorSelection( - pallet_collator_selection::Call::set_desired_candidates { .. } | - pallet_collator_selection::Call::set_candidacy_bond { .. } | - pallet_collator_selection::Call::register_as_candidate { .. } | - pallet_collator_selection::Call::leave_intent { .. } | - pallet_collator_selection::Call::set_invulnerables { .. } | - pallet_collator_selection::Call::add_invulnerable { .. } | - pallet_collator_selection::Call::remove_invulnerable { .. }, - ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | - RuntimeCall::XcmpQueue(..) | - RuntimeCall::MessageQueue(..) | - RuntimeCall::Identity(..) | - RuntimeCall::IdentityMigrator(..) - ) - } -} - pub type Barrier = TrailingSetTopicAsId< DenyThenTry< DenyReserveTransferToRelayChain, @@ -272,8 +220,8 @@ impl xcm_executor::Config for XcmConfig { >; type MessageExporter = (); type UniversalAliases = Nothing; - type CallDispatcher = WithOriginFilter; - type SafeCallFilter = SafeCallFilter; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; } From 633d4e7c99db75599a3f9d6b09962d0248b89731 Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Tue, 7 May 2024 15:21:46 +0200 Subject: [PATCH 04/15] added script to dismiss reviews (#76) Added a script that will require new reviews in a PR if the author (who is not a fellow) pushed a new commit. Resolves #60 Copied from paritytech/polkadot-sdk#4152 and paritytech/polkadot-sdk#3431 ## Summary Added a new step in the action that triggers review bot to stop approval from new pushes. This step works in the following way: - If the **author of the PR**, who **is not** a fellow, pushed a new commit then: - Review-Trigger requests new reviews from the reviewers and fails. It *does not dismiss reviews*. It simply request them again, but they will still be available. This way, if the author changed something in the code, they will still need to have this latest change approved to stop them from uploading malicious code. - [x] Does not require a CHANGELOG entry --- .github/workflows/review-trigger.yml | 43 +++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/workflows/review-trigger.yml b/.github/workflows/review-trigger.yml index 0edbc7c9a9..2f241c9171 100644 --- a/.github/workflows/review-trigger.yml +++ b/.github/workflows/review-trigger.yml @@ -13,9 +13,50 @@ on: jobs: trigger-review-bot: + # (It is not a draft) && (it is not a review || it is an approving review) + if: ${{ github.event.pull_request.draft != true && (github.event_name != 'pull_request_review' || (github.event.review && github.event.review.state == 'APPROVED')) }} runs-on: ubuntu-latest name: trigger review bot steps: + - name: Get PR data + id: comments + run: | + echo "bodies=$(gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json comments --jq '[.comments[].body]')" >> "$GITHUB_OUTPUT" + echo "reviews=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews --jq '[.[].state]')" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + - name: Get the GitHub handle of the fellows + uses: paritytech/get-fellows-action@v1.1.2 + id: fellows + # Require new reviews when the author is pushing and he is not a fellow + - name: Fail when author pushes new code + # if (contains approved reviews && it's a synchronize event && was triggered by the author (who is not a fellow)) + if: | + contains(fromJson(steps.comments.outputs.reviews), 'APPROVED') && + github.event_name == 'pull_request_target' && + github.event.action == 'synchronize' && + github.event.sender.login == github.event.pull_request.user.login && + contains(steps.fellows.outputs.github-handles, github.event.pull_request.user.login) + run: | + # We get the list of reviewers who approved the PR + REVIEWERS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \ + --jq '{reviewers: [.[] | select(.state == "APPROVED") | .user.login]}') + + # We request them to review again + echo $REVIEWERS | gh api --method POST repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers --input - + + echo "::error::Project needs to be reviewed again" + exit 1 + env: + GH_TOKEN: ${{ github.token }} + - name: Comment requirements + # If the previous step failed and github-actions hasn't commented yet we comment instructions + if: failure() && !contains(fromJson(steps.comments.outputs.bodies), 'Review required! Latest push from author must always be reviewed') + run: | + gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Review required! Latest push from author must always be reviewed" + env: + GH_TOKEN: ${{ github.token }} + COMMENTS: ${{ steps.comments.outputs.users }} - name: Get PR number env: PR_NUMBER: ${{ github.event.pull_request.number }} @@ -23,7 +64,7 @@ jobs: echo "Saving PR number: $PR_NUMBER" mkdir -p ./pr echo $PR_NUMBER > ./pr/pr_number - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: Save PR number with: name: pr_number From 2663a3a5f3b6a757efe102c3c74c5422499dda39 Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Tue, 7 May 2024 17:09:54 +0200 Subject: [PATCH 05/15] up-to-date action can be activated by auto-merge-bot (#272) - triggered up-to-date when auto-merge is enabled - Linked actions so that, when auto-merge is enabled, it will trigger up-to-date to update every PR (including this one) - Resolves https://github.com/paritytech/up-to-date-action/issues/14 - Updated `up-to-date` action's version - This latest change include paritytech/up-to-date-action#17 which stops the action from updating PRs which are already up to date - replaced github action for github's own action - Let's use github's tools when possible as they _should_ be more secure - [x] Does not require a CHANGELOG entry --------- Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com> --- .github/workflows/up-to-date.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/up-to-date.yml b/.github/workflows/up-to-date.yml index fa0a65f460..ccf3277aca 100644 --- a/.github/workflows/up-to-date.yml +++ b/.github/workflows/up-to-date.yml @@ -4,6 +4,9 @@ on: push: branches: - main + workflow_run: + workflows: [Auto Merge Bot] + types: [completed] jobs: updatePullRequests: @@ -13,11 +16,11 @@ jobs: steps: - name: Generate token id: generate_token - uses: tibdex/github-app-token@v1 + uses: actions/create-github-app-token@v1.9.3 with: - app_id: ${{ secrets.MERGE_APP_ID }} - private_key: ${{ secrets.MERGE_APP_KEY }} + app-id: ${{ secrets.MERGE_APP_ID }} + private-key: ${{ secrets.MERGE_APP_KEY }} - name: Update all the PRs - uses: paritytech/up-to-date-action@v0.2.0 + uses: paritytech/up-to-date-action@v0.2.1 with: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} From d63ed882383e5c972757182e1125818666c9d660 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Wed, 15 May 2024 13:45:21 +0200 Subject: [PATCH 06/15] Update pallet-balances to 29.0.2 (#309) Bump pallet-balances to include https://github.com/paritytech/polkadot-sdk/pull/3865 and clean up CHANGELOG. - [ ] Does not require a CHANGELOG entry --------- Signed-off-by: Oliver Tale-Yazdi --- CHANGELOG.md | 17 +++++++++++++---- Cargo.lock | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7843d2668b..db032c4027 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] -- Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269)) -- Remove DMP queue and allow `system::authorize_upgrade` in XCM's call filter ([polkadot-fellows/runtimes#280](https://github.com/polkadot-fellows/runtimes/pull/280)) -- Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) -- Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) +### Changed + - Kusama chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#261](https://github.com/polkadot-fellows/runtimes/pull/261)) - Allow everything through XCM SafeCallFilter ([polkadot-fellows/runtimes#285](https://github.com/polkadot-fellows/runtimes/pull/285)) +### Added + +- Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269)) +- Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) + ### Removed - Remove one-shot migrations from Kusama Coretime ([polkadot-fellows/runtimes#300](https://github.com/polkadot-fellows/runtimes/pull/300)) +- Remove DMP queue and allow `system::authorize_upgrade` in XCM's call filter ([polkadot-fellows/runtimes#280](https://github.com/polkadot-fellows/runtimes/pull/280)) + +### Fixed + +- Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) +- Safeguard pallet-balances against consumer ref underflow ([polkadot-fellows/runtimes#309](https://github.com/polkadot-fellows/runtimes/pull/309)) ## [1.2.3] 29.04.2024 diff --git a/Cargo.lock b/Cargo.lock index 99b0f426e1..ef1ade44eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7113,9 +7113,9 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "29.0.1" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27946a57494d7c6231ae8909275bbd3cb5460ee3d27b7a5774a8b8e64d3ab92" +checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" dependencies = [ "docify", "frame-benchmarking", From f29ef4bf7fc7039a9a62f0fd4e9abd95bfee6436 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 17 May 2024 10:32:20 +0200 Subject: [PATCH 07/15] Fix Clippy and update Rust (#299) Clippy warnings are now forbidden. Changes: - **Update Rust stable and nightly** - **Automatic clippy fix** - **Forbid clippy warnings** - **Remove redundant imports** - **Added minimal amount of `allow(`s to suppress clippy**. - [x] Does not require a CHANGELOG entry --------- Signed-off-by: Oliver Tale-Yazdi Co-authored-by: test@test.com --- .github/env | 4 +- .github/workflows/clippy.yml | 1 + chain-spec-generator/src/common.rs | 2 +- chain-spec-generator/src/main.rs | 40 +++++++------------ chain-spec-generator/src/relay_chain_specs.rs | 2 + .../chains/relays/kusama/src/genesis.rs | 1 + .../chains/relays/polkadot/src/genesis.rs | 1 + .../src/tests/reserve_transfer.rs | 12 +++--- .../assets/asset-hub-kusama/src/tests/send.rs | 2 +- .../asset-hub-kusama/src/tests/teleport.rs | 6 +-- .../src/tests/fellowship_treasury.rs | 2 +- .../src/tests/reserve_transfer.rs | 12 +++--- .../asset-hub-polkadot/src/tests/send.rs | 2 +- .../asset-hub-polkadot/src/tests/swap.rs | 1 - .../asset-hub-polkadot/src/tests/teleport.rs | 6 +-- .../asset-hub-polkadot/src/tests/treasury.rs | 2 +- .../bridge-hub-kusama/src/tests/mod.rs | 2 +- .../bridge-hub-kusama/src/tests/send_xcm.rs | 2 +- .../bridge-hub-kusama/src/tests/snowbridge.rs | 12 +++--- .../bridge-hub-polkadot/src/tests/mod.rs | 2 +- .../bridge-hub-polkadot/src/tests/send_xcm.rs | 2 +- .../src/tests/snowbridge.rs | 12 +++--- relay/kusama/constants/src/lib.rs | 4 +- relay/kusama/src/bag_thresholds.rs | 2 +- relay/kusama/src/governance/fellowship.rs | 33 ++++++++------- relay/kusama/src/governance/mod.rs | 4 +- relay/kusama/src/governance/origins.rs | 2 +- relay/kusama/src/governance/tracks.rs | 10 ++--- relay/kusama/src/impls.rs | 14 +++---- relay/kusama/src/lib.rs | 19 +++++---- relay/kusama/src/tests.rs | 3 -- relay/kusama/src/weights/xcm/mod.rs | 7 ++-- relay/kusama/src/xcm_config.rs | 3 +- relay/polkadot/constants/src/lib.rs | 2 +- relay/polkadot/src/governance/mod.rs | 6 +-- relay/polkadot/src/governance/origins.rs | 2 +- relay/polkadot/src/governance/tracks.rs | 10 ++--- relay/polkadot/src/lib.rs | 32 +++++++-------- relay/polkadot/src/weights/xcm/mod.rs | 7 ++-- relay/polkadot/src/xcm_config.rs | 1 - .../asset-hubs/asset-hub-kusama/src/lib.rs | 3 +- .../asset-hub-kusama/src/weights/xcm/mod.rs | 1 - .../asset-hub-kusama/tests/snowbridge.rs | 3 +- .../asset-hub-kusama/tests/weight_trader.rs | 2 +- .../asset-hubs/asset-hub-polkadot/src/lib.rs | 1 - .../asset-hub-polkadot/src/weights/xcm/mod.rs | 1 - .../asset-hub-polkadot/tests/snowbridge.rs | 3 +- .../asset-hub-polkadot/tests/weight_trader.rs | 2 +- .../src/bridge_to_polkadot_config.rs | 6 +-- .../bridge-hub-kusama/src/weights/xcm/mod.rs | 1 - .../bridge-hub-kusama/tests/snowbridge.rs | 2 +- .../src/bridge_to_kusama_config.rs | 6 +-- .../src/weights/xcm/mod.rs | 1 - .../bridge-hub-polkadot/tests/snowbridge.rs | 2 +- .../src/fellowship/mod.rs | 4 +- .../src/fellowship/tracks.rs | 6 +-- .../collectives-polkadot/src/impls.rs | 4 -- .../collectives-polkadot/src/xcm_config.rs | 1 - .../coretime/coretime-kusama/src/coretime.rs | 1 - .../coretime-kusama/src/weights/xcm/mod.rs | 1 - system-parachains/encointer/src/lib.rs | 4 +- .../encointer/src/migrations_fix.rs | 5 ++- system-parachains/encointer/src/xcm_config.rs | 1 - .../gluttons/glutton-kusama/src/xcm_config.rs | 1 - .../people/people-kusama/src/people.rs | 3 +- .../people-kusama/src/weights/xcm/mod.rs | 1 - 66 files changed, 154 insertions(+), 201 deletions(-) diff --git a/.github/env b/.github/env index 088d7c6914..17e6bea555 100644 --- a/.github/env +++ b/.github/env @@ -1,2 +1,2 @@ -RUST_STABLE_VERSION=1.76.0 -RUST_NIGHTLY_VERSION=2024-03-14 +RUST_STABLE_VERSION=1.77.0 +RUST_NIGHTLY_VERSION=2024-04-14 diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 3e19c20bef..cec099296a 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -36,4 +36,5 @@ jobs: - name: Clippy run: cargo +nightly-$RUST_NIGHTLY_VERSION clippy --all-targets --locked -q env: + RUSTFLAGS: "-D warnings" SKIP_WASM_BUILD: 1 diff --git a/chain-spec-generator/src/common.rs b/chain-spec-generator/src/common.rs index 2c2fe95ff8..c76e20c865 100644 --- a/chain-spec-generator/src/common.rs +++ b/chain-spec-generator/src/common.rs @@ -67,7 +67,7 @@ struct EmptyChainSpecWithId { pub fn from_json_file(filepath: &str, supported: String) -> Result, String> { let path = std::path::PathBuf::from(&filepath); - let file = std::fs::File::open(&filepath).expect("Failed to open file"); + let file = std::fs::File::open(filepath).expect("Failed to open file"); let reader = std::io::BufReader::new(file); let chain_spec: EmptyChainSpecWithId = serde_json::from_reader(reader) .expect("Failed to read 'json' file with ChainSpec configuration"); diff --git a/chain-spec-generator/src/main.rs b/chain-spec-generator/src/main.rs index eb4f7185e1..4a72781717 100644 --- a/chain-spec-generator/src/main.rs +++ b/chain-spec-generator/src/main.rs @@ -38,63 +38,51 @@ fn main() -> Result<(), String> { let supported_chains = HashMap::<_, Box Result, String>>>::from([ - ( - "polkadot-dev", - Box::new(|| relay_chain_specs::polkadot_development_config()) as Box<_>, - ), + ("polkadot-dev", Box::new(relay_chain_specs::polkadot_development_config) as Box<_>), ( "polkadot-local", - Box::new(|| relay_chain_specs::polkadot_local_testnet_config()) as Box<_>, - ), - ("kusama-dev", Box::new(|| relay_chain_specs::kusama_development_config()) as Box<_>), - ( - "kusama-local", - Box::new(|| relay_chain_specs::kusama_local_testnet_config()) as Box<_>, + Box::new(relay_chain_specs::polkadot_local_testnet_config) as Box<_>, ), + ("kusama-dev", Box::new(relay_chain_specs::kusama_development_config) as Box<_>), + ("kusama-local", Box::new(relay_chain_specs::kusama_local_testnet_config) as Box<_>), ( "asset-hub-kusama-local", - Box::new(|| system_parachains_specs::asset_hub_kusama_local_testnet_config()) - as Box<_>, + Box::new(system_parachains_specs::asset_hub_kusama_local_testnet_config) as Box<_>, ), ( "asset-hub-polkadot-local", - Box::new(|| system_parachains_specs::asset_hub_polkadot_local_testnet_config()) + Box::new(system_parachains_specs::asset_hub_polkadot_local_testnet_config) as Box<_>, ), ( "collectives-polkadot-local", - Box::new(|| system_parachains_specs::collectives_polkadot_local_testnet_config()) + Box::new(system_parachains_specs::collectives_polkadot_local_testnet_config) as Box<_>, ), ( "bridge-hub-polkadot-local", - Box::new(|| system_parachains_specs::bridge_hub_polkadot_local_testnet_config()) + Box::new(system_parachains_specs::bridge_hub_polkadot_local_testnet_config) as Box<_>, ), ( "bridge-hub-kusama-local", - Box::new(|| system_parachains_specs::bridge_hub_kusama_local_testnet_config()) - as Box<_>, + Box::new(system_parachains_specs::bridge_hub_kusama_local_testnet_config) as Box<_>, ), ( "glutton-kusama-local", - Box::new(|| system_parachains_specs::glutton_kusama_local_testnet_config()) - as Box<_>, + Box::new(system_parachains_specs::glutton_kusama_local_testnet_config) as Box<_>, ), ( "encointer-kusama-local", - Box::new(|| system_parachains_specs::encointer_kusama_local_testnet_config()) - as Box<_>, + Box::new(system_parachains_specs::encointer_kusama_local_testnet_config) as Box<_>, ), ( "coretime-kusama-local", - Box::new(|| system_parachains_specs::coretime_kusama_local_testnet_config()) - as Box<_>, + Box::new(system_parachains_specs::coretime_kusama_local_testnet_config) as Box<_>, ), ( "people-kusama-local", - Box::new(|| system_parachains_specs::people_kusama_local_testnet_config()) - as Box<_>, + Box::new(system_parachains_specs::people_kusama_local_testnet_config) as Box<_>, ), ]); @@ -104,7 +92,7 @@ fn main() -> Result<(), String> { Ok(()) } else { let supported = supported_chains.keys().enumerate().fold(String::new(), |c, (n, k)| { - let extra = (n + 1 < supported_chains.len()).then(|| ", ").unwrap_or(""); + let extra = if n + 1 < supported_chains.len() { ", " } else { "" }; format!("{c}{k}{extra}") }); if cli.chain.ends_with(".json") { diff --git a/chain-spec-generator/src/relay_chain_specs.rs b/chain-spec-generator/src/relay_chain_specs.rs index 3fb70efdd0..63caaeb44d 100644 --- a/chain-spec-generator/src/relay_chain_specs.rs +++ b/chain-spec-generator/src/relay_chain_specs.rs @@ -180,6 +180,7 @@ fn testnet_accounts() -> Vec { ] } +#[allow(clippy::type_complexity)] pub fn polkadot_testnet_genesis( initial_authorities: Vec<( AccountId, @@ -242,6 +243,7 @@ pub fn polkadot_testnet_genesis( }) } +#[allow(clippy::type_complexity)] pub fn kusama_testnet_genesis( initial_authorities: Vec<( AccountId, diff --git a/integration-tests/emulated/chains/relays/kusama/src/genesis.rs b/integration-tests/emulated/chains/relays/kusama/src/genesis.rs index 7fcd30571d..cc0b844516 100644 --- a/integration-tests/emulated/chains/relays/kusama/src/genesis.rs +++ b/integration-tests/emulated/chains/relays/kusama/src/genesis.rs @@ -37,6 +37,7 @@ mod validators { use super::*; use parachains_common::AccountId; + #[allow(clippy::type_complexity)] pub fn initial_authorities() -> Vec<( AccountId, AccountId, diff --git a/integration-tests/emulated/chains/relays/polkadot/src/genesis.rs b/integration-tests/emulated/chains/relays/polkadot/src/genesis.rs index 9451c70e68..36ea0bfff1 100644 --- a/integration-tests/emulated/chains/relays/polkadot/src/genesis.rs +++ b/integration-tests/emulated/chains/relays/polkadot/src/genesis.rs @@ -39,6 +39,7 @@ mod validators { use super::*; use parachains_common::AccountId; + #[allow(clippy::type_complexity)] pub fn initial_authorities() -> Vec<( AccountId, AccountId, diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/reserve_transfer.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/reserve_transfer.rs index 22a1419f98..38714e6d90 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/reserve_transfer.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/reserve_transfer.rs @@ -107,7 +107,7 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahk.clone().into(), + who: *who == sov_penpal_on_ahk.clone(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, @@ -267,7 +267,7 @@ fn para_to_para_limited_reserve_transfer_assets(t: ParaToParaTest) -> DispatchRe /// Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't work #[test] fn reserve_transfer_native_asset_from_relay_to_system_para_fails() { - let signed_origin = ::RuntimeOrigin::signed(KusamaSender::get().into()); + let signed_origin = ::RuntimeOrigin::signed(KusamaSender::get()); let destination = Kusama::child_location_of(AssetHubKusama::para_id()); let beneficiary: Location = AccountId32Junction { network: None, id: AssetHubKusamaReceiver::get().into() }.into(); @@ -301,7 +301,7 @@ fn reserve_transfer_native_asset_from_relay_to_system_para_fails() { fn reserve_transfer_native_asset_from_system_para_to_relay_fails() { // Init values for System Parachain let signed_origin = - ::RuntimeOrigin::signed(AssetHubKusamaSender::get().into()); + ::RuntimeOrigin::signed(AssetHubKusamaSender::get()); let destination = AssetHubKusama::parent_location(); let beneficiary_id = KusamaReceiver::get(); let beneficiary: Location = @@ -444,7 +444,7 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { let sov_penpal_on_ahk = AssetHubKusama::sovereign_account_id_of(penpal_location_as_seen_by_ahk); // fund the Penpal's SA on AHK with the native tokens held in reserve - AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahk.into(), amount_to_send * 2)]); + AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahk, amount_to_send * 2)]); test.set_assertion::(para_to_system_para_sender_assertions); test.set_assertion::(para_to_system_para_receiver_assertions); @@ -527,7 +527,7 @@ fn reserve_transfer_assets_from_system_para_to_para() { // Create SA-of-Penpal-on-AHK with ED. let penpal_location = AssetHubKusama::sibling_location_of(PenpalA::para_id()); let sov_penpal_on_ahk = AssetHubKusama::sovereign_account_id_of(penpal_location); - AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahk.into(), KUSAMA_ED)]); + AssetHubKusama::fund_accounts(vec![(sov_penpal_on_ahk, KUSAMA_ED)]); let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; @@ -598,7 +598,7 @@ fn reserve_transfer_native_asset_from_para_to_para() { let sov_of_sender_on_relay = Kusama::sovereign_account_id_of(sender_as_seen_by_relay); // fund the PenpalA's SA on Kusama with the native tokens held in reserve - Kusama::fund_accounts(vec![(sov_of_sender_on_relay.into(), amount_to_send * 2)]); + Kusama::fund_accounts(vec![(sov_of_sender_on_relay, amount_to_send * 2)]); test.set_assertion::(para_to_para_sender_assertions); test.set_assertion::(para_to_para_relay_hop_assertions); diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/send.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/send.rs index 09cff4ec55..2188318aa7 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/send.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/send.rs @@ -23,7 +23,7 @@ fn send_transact_as_superuser_from_relay_to_system_para_works() { ASSET_ID, ASSET_MIN_BALANCE, true, - AssetHubKusamaSender::get().into(), + AssetHubKusamaSender::get(), Some(Weight::from_parts(1_019_445_000, 200_000)), ) } diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs index 5d9af97d50..a6b9c68e81 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs @@ -151,7 +151,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahk.clone().into(), + who: *who == sov_penpal_on_ahk.clone(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { @@ -383,8 +383,8 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { fn limited_teleport_native_assets_from_system_para_to_relay_fails() { // Init values for Relay Chain let amount_to_send: Balance = ASSET_HUB_KUSAMA_ED * 1000; - let destination = AssetHubKusama::parent_location().into(); - let beneficiary_id = KusamaReceiver::get().into(); + let destination = AssetHubKusama::parent_location(); + let beneficiary_id = KusamaReceiver::get(); let assets = (Parent, amount_to_send).into(); let test_args = TestContext { diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/fellowship_treasury.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/fellowship_treasury.rs index d13e50fdbc..2670a1128b 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/fellowship_treasury.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/fellowship_treasury.rs @@ -15,7 +15,7 @@ use crate::*; use emulated_integration_tests_common::accounts::{ALICE, BOB}; -use frame_support::traits::fungibles::{Create, Inspect, Mutate}; +use frame_support::traits::fungibles::{Create, Mutate}; use polkadot_runtime_common::impls::VersionedLocatableAsset; use xcm_executor::traits::ConvertLocation; diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs index bb3ac058cd..e7f094a4d9 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs @@ -107,7 +107,7 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahp.clone().into(), + who: *who == sov_penpal_on_ahp.clone(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, @@ -267,7 +267,7 @@ fn para_to_para_limited_reserve_transfer_assets(t: ParaToParaTest) -> DispatchRe /// Reserve Transfers of native asset from Relay Chain to the System Parachain shouldn't work #[test] fn reserve_transfer_native_asset_from_relay_to_system_para_fails() { - let signed_origin = ::RuntimeOrigin::signed(PolkadotSender::get().into()); + let signed_origin = ::RuntimeOrigin::signed(PolkadotSender::get()); let destination = Polkadot::child_location_of(AssetHubPolkadot::para_id()); let beneficiary: Location = AccountId32Junction { network: None, id: AssetHubPolkadotReceiver::get().into() }.into(); @@ -301,7 +301,7 @@ fn reserve_transfer_native_asset_from_relay_to_system_para_fails() { fn reserve_transfer_native_asset_from_system_para_to_relay_fails() { // Init values for System Parachain let signed_origin = - ::RuntimeOrigin::signed(AssetHubPolkadotSender::get().into()); + ::RuntimeOrigin::signed(AssetHubPolkadotSender::get()); let destination = AssetHubPolkadot::parent_location(); let beneficiary_id = PolkadotReceiver::get(); let beneficiary: Location = @@ -445,7 +445,7 @@ fn reserve_transfer_native_asset_from_para_to_system_para() { AssetHubPolkadot::sovereign_account_id_of(penpal_location_as_seen_by_ahp); // fund the Penpal's SA on AHP with the native tokens held in reserve - AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahp.into(), amount_to_send * 2)]); + AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahp, amount_to_send * 2)]); test.set_assertion::(para_to_system_para_sender_assertions); test.set_assertion::(para_to_system_para_receiver_assertions); @@ -528,7 +528,7 @@ fn reserve_transfer_assets_from_system_para_to_para() { // Create SA-of-Penpal-on-AHP with ED. let penpal_location = AssetHubPolkadot::sibling_location_of(PenpalB::para_id()); let sov_penpal_on_ahp = AssetHubPolkadot::sovereign_account_id_of(penpal_location); - AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahp.into(), POLKADOT_ED)]); + AssetHubPolkadot::fund_accounts(vec![(sov_penpal_on_ahp, POLKADOT_ED)]); let sender_balance_before = test.sender.balance; let receiver_balance_before = test.receiver.balance; @@ -599,7 +599,7 @@ fn reserve_transfer_native_asset_from_para_to_para() { let sov_of_sender_on_relay = Polkadot::sovereign_account_id_of(sender_as_seen_by_relay); // fund the PenpalB's SA on Polkadot with the native tokens held in reserve - Polkadot::fund_accounts(vec![(sov_of_sender_on_relay.into(), amount_to_send * 2)]); + Polkadot::fund_accounts(vec![(sov_of_sender_on_relay, amount_to_send * 2)]); test.set_assertion::(para_to_para_sender_assertions); test.set_assertion::(para_to_para_relay_hop_assertions); diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/send.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/send.rs index 2be0ae22ff..623264b25b 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/send.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/send.rs @@ -23,7 +23,7 @@ fn send_transact_as_superuser_from_relay_to_system_para_works() { ASSET_ID, ASSET_MIN_BALANCE, true, - AssetHubPolkadotSender::get().into(), + AssetHubPolkadotSender::get(), Some(Weight::from_parts(1_019_445_000, 200_000)), ) } diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/swap.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/swap.rs index 63a1fa45c7..fa76779587 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/swap.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/swap.rs @@ -15,7 +15,6 @@ use crate::*; use polkadot_system_emulated_network::penpal_emulated_chain::LocalTeleportableToAssetHub as PenpalLocalTeleportableToAssetHub; -use sp_runtime::ModuleError; use system_parachains_constants::polkadot::currency::SYSTEM_PARA_EXISTENTIAL_DEPOSIT; #[test] diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs index e5a6c3ea5a..65b25f13bc 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs @@ -151,7 +151,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { RuntimeEvent::Balances( pallet_balances::Event::Burned { who, amount } ) => { - who: *who == sov_penpal_on_ahk.clone().into(), + who: *who == sov_penpal_on_ahk.clone(), amount: *amount == t.args.amount, }, RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { @@ -383,8 +383,8 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() { fn limited_teleport_native_assets_from_system_para_to_relay_fails() { // Init values for Relay Chain let amount_to_send: Balance = ASSET_HUB_POLKADOT_ED * 1000; - let destination = AssetHubPolkadot::parent_location().into(); - let beneficiary_id = PolkadotReceiver::get().into(); + let destination = AssetHubPolkadot::parent_location(); + let beneficiary_id = PolkadotReceiver::get(); let assets = (Parent, amount_to_send).into(); let test_args = TestContext { diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/treasury.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/treasury.rs index 7c177bc272..213b9c0f1f 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/treasury.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/treasury.rs @@ -15,7 +15,7 @@ use crate::*; use emulated_integration_tests_common::accounts::{ALICE, BOB}; -use frame_support::traits::fungibles::{Create, Inspect, Mutate}; +use frame_support::traits::fungibles::{Create, Mutate}; use polkadot_runtime_common::impls::VersionedLocatableAsset; use xcm_executor::traits::ConvertLocation; diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs index 05b1b3437c..9d5d7a9f38 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs @@ -40,7 +40,7 @@ pub(crate) fn send_asset_from_asset_hub_kusama( (id, amount): (Location, u128), ) -> DispatchResult { let signed_origin = - ::RuntimeOrigin::signed(AssetHubKusamaSender::get().into()); + ::RuntimeOrigin::signed(AssetHubKusamaSender::get()); let beneficiary: Location = AccountId32Junction { network: None, id: AssetHubPolkadotReceiver::get().into() }.into(); diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs index a700d61122..757089282c 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs @@ -74,7 +74,7 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { // fund the AHK's SA on BHK for paying bridge transport fees BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id(), 10_000_000_000_000u128); // fund sender - AssetHubKusama::fund_accounts(vec![(AssetHubKusamaSender::get().into(), amount * 10)]); + AssetHubKusama::fund_accounts(vec![(AssetHubKusamaSender::get(), amount * 10)]); // send XCM from AssetHubKusama - fails - destination version not known assert_err!( diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs index 4001733b9a..f15c05f67a 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs @@ -224,7 +224,7 @@ fn create_channel() { #[test] fn register_weth_token_from_ethereum_to_asset_hub() { // Fund AH sovereign account on BH so that it can pay execution fees. - BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id().into(), INITIAL_FUND); + BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id(), INITIAL_FUND); // Fund ethereum sovereign account on AssetHub. AssetHubKusama::fund_accounts(vec![(ethereum_sovereign_account(), INITIAL_FUND)]); @@ -379,7 +379,7 @@ fn send_token_from_ethereum_to_penpal() { /// a token from Ethereum to AssetHub. #[test] fn send_token_from_ethereum_to_asset_hub() { - BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id().into(), INITIAL_FUND); + BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id(), INITIAL_FUND); // Fund ethereum sovereign account on AssetHub. AssetHubKusama::fund_accounts(vec![(ethereum_sovereign_account(), INITIAL_FUND)]); @@ -466,7 +466,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() { exchange_rate: FixedU128::from_rational(1, 75), fee_per_gas: gwei(20), rewards: Rewards { - local: (1 * UNITS / 100).into(), // 0.01 KSM + local: (UNITS / 100), // 0.01 KSM remote: meth(1), }, multiplier: FixedU128::from_rational(1, 1), @@ -537,7 +537,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() { let beneficiary = VersionedLocation::V4(Location::new( 0, - [AccountKey20 { network: None, key: ETHEREUM_DESTINATION_ADDRESS.into() }], + [AccountKey20 { network: None, key: ETHEREUM_DESTINATION_ADDRESS }], )); let free_balance_before = ::Balances::free_balance( @@ -599,7 +599,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() { #[test] fn register_weth_token_in_asset_hub_fail_for_insufficient_fee() { - BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id().into(), INITIAL_FUND); + BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id(), INITIAL_FUND); BridgeHubKusama::execute_with(|| { type RuntimeEvent = ::RuntimeEvent; @@ -636,7 +636,7 @@ fn register_weth_token_in_asset_hub_fail_for_insufficient_fee() { #[test] fn send_token_from_ethereum_to_asset_hub_fail_for_insufficient_fund() { // Insufficient fund - BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id().into(), 1_000); + BridgeHubKusama::fund_para_sovereign(AssetHubKusama::para_id(), 1_000); BridgeHubKusama::execute_with(|| { assert_ok!(::System::set_storage( diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs index 9b9c1243cf..86138cf32c 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs @@ -40,7 +40,7 @@ pub(crate) fn send_asset_from_asset_hub_polkadot( (id, amount): (Location, u128), ) -> DispatchResult { let signed_origin = - ::RuntimeOrigin::signed(AssetHubPolkadotSender::get().into()); + ::RuntimeOrigin::signed(AssetHubPolkadotSender::get()); let beneficiary: Location = AccountId32Junction { network: None, id: AssetHubKusamaReceiver::get().into() }.into(); diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs index 587f6f7291..4102ddeb56 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs @@ -74,7 +74,7 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { // fund the AHK's SA on BHK for paying bridge transport fees BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 10_000_000_000_000u128); // fund sender - AssetHubPolkadot::fund_accounts(vec![(AssetHubPolkadotSender::get().into(), amount * 10)]); + AssetHubPolkadot::fund_accounts(vec![(AssetHubPolkadotSender::get(), amount * 10)]); // send XCM from AssetHubPolkadot - fails - destination version not known assert_err!( diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs index 8bfebf9327..cc6dbc4583 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs @@ -224,7 +224,7 @@ fn create_channel() { #[test] fn register_weth_token_from_ethereum_to_asset_hub() { // Fund AH sovereign account on BH so that it can pay execution fees. - BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id().into(), INITIAL_FUND); + BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), INITIAL_FUND); // Fund ethereum sovereign account on AssetHub. AssetHubPolkadot::fund_accounts(vec![(ethereum_sovereign_account(), INITIAL_FUND)]); @@ -379,7 +379,7 @@ fn send_token_from_ethereum_to_penpal() { /// a token from Ethereum to AssetHub. #[test] fn send_token_from_ethereum_to_asset_hub() { - BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id().into(), INITIAL_FUND); + BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), INITIAL_FUND); // Fund ethereum sovereign account on AssetHub. AssetHubPolkadot::fund_accounts(vec![(ethereum_sovereign_account(), INITIAL_FUND)]); @@ -466,7 +466,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() { exchange_rate: FixedU128::from_rational(1, 75), fee_per_gas: gwei(20), rewards: Rewards { - local: (1 * UNITS / 100).into(), // 0.01 DOT + local: (UNITS / 100), // 0.01 DOT remote: meth(1), }, multiplier: FixedU128::from_rational(1, 1), @@ -537,7 +537,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() { let beneficiary = VersionedLocation::V4(Location::new( 0, - [AccountKey20 { network: None, key: ETHEREUM_DESTINATION_ADDRESS.into() }], + [AccountKey20 { network: None, key: ETHEREUM_DESTINATION_ADDRESS }], )); let free_balance_before = @@ -603,7 +603,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() { #[test] fn register_weth_token_in_asset_hub_fail_for_insufficient_fee() { - BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id().into(), INITIAL_FUND); + BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), INITIAL_FUND); BridgeHubPolkadot::execute_with(|| { type RuntimeEvent = ::RuntimeEvent; @@ -640,7 +640,7 @@ fn register_weth_token_in_asset_hub_fail_for_insufficient_fee() { #[test] fn send_token_from_ethereum_to_asset_hub_fail_for_insufficient_fund() { // Insufficient fund - BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id().into(), 1_000); + BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 1_000); BridgeHubPolkadot::execute_with(|| { assert_ok!(::System::set_storage( diff --git a/relay/kusama/constants/src/lib.rs b/relay/kusama/constants/src/lib.rs index 78046e0d05..4310e3966e 100644 --- a/relay/kusama/constants/src/lib.rs +++ b/relay/kusama/constants/src/lib.rs @@ -23,7 +23,7 @@ pub mod currency { use primitives::Balance; /// The existential deposit. - pub const EXISTENTIAL_DEPOSIT: Balance = 1 * CENTS; + pub const EXISTENTIAL_DEPOSIT: Balance = CENTS; pub const UNITS: Balance = 1_000_000_000_000; pub const QUID: Balance = UNITS / 30; @@ -42,7 +42,7 @@ pub mod time { use runtime_common::prod_or_fast; pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(1 * HOURS, 1 * MINUTES); + pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(HOURS, MINUTES); // These time units are defined in number of blocks. pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); diff --git a/relay/kusama/src/bag_thresholds.rs b/relay/kusama/src/bag_thresholds.rs index 82dc4c3a81..5e34d5073f 100644 --- a/relay/kusama/src/bag_thresholds.rs +++ b/relay/kusama/src/bag_thresholds.rs @@ -27,7 +27,7 @@ pub const EXISTENTIAL_WEIGHT: u64 = 33_333_333; /// Constant ratio between bags for this runtime. #[cfg(any(test, feature = "std"))] #[allow(unused)] -pub const CONSTANT_RATIO: f64 = 1.1455399939091000; +pub const CONSTANT_RATIO: f64 = 1.145_539_993_909_1; /// Upper thresholds delimiting the bag list. pub const THRESHOLDS: [u64; 200] = [ diff --git a/relay/kusama/src/governance/fellowship.rs b/relay/kusama/src/governance/fellowship.rs index b353ff5e3d..9427b135d5 100644 --- a/relay/kusama/src/governance/fellowship.rs +++ b/relay/kusama/src/governance/fellowship.rs @@ -23,11 +23,10 @@ use frame_support::traits::{MapSuccess, TryMapSuccess}; use sp_arithmetic::traits::CheckedSub; use sp_runtime::{ morph_types, - traits::{ConstU16, Replace, TypedGet}, + traits::{Replace, TypedGet}, }; use super::*; -use crate::{DAYS, QUID}; parameter_types! { pub const AlarmInterval: BlockNumber = 1; @@ -50,7 +49,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -72,7 +71,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -94,7 +93,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -116,7 +115,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -138,7 +137,7 @@ impl pallet_referenda::TracksInfo for TracksInfo { prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -156,11 +155,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "experts", max_deciding: 10, - decision_deposit: 1 * QUID, + decision_deposit: QUID, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -178,11 +177,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "senior experts", max_deciding: 10, - decision_deposit: 1 * QUID, + decision_deposit: QUID, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -200,11 +199,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "masters", max_deciding: 10, - decision_deposit: 1 * QUID, + decision_deposit: QUID, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -222,11 +221,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "senior masters", max_deciding: 10, - decision_deposit: 1 * QUID, + decision_deposit: QUID, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), @@ -244,11 +243,11 @@ impl pallet_referenda::TracksInfo for TracksInfo { pallet_referenda::TrackInfo { name: "grand masters", max_deciding: 10, - decision_deposit: 1 * QUID, + decision_deposit: QUID, prepare_period: 30 * MINUTES, decision_period: 7 * DAYS, confirm_period: 30 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), floor: Perbill::from_percent(50), diff --git a/relay/kusama/src/governance/mod.rs b/relay/kusama/src/governance/mod.rs index c8a7b360ed..b07e4d7204 100644 --- a/relay/kusama/src/governance/mod.rs +++ b/relay/kusama/src/governance/mod.rs @@ -51,12 +51,12 @@ impl pallet_conviction_voting::Config for Runtime { parameter_types! { pub const AlarmInterval: BlockNumber = 1; - pub const SubmissionDeposit: Balance = 1 * QUID; + pub const SubmissionDeposit: Balance = QUID; pub const UndecidingTimeout: BlockNumber = 14 * DAYS; } parameter_types! { - pub const MaxBalance: Balance = Balance::max_value(); + pub const MaxBalance: Balance = Balance::MAX; } pub type TreasurySpender = EitherOf, Spender>; diff --git a/relay/kusama/src/governance/origins.rs b/relay/kusama/src/governance/origins.rs index 0b55c0056d..24dcf17801 100644 --- a/relay/kusama/src/governance/origins.rs +++ b/relay/kusama/src/governance/origins.rs @@ -173,7 +173,7 @@ pub mod pallet_custom_origins { decl_ensure! { pub type Spender: EnsureOrigin { SmallTipper = 250 * QUID, - BigTipper = 1 * GRAND, + BigTipper = GRAND, SmallSpender = 10 * GRAND, MediumSpender = 100 * GRAND, BigSpender = 1_000 * GRAND, diff --git a/relay/kusama/src/governance/tracks.rs b/relay/kusama/src/governance/tracks.rs index 75781deff1..d2e5403501 100644 --- a/relay/kusama/src/governance/tracks.rs +++ b/relay/kusama/src/governance/tracks.rs @@ -127,7 +127,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 16 pallet_referenda::TrackInfo { name: "treasurer", max_deciding: 10, - decision_deposit: 1 * GRAND, + decision_deposit: GRAND, prepare_period: 2 * HOURS, decision_period: 14 * DAYS, confirm_period: 48 * HOURS, @@ -225,11 +225,11 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 16 pallet_referenda::TrackInfo { name: "small_tipper", max_deciding: 200, - decision_deposit: 1 * QUID, - prepare_period: 1 * MINUTES, + decision_deposit: QUID, + prepare_period: MINUTES, decision_period: 7 * DAYS, confirm_period: 10 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: APP_SMALL_TIPPER, min_support: SUP_SMALL_TIPPER, }, @@ -242,7 +242,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 16 decision_deposit: 10 * QUID, prepare_period: 10 * MINUTES, decision_period: 7 * DAYS, - confirm_period: 1 * HOURS, + confirm_period: HOURS, min_enactment_period: 10 * MINUTES, min_approval: APP_BIG_TIPPER, min_support: SUP_BIG_TIPPER, diff --git a/relay/kusama/src/impls.rs b/relay/kusama/src/impls.rs index 23e63b637c..e9c3f970ec 100644 --- a/relay/kusama/src/impls.rs +++ b/relay/kusama/src/impls.rs @@ -15,19 +15,16 @@ // along with Polkadot. If not, see . use super::*; -use crate::xcm_config; use core::marker::PhantomData; use frame_support::{ - defensive, - pallet_prelude::DispatchResult, - traits::{tokens::ConversionFromAssetBalance, Contains}, + defensive, pallet_prelude::DispatchResult, traits::tokens::ConversionFromAssetBalance, }; use frame_system::RawOrigin; use kusama_runtime_constants::system_parachain::PEOPLE_ID; use parity_scale_codec::{Decode, Encode}; -use primitives::{Balance, Id as ParaId}; +use primitives::Id as ParaId; use runtime_common::identity_migrator::{OnReapIdentity, WeightInfo}; -use xcm::{latest::prelude::*, VersionedLocation, VersionedXcm}; +use xcm::{latest::prelude::*, VersionedXcm}; use xcm_builder::IsChildSystemParachain; use xcm_executor::traits::TransactAsset; @@ -161,8 +158,7 @@ where DepositAsset { assets: Wild(AllCounted(1)), beneficiary: Junction::AccountId32 { network: None, id: who.clone().into() } - .into_location() - .into(), + .into_location(), }, // Poke the deposit to reserve the appropriate amount on the parachain. Transact { @@ -173,7 +169,7 @@ where ]); // send - let _ = >::send( + >::send( RawOrigin::Root.into(), Box::new(VersionedLocation::V4(destination)), Box::new(VersionedXcm::V4(program)), diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 8e0cfd1b63..a3faef097e 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -407,13 +407,12 @@ impl BeefyDataProvider for ParaHeadsRootProvider { fn extra_data() -> H256 { let mut para_heads: Vec<(u32, Vec)> = Paras::parachains() .into_iter() - .filter_map(|id| Paras::para_head(&id).map(|head| (id.into(), head.0))) + .filter_map(|id| Paras::para_head(id).map(|head| (id.into(), head.0))) .collect(); para_heads.sort_by_key(|k| k.0); binary_merkle_tree::merkle_root::( para_heads.into_iter().map(|pair| pair.encode()), ) - .into() } } @@ -540,12 +539,12 @@ parameter_types! { // in testing: 1min or half of the session for each pub SignedPhase: u32 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS / 4, - (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2), + MINUTES.min(EpochDuration::get().saturated_into::() / 2), "KSM_SIGNED_PHASE" ); pub UnsignedPhase: u32 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS / 4, - (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2), + MINUTES.min(EpochDuration::get().saturated_into::() / 2), "KSM_UNSIGNED_PHASE" ); @@ -568,7 +567,7 @@ parameter_types! { pub ElectionBounds: frame_election_provider_support::bounds::ElectionBounds = ElectionBoundsBuilder::default().voters_count(MaxElectingVoters::get().into()).build(); pub NposSolutionPriority: TransactionPriority = - Perbill::from_percent(90) * TransactionPriority::max_value(); + Perbill::from_percent(90) * TransactionPriority::MAX; /// Setup election pallet to support maximum winners upto 2000. This will mean Staking Pallet /// cannot have active validators higher than this count. pub const MaxActiveValidators: u32 = 2000; @@ -773,7 +772,7 @@ impl pallet_fast_unstake::Config for Runtime { parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); pub const ProposalBondMinimum: Balance = 2000 * CENTS; - pub const ProposalBondMaximum: Balance = 1 * GRAND; + pub const ProposalBondMaximum: Balance = GRAND; pub const SpendPeriod: BlockNumber = 6 * DAYS; pub const Burn: Permill = Permill::from_perthousand(2); pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); @@ -782,10 +781,10 @@ parameter_types! { // pallet instance (which sits at index 18). pub TreasuryInteriorLocation: InteriorLocation = PalletInstance(TREASURY_PALLET_ID).into(); - pub const TipCountdown: BlockNumber = 1 * DAYS; + pub const TipCountdown: BlockNumber = DAYS; pub const TipFindersFee: Percent = Percent::from_percent(20); pub const TipReportDepositBase: Balance = 100 * CENTS; - pub const DataDepositPerByte: Balance = 1 * CENTS; + pub const DataDepositPerByte: Balance = CENTS; pub const MaxApprovals: u32 = 100; pub const MaxAuthorities: u32 = 100_000; pub const MaxKeys: u32 = 10_000; @@ -1276,7 +1275,7 @@ impl parachains_inclusion::Config for Runtime { } parameter_types! { - pub const ParasUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); + pub const ParasUnsignedPriority: TransactionPriority = TransactionPriority::MAX; } impl parachains_paras::Config for Runtime { @@ -2876,7 +2875,7 @@ mod multiplier_tests { fn run_with_system_weight(w: Weight, mut assertions: F) where - F: FnMut() -> (), + F: FnMut(), { let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::::default() .build_storage() diff --git a/relay/kusama/src/tests.rs b/relay/kusama/src/tests.rs index e6e248a8e9..b5fc87781b 100644 --- a/relay/kusama/src/tests.rs +++ b/relay/kusama/src/tests.rs @@ -21,12 +21,9 @@ use frame_support::{ dispatch::GetDispatchInfo, traits::WhitelistedStorageKeys, weights::WeightToFee as WeightToFeeT, }; use keyring::Sr25519Keyring::Charlie; -use pallet_transaction_payment::Multiplier; -use parity_scale_codec::Encode; use runtime_common::MinimumMultiplier; use separator::Separatable; use sp_core::hexdisplay::HexDisplay; -use sp_runtime::FixedPointNumber; use std::collections::HashSet; #[test] diff --git a/relay/kusama/src/weights/xcm/mod.rs b/relay/kusama/src/weights/xcm/mod.rs index 321e1eac27..8cc7122800 100644 --- a/relay/kusama/src/weights/xcm/mod.rs +++ b/relay/kusama/src/weights/xcm/mod.rs @@ -18,7 +18,6 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; use crate::Runtime; -use frame_support::weights::Weight; use sp_std::prelude::*; use xcm::{latest::prelude::*, DoubleEncoded}; @@ -55,7 +54,7 @@ impl WeighAssets for AssetFilter { match self { Self::Definite(assets) => assets .inner() - .into_iter() + .iter() .map(From::from) .map(|t| match t { AssetTypes::Balances => balances_weight, @@ -75,8 +74,8 @@ impl WeighAssets for AssetFilter { impl WeighAssets for Assets { fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight { self.inner() - .into_iter() - .map(|m| >::from(m)) + .iter() + .map(>::from) .map(|t| match t { AssetTypes::Balances => balances_weight, AssetTypes::Unknown => Weight::MAX, diff --git a/relay/kusama/src/xcm_config.rs b/relay/kusama/src/xcm_config.rs index 9cca5d0ca1..9c6e8fbe78 100644 --- a/relay/kusama/src/xcm_config.rs +++ b/relay/kusama/src/xcm_config.rs @@ -24,7 +24,6 @@ use super::{ use frame_support::{ parameter_types, traits::{Contains, Equals, Everything, Nothing}, - weights::Weight, }; use frame_system::EnsureRoot; use kusama_runtime_constants::{currency::CENTS, system_parachain::*}; @@ -321,7 +320,7 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() { assert!(weight.all_lte(Weight::from_parts(30_313_281_000, 72_722))); let Some(Transact { require_weight_at_most, call, .. }) = - xcm.inner_mut().into_iter().find(|inst| matches!(inst, Transact { .. })) + xcm.inner_mut().iter_mut().find(|inst| matches!(inst, Transact { .. })) else { panic!("no Transact instruction found") }; diff --git a/relay/polkadot/constants/src/lib.rs b/relay/polkadot/constants/src/lib.rs index f47d9e6a97..1ddd59d86a 100644 --- a/relay/polkadot/constants/src/lib.rs +++ b/relay/polkadot/constants/src/lib.rs @@ -44,7 +44,7 @@ pub mod time { use runtime_common::prod_or_fast; pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(4 * HOURS, 1 * MINUTES); + pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(4 * HOURS, MINUTES); // These time units are defined in number of blocks. pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); diff --git a/relay/polkadot/src/governance/mod.rs b/relay/polkadot/src/governance/mod.rs index 39a7188954..d9b84b21ae 100644 --- a/relay/polkadot/src/governance/mod.rs +++ b/relay/polkadot/src/governance/mod.rs @@ -18,7 +18,7 @@ use super::*; use crate::xcm_config::CollectivesLocation; -use frame_support::{parameter_types, traits::EitherOf}; +use frame_support::parameter_types; use frame_system::EnsureRootWithSuccess; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use xcm::latest::BodyId; @@ -48,12 +48,12 @@ impl pallet_conviction_voting::Config for Runtime { parameter_types! { pub const AlarmInterval: BlockNumber = 1; - pub const SubmissionDeposit: Balance = 1 * DOLLARS; + pub const SubmissionDeposit: Balance = DOLLARS; pub const UndecidingTimeout: BlockNumber = 14 * DAYS; } parameter_types! { - pub const MaxBalance: Balance = Balance::max_value(); + pub const MaxBalance: Balance = Balance::MAX; } pub type TreasurySpender = EitherOf, Spender>; diff --git a/relay/polkadot/src/governance/origins.rs b/relay/polkadot/src/governance/origins.rs index ac4f667d39..f1283b551e 100644 --- a/relay/polkadot/src/governance/origins.rs +++ b/relay/polkadot/src/governance/origins.rs @@ -144,7 +144,7 @@ pub mod pallet_custom_origins { decl_ensure! { pub type Spender: EnsureOrigin { SmallTipper = 250 * DOLLARS, - BigTipper = 1 * GRAND, + BigTipper = GRAND, SmallSpender = 10 * GRAND, MediumSpender = 100 * GRAND, BigSpender = 1_000 * GRAND, diff --git a/relay/polkadot/src/governance/tracks.rs b/relay/polkadot/src/governance/tracks.rs index 4a167d606f..7ee9aec7a6 100644 --- a/relay/polkadot/src/governance/tracks.rs +++ b/relay/polkadot/src/governance/tracks.rs @@ -127,7 +127,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 16 pallet_referenda::TrackInfo { name: "treasurer", max_deciding: 10, - decision_deposit: 1 * GRAND, + decision_deposit: GRAND, prepare_period: 2 * HOURS, decision_period: 28 * DAYS, confirm_period: 7 * DAYS, @@ -225,11 +225,11 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 16 pallet_referenda::TrackInfo { name: "small_tipper", max_deciding: 200, - decision_deposit: 1 * DOLLARS, - prepare_period: 1 * MINUTES, + decision_deposit: DOLLARS, + prepare_period: MINUTES, decision_period: 7 * DAYS, confirm_period: 10 * MINUTES, - min_enactment_period: 1 * MINUTES, + min_enactment_period: MINUTES, min_approval: APP_SMALL_TIPPER, min_support: SUP_SMALL_TIPPER, }, @@ -242,7 +242,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 16 decision_deposit: 10 * DOLLARS, prepare_period: 10 * MINUTES, decision_period: 7 * DAYS, - confirm_period: 1 * HOURS, + confirm_period: HOURS, min_enactment_period: 10 * MINUTES, min_approval: APP_BIG_TIPPER, min_support: SUP_BIG_TIPPER, diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 7af0c9f617..5e1695038c 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -132,7 +132,7 @@ use governance::{ pub mod impls; pub mod xcm_config; -pub const LOG_TARGET: &'static str = "runtime::polkadot"; +pub const LOG_TARGET: &str = "runtime::polkadot"; impl_runtime_weights!(polkadot_runtime_constants); @@ -384,13 +384,12 @@ impl BeefyDataProvider for ParaHeadsRootProvider { fn extra_data() -> H256 { let mut para_heads: Vec<(u32, Vec)> = Paras::parachains() .into_iter() - .filter_map(|id| Paras::para_head(&id).map(|head| (id.into(), head.0))) + .filter_map(|id| Paras::para_head(id).map(|head| (id.into(), head.0))) .collect(); para_heads.sort_by_key(|k| k.0); binary_merkle_tree::merkle_root::( para_heads.into_iter().map(|pair| pair.encode()), ) - .into() } } @@ -517,12 +516,12 @@ parameter_types! { // in testing: 1min or half of the session for each pub SignedPhase: u32 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS / 4, - (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2), + MINUTES.min(EpochDuration::get().saturated_into::() / 2), "DOT_SIGNED_PHASE" ); pub UnsignedPhase: u32 = prod_or_fast!( EPOCH_DURATION_IN_SLOTS / 4, - (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2), + MINUTES.min(EpochDuration::get().saturated_into::() / 2), "DOT_UNSIGNED_PHASE" ); @@ -534,7 +533,7 @@ parameter_types! { // 0.01 DOT per KB of solution data. pub const SignedDepositByte: Balance = deposit(0, 10) / 1024; // Each good submission will get 1 DOT as reward - pub SignedRewardBase: Balance = 1 * UNITS; + pub SignedRewardBase: Balance = UNITS; // 4 hour session, 1 hour unsigned phase, 32 offchain executions. pub OffchainRepeat: BlockNumber = UnsignedPhase::get() / 32; @@ -853,10 +852,10 @@ parameter_types! { // pallet instance (which sits at index 19). pub TreasuryInteriorLocation: InteriorLocation = PalletInstance(TREASURY_PALLET_ID).into(); - pub const TipCountdown: BlockNumber = 1 * DAYS; + pub const TipCountdown: BlockNumber = DAYS; pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * DOLLARS; - pub const DataDepositPerByte: Balance = 1 * CENTS; + pub const TipReportDepositBase: Balance = DOLLARS; + pub const DataDepositPerByte: Balance = CENTS; pub const MaxApprovals: u32 = 100; pub const MaxAuthorities: u32 = 100_000; pub const MaxKeys: u32 = 10_000; @@ -902,7 +901,7 @@ impl pallet_treasury::Config for Runtime { } parameter_types! { - pub const BountyDepositBase: Balance = 1 * DOLLARS; + pub const BountyDepositBase: Balance = DOLLARS; pub const BountyDepositPayoutDelay: BlockNumber = 8 * DAYS; pub const BountyUpdatePeriod: BlockNumber = 90 * DAYS; pub const MaximumReasonLength: u32 = 16384; @@ -951,7 +950,7 @@ impl pallet_authority_discovery::Config for Runtime { parameter_types! { pub NposSolutionPriority: TransactionPriority = - Perbill::from_percent(90) * TransactionPriority::max_value(); + Perbill::from_percent(90) * TransactionPriority::MAX; } parameter_types! { @@ -1054,7 +1053,7 @@ impl claims::Config for Runtime { } parameter_types! { - pub const MinVestedTransfer: Balance = 1 * DOLLARS; + pub const MinVestedTransfer: Balance = DOLLARS; pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } @@ -1300,7 +1299,7 @@ impl parachains_inclusion::Config for Runtime { } parameter_types! { - pub const ParasUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); + pub const ParasUnsignedPriority: TransactionPriority = TransactionPriority::MAX; } impl parachains_paras::Config for Runtime { @@ -1543,7 +1542,7 @@ impl frame_support::traits::OnRuntimeUpgrade for InitiateNominationPools { parameter_types! { // The deposit configuration for the singed migration. Specially if you want to allow any signed account to do the migration (see `SignedFilter`, these deposits should be high) - pub const MigrationSignedDepositPerItem: Balance = 1 * CENTS; + pub const MigrationSignedDepositPerItem: Balance = CENTS; pub const MigrationSignedDepositBase: Balance = 20 * CENTS * 100; pub const MigrationMaxKeyLen: u32 = 512; } @@ -2721,10 +2720,9 @@ mod test_fees { use super::*; use frame_support::{dispatch::GetDispatchInfo, weights::WeightToFee as WeightToFeeT}; use keyring::Sr25519Keyring::{Alice, Charlie}; - use pallet_transaction_payment::Multiplier; use runtime_common::MinimumMultiplier; use separator::Separatable; - use sp_runtime::{assert_eq_error_rate, FixedPointNumber, MultiAddress, MultiSignature}; + use sp_runtime::{assert_eq_error_rate, MultiAddress, MultiSignature}; #[test] fn payout_weight_portion() { @@ -2937,7 +2935,7 @@ mod multiplier_tests { fn run_with_system_weight(w: Weight, mut assertions: F) where - F: FnMut() -> (), + F: FnMut(), { let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::::default() .build_storage() diff --git a/relay/polkadot/src/weights/xcm/mod.rs b/relay/polkadot/src/weights/xcm/mod.rs index 2aff001c59..aedf2704b5 100644 --- a/relay/polkadot/src/weights/xcm/mod.rs +++ b/relay/polkadot/src/weights/xcm/mod.rs @@ -18,7 +18,6 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; use crate::Runtime; -use frame_support::weights::Weight; use sp_std::prelude::*; use xcm::{latest::prelude::*, DoubleEncoded}; @@ -55,7 +54,7 @@ impl WeighAssets for AssetFilter { match self { Self::Definite(assets) => assets .inner() - .into_iter() + .iter() .map(From::from) .map(|t| match t { AssetTypes::Balances => balances_weight, @@ -75,8 +74,8 @@ impl WeighAssets for AssetFilter { impl WeighAssets for Assets { fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight { self.inner() - .into_iter() - .map(|m| >::from(m)) + .iter() + .map(>::from) .map(|t| match t { AssetTypes::Balances => balances_weight, AssetTypes::Unknown => Weight::MAX, diff --git a/relay/polkadot/src/xcm_config.rs b/relay/polkadot/src/xcm_config.rs index 93fc46e84b..678c8d18ea 100644 --- a/relay/polkadot/src/xcm_config.rs +++ b/relay/polkadot/src/xcm_config.rs @@ -24,7 +24,6 @@ use super::{ use frame_support::{ parameter_types, traits::{Contains, Equals, Everything, Nothing}, - weights::Weight, }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 258497ea71..1e4afc6a7d 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -859,7 +859,7 @@ impl pallet_nft_fractionalization::Config for Runtime { type Assets = Assets; type Nfts = Nfts; type PalletId = NftFractionalizationPalletId; - type WeightInfo = pallet_nft_fractionalization::weights::SubstrateWeight; + type WeightInfo = weights::pallet_nft_fractionalization::WeightInfo; type RuntimeHoldReason = RuntimeHoldReason; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); @@ -1723,7 +1723,6 @@ fn ensure_key_ss58() { #[cfg(test)] mod tests { use super::*; - use crate::{CENTS, MILLICENTS}; use sp_runtime::traits::Zero; use sp_weights::WeightToFee; use system_parachains_constants::kusama::fee; diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/xcm/mod.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/xcm/mod.rs index 7383a55a8f..d2866f2525 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/xcm/mod.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/xcm/mod.rs @@ -18,7 +18,6 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; -use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; use sp_std::prelude::*; diff --git a/system-parachains/asset-hubs/asset-hub-kusama/tests/snowbridge.rs b/system-parachains/asset-hubs/asset-hub-kusama/tests/snowbridge.rs index 0d8e946e83..756001a9aa 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/tests/snowbridge.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/tests/snowbridge.rs @@ -27,6 +27,7 @@ use xcm_builder::{ExporterFor, NetworkExportTable}; #[test] fn network_export_table_works() { sp_io::TestExternalities::default().execute_with(|| { + #[allow(clippy::type_complexity)] let test_data: Vec<(NetworkId, InteriorLocation, Option<(Location, Option)>)> = vec![ // From Ethereum (from GlobalConsensus(Ethereum) is routed to BridgeHub, with a fee, // matched. @@ -34,7 +35,7 @@ fn network_export_table_works() { EthereumNetwork::get(), Junctions::Here, Some(( - SiblingBridgeHub::get().into(), + SiblingBridgeHub::get(), Some(Asset { id: XcmBridgeHubRouterFeeAssetId::get(), fun: Fungible(BridgeHubEthereumBaseFee::get()), diff --git a/system-parachains/asset-hubs/asset-hub-kusama/tests/weight_trader.rs b/system-parachains/asset-hubs/asset-hub-kusama/tests/weight_trader.rs index 2bc64b545f..d6fefa1f27 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/tests/weight_trader.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/tests/weight_trader.rs @@ -30,7 +30,7 @@ use frame_support::{ fungible::{Inspect, Mutate}, fungibles::{Create, Inspect as FungiblesInspect, Mutate as FungiblesMutate}, }, - weights::{Weight, WeightToFee as WeightToFeeT}, + weights::WeightToFee as WeightToFeeT, }; use asset_hub_kusama_runtime::{ diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 8fa2d744a4..d0bdc2edb1 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -1680,7 +1680,6 @@ cumulus_pallet_parachain_system::register_validate_block! { #[cfg(test)] mod tests { use super::*; - use crate::{CENTS, MILLICENTS}; use sp_runtime::traits::Zero; use sp_weights::WeightToFee; use system_parachains_constants::polkadot::fee; diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/xcm/mod.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/xcm/mod.rs index 563135f9b8..2864aa093d 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/xcm/mod.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/xcm/mod.rs @@ -18,7 +18,6 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; -use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; use sp_std::prelude::*; diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/tests/snowbridge.rs b/system-parachains/asset-hubs/asset-hub-polkadot/tests/snowbridge.rs index 77f7054726..05dff0bc97 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/tests/snowbridge.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/tests/snowbridge.rs @@ -27,6 +27,7 @@ use xcm_builder::{ExporterFor, NetworkExportTable}; #[test] fn network_export_table_works() { sp_io::TestExternalities::default().execute_with(|| { + #[allow(clippy::type_complexity)] let test_data: Vec<(NetworkId, InteriorLocation, Option<(Location, Option)>)> = vec![ // From Ethereum (from GlobalConsensus(Ethereum) is routed to BridgeHub, with a fee, // matched. @@ -34,7 +35,7 @@ fn network_export_table_works() { EthereumNetwork::get(), Junctions::Here, Some(( - SiblingBridgeHub::get().into(), + SiblingBridgeHub::get(), Some(Asset { id: XcmBridgeHubRouterFeeAssetId::get(), fun: Fungible(BridgeHubEthereumBaseFee::get()), diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/tests/weight_trader.rs b/system-parachains/asset-hubs/asset-hub-polkadot/tests/weight_trader.rs index e29fb78d63..a7732b0812 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/tests/weight_trader.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/tests/weight_trader.rs @@ -32,7 +32,7 @@ use frame_support::{ fungible::{Inspect, Mutate}, fungibles::{Create, Inspect as FungiblesInspect, Mutate as FungiblesMutate}, }, - weights::{Weight, WeightToFee as WeightToFeeT}, + weights::WeightToFee as WeightToFeeT, }; use parachains_common::{AccountId, AssetHubPolkadotAuraId as AuraId}; use sp_runtime::traits::MaybeEquivalence; diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs index bcce5bd144..cfcb735c53 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs @@ -41,14 +41,10 @@ use bridge_runtime_common::{ RefundableMessagesLane, RefundableParachain, }, }; -use cumulus_primitives_core::ParentThen; use frame_support::{parameter_types, traits::PalletInfoAccess}; use kusama_runtime_constants as constants; use sp_runtime::{traits::ConstU32, RuntimeDebug}; -use xcm::{ - latest::prelude::*, - prelude::{InteriorLocation, NetworkId}, -}; +use xcm::latest::prelude::*; use xcm_builder::BridgeBlobDispatcher; /// Lane identifier, used to connect Kusama Asset Hub and Polkadot Asset Hub. diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs index 9d9afd530d..a3ee2c451e 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs @@ -19,7 +19,6 @@ mod pallet_xcm_benchmarks_generic; use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; use codec::Encode; -use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; use sp_std::prelude::*; diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs index 594bf05f85..5859943f36 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs @@ -249,7 +249,7 @@ pub fn send_transfer_token_message_failure( exchange_rate: FixedU128::from_rational(1, 75), fee_per_gas: gwei(20), rewards: Rewards { - local: (1 * UNITS / 100).into(), // 0.01 KSM + local: (UNITS / 100).into(), // 0.01 KSM remote: meth(1), }, multiplier: FixedU128::from_rational(1, 1), diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs index b53da25e62..68480a4219 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs @@ -41,14 +41,10 @@ use bridge_runtime_common::{ RefundableMessagesLane, RefundableParachain, }, }; -use cumulus_primitives_core::ParentThen; use frame_support::{parameter_types, traits::PalletInfoAccess}; use polkadot_runtime_constants as constants; use sp_runtime::{traits::ConstU32, RuntimeDebug}; -use xcm::{ - latest::prelude::*, - prelude::{InteriorLocation, NetworkId}, -}; +use xcm::latest::prelude::*; use xcm_builder::BridgeBlobDispatcher; /// Lane identifier, used to connect Polkadot Asset Hub and Kusama Asset Hub. diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs index b577150e77..8f60b012ee 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs @@ -19,7 +19,6 @@ mod pallet_xcm_benchmarks_generic; use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; use codec::Encode; -use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; use sp_std::prelude::*; diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs index bde909648e..b0ac089a43 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs @@ -249,7 +249,7 @@ pub fn send_transfer_token_message_failure( exchange_rate: FixedU128::from_rational(1, 75), fee_per_gas: gwei(20), rewards: Rewards { - local: (1 * UNITS / 100).into(), // 0.01 DOT + local: (UNITS / 100).into(), // 0.01 DOT remote: meth(1), }, multiplier: FixedU128::from_rational(1, 1), diff --git a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs index 0f1c5fd815..8a702b9c23 100644 --- a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -26,7 +26,6 @@ use crate::{ ParachainInfo, PolkadotTreasuryAccount, Preimage, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, DAYS, FELLOWSHIP_TREASURY_PALLET_ID, }; -use cumulus_primitives_core::Junction::GeneralIndex; use frame_support::{ parameter_types, traits::{ @@ -50,7 +49,6 @@ use polkadot_runtime_constants::{ use sp_arithmetic::Permill; use sp_core::{ConstU128, ConstU32}; use sp_runtime::traits::{ConstU16, ConvertToValue, IdentityLookup, Replace, TakeFirst}; -use xcm::latest::BodyId; use xcm_builder::{AliasesIntoAccountId32, LocatableAssetId, PayOverXcm}; #[cfg(feature = "runtime-benchmarks")] @@ -269,7 +267,7 @@ parameter_types! { pub const FellowshipTreasuryPalletId: PalletId = FELLOWSHIP_TREASURY_PALLET_ID; pub const ProposalBond: Permill = Permill::from_percent(100); pub const Burn: Permill = Permill::from_percent(0); - pub const MaxBalance: Balance = Balance::max_value(); + pub const MaxBalance: Balance = Balance::MAX; // The asset's interior location for the paying account. This is the Fellowship Treasury // pallet instance. pub FellowshipTreasuryInteriorLocation: InteriorLocation = diff --git a/system-parachains/collectives/collectives-polkadot/src/fellowship/tracks.rs b/system-parachains/collectives/collectives-polkadot/src/fellowship/tracks.rs index f4ba4e05ec..f6ef2166a4 100644 --- a/system-parachains/collectives/collectives-polkadot/src/fellowship/tracks.rs +++ b/system-parachains/collectives/collectives-polkadot/src/fellowship/tracks.rs @@ -71,7 +71,7 @@ impl Convert for MinRankOfClass { // A promotion vote; the track ID turns out to be 18 more than the minimum required // rank. promotion @ 21..=26 => promotion - 18, - _ => Rank::max_value(), + _ => Rank::MAX, } } } @@ -80,7 +80,7 @@ const RETAIN_MAX_DECIDING: u32 = 25; const RETAIN_DECISION_DEPOSIT: Balance = 5 * DOLLARS; const RETAIN_PREPARE_PERIOD: BlockNumber = 0; const RETAIN_DECISION_PERIOD: BlockNumber = 14 * DAYS; -const RETAIN_CONFIRM_PERIOD: BlockNumber = 1 * HOURS; +const RETAIN_CONFIRM_PERIOD: BlockNumber = HOURS; const RETAIN_MIN_ENACTMENT_PERIOD: BlockNumber = 0; const RETAIN_MIN_APPROVAL: pallet_referenda::Curve = pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), @@ -97,7 +97,7 @@ const PROMOTE_MAX_DECIDING: u32 = 10; const PROMOTE_DECISION_DEPOSIT: Balance = 5 * DOLLARS; const PROMOTE_PREPARE_PERIOD: BlockNumber = 0; const PROMOTE_DECISION_PERIOD: BlockNumber = 30 * DAYS; -const PROMOTE_CONFIRM_PERIOD: BlockNumber = 1 * HOURS; +const PROMOTE_CONFIRM_PERIOD: BlockNumber = HOURS; const PROMOTE_MIN_ENACTMENT_PERIOD: BlockNumber = 0; const PROMOTE_MIN_APPROVAL: pallet_referenda::Curve = pallet_referenda::Curve::LinearDecreasing { length: Perbill::from_percent(100), diff --git a/system-parachains/collectives/collectives-polkadot/src/impls.rs b/system-parachains/collectives/collectives-polkadot/src/impls.rs index 02086c0adb..77215cbc26 100644 --- a/system-parachains/collectives/collectives-polkadot/src/impls.rs +++ b/system-parachains/collectives/collectives-polkadot/src/impls.rs @@ -14,22 +14,18 @@ // limitations under the License. use super::*; -use crate::OriginCaller; use frame_support::{ dispatch::DispatchResultWithPostInfo, traits::{ tokens::ConversionFromAssetBalance, Contains, Currency, Get, Imbalance, OnUnbalanced, OriginTrait, PrivilegeCmp, }, - weights::Weight, }; -use log; use pallet_alliance::{ProposalIndex, ProposalProvider}; use parachains_common::impls::NegativeImbalance; use polkadot_parachain_primitives::primitives::{Id as ParaId, IsSystem}; use sp_runtime::DispatchError; use sp_std::{cmp::Ordering, marker::PhantomData, prelude::*}; -use xcm::latest::{Fungibility, Junction, Junctions::Here, Location, Parent, WeightLimit}; use xcm_executor::traits::ConvertLocation; type AccountIdOf = ::AccountId; diff --git a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs index e49e41121e..f61112defa 100644 --- a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs +++ b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs @@ -21,7 +21,6 @@ use super::{ use frame_support::{ parameter_types, traits::{ConstU32, Contains, Equals, Everything, Nothing}, - weights::Weight, }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; diff --git a/system-parachains/coretime/coretime-kusama/src/coretime.rs b/system-parachains/coretime/coretime-kusama/src/coretime.rs index 8ba44741f5..1bc3487b43 100644 --- a/system-parachains/coretime/coretime-kusama/src/coretime.rs +++ b/system-parachains/coretime/coretime-kusama/src/coretime.rs @@ -28,7 +28,6 @@ use frame_support::{ use pallet_broker::{ AdaptPrice, CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600, RCBlockNumberOf, }; -use parachains_common::{AccountId, Balance, BlockNumber}; use sp_runtime::{ traits::{AccountIdConversion, One, Saturating}, FixedU64, diff --git a/system-parachains/coretime/coretime-kusama/src/weights/xcm/mod.rs b/system-parachains/coretime/coretime-kusama/src/weights/xcm/mod.rs index 1cf30c053d..b12d688d38 100644 --- a/system-parachains/coretime/coretime-kusama/src/weights/xcm/mod.rs +++ b/system-parachains/coretime/coretime-kusama/src/weights/xcm/mod.rs @@ -18,7 +18,6 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; -use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; use sp_std::prelude::*; diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index 217fcac6fd..fd4b534e62 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -345,7 +345,7 @@ pub struct NoConversion; impl ConversionFromAssetBalance for NoConversion { type Error = (); fn from_asset_balance(balance: Balance, _asset_id: ()) -> Result { - return Ok(balance) + Ok(balance) } #[cfg(feature = "runtime-benchmarks")] fn ensure_successful(_: ()) {} @@ -1296,7 +1296,7 @@ mod system_parachains_constants { use polkadot_primitives::Balance; /// The existential deposit. - pub const EXISTENTIAL_DEPOSIT: Balance = 1 * CENTS; + pub const EXISTENTIAL_DEPOSIT: Balance = CENTS; pub const UNITS: Balance = 1_000_000_000_000; pub const QUID: Balance = UNITS / 30; diff --git a/system-parachains/encointer/src/migrations_fix.rs b/system-parachains/encointer/src/migrations_fix.rs index 0493d57bb5..f5992de5a1 100644 --- a/system-parachains/encointer/src/migrations_fix.rs +++ b/system-parachains/encointer/src/migrations_fix.rs @@ -24,7 +24,7 @@ pub mod balances { use sp_runtime::TryRuntimeError; /// The log target. - const TARGET: &'static str = "runtime::fix::balances::migration"; + const TARGET: &str = "runtime::fix::balances::migration"; pub mod v1 { use super::*; use frame_support::pallet_prelude::*; @@ -72,7 +72,7 @@ pub mod scheduler { use sp_runtime::TryRuntimeError; /// The log target. - const TARGET: &'static str = "runtime::fix::scheduler::migration"; + const TARGET: &str = "runtime::fix::scheduler::migration"; pub mod v1 { use super::*; @@ -144,6 +144,7 @@ pub mod scheduler { StorageMap, Twox64Concat, TaskName, TaskAddress>>; /// Migrate the scheduler pallet from V0 to V4 by brute-force emptying the agenda. + #[allow(dead_code)] pub struct MigrateToV4(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV4 { diff --git a/system-parachains/encointer/src/xcm_config.rs b/system-parachains/encointer/src/xcm_config.rs index a53c78d047..6639eecfb3 100644 --- a/system-parachains/encointer/src/xcm_config.rs +++ b/system-parachains/encointer/src/xcm_config.rs @@ -22,7 +22,6 @@ use super::{ use frame_support::{ parameter_types, traits::{Contains, Everything, Nothing}, - weights::Weight, }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; diff --git a/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs b/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs index d79f1b98a5..0c7f2cac18 100644 --- a/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs +++ b/system-parachains/gluttons/glutton-kusama/src/xcm_config.rs @@ -20,7 +20,6 @@ use super::{ use frame_support::{ match_types, parameter_types, traits::{Everything, Nothing}, - weights::Weight, }; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/system-parachains/people/people-kusama/src/people.rs b/system-parachains/people/people-kusama/src/people.rs index cfcb76a05f..5f260c9a3d 100644 --- a/system-parachains/people/people-kusama/src/people.rs +++ b/system-parachains/people/people-kusama/src/people.rs @@ -18,8 +18,7 @@ use crate::xcm_config::LocationToAccountId; use codec::{Decode, Encode, MaxEncodedLen}; use enumflags2::{bitflags, BitFlags}; use frame_support::{ - parameter_types, traits::ConstU32, CloneNoBound, EqNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + parameter_types, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; use pallet_identity::{Data, IdentityInformationProvider}; use parachains_common::{impls::ToParentTreasury, DAYS}; diff --git a/system-parachains/people/people-kusama/src/weights/xcm/mod.rs b/system-parachains/people/people-kusama/src/weights/xcm/mod.rs index 23e9ca6829..37ea90fa3b 100644 --- a/system-parachains/people/people-kusama/src/weights/xcm/mod.rs +++ b/system-parachains/people/people-kusama/src/weights/xcm/mod.rs @@ -17,7 +17,6 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; -use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; use sp_std::prelude::*; From 67af9b90c99041f871d7f184aa1e38b0a8c90e37 Mon Sep 17 00:00:00 2001 From: Adrian Catangiu Date: Fri, 17 May 2024 14:35:33 +0300 Subject: [PATCH 08/15] Add pallet-xcm::transfer_assets_using_type_and_then() for complex asset transfers (#311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump `pallet-xcm` to 8.0.5 to include `transfer_assets_using_type_and_then()` call to facilitate moving bridged assets around the ecosystem. Example [test for bridged asset AssetHub->Parachain](https://github.com/paritytech/polkadot-sdk/blob/e0584a153df63ff138d12764085422ed06de548a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/hybrid_transfers.rs#L150C1-L156C54) - the actual call used [here](https://github.com/paritytech/polkadot-sdk/blob/e0584a153df63ff138d12764085422ed06de548a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/hybrid_transfers.rs#L57C1-L70C3). Example [test for bridged asset Parachain->AssetHub](https://github.com/paritytech/polkadot-sdk/blob/e0584a153df63ff138d12764085422ed06de548a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/hybrid_transfers.rs#L278C1-L285C54) - the actual call used [here](https://github.com/paritytech/polkadot-sdk/blob/e0584a153df63ff138d12764085422ed06de548a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/hybrid_transfers.rs#L76C2-L89C3). More details on the backported call available here: https://github.com/paritytech/polkadot-sdk/pull/4462 Fixes #281 --------- Signed-off-by: Adrian Catangiu Co-authored-by: Branislav Kontur Co-authored-by: Bastian Köcher --- CHANGELOG.md | 1 + Cargo.lock | 8 ++++---- Cargo.toml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db032c4027..fad68b5c5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269)) - Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) +- Add `pallet-xcm::transfer_assets_using_type_and_then()` for complex asset transfers ([polkadot-fellows/runtimes#311](https://github.com/polkadot-fellows/runtimes/pull/311)) ### Removed diff --git a/Cargo.lock b/Cargo.lock index ef1ade44eb..4cd32aa1d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8426,9 +8426,9 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "8.0.4" +version = "8.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13f5c598737e84294880333170d1df3868a11ad7ee79d0b1d1af37365e1c277" +checksum = "ba9138b04168b07b1aff4a2079f5514753c31dddba40e5fb471b9cda7da27ad6" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -14395,9 +14395,9 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "8.0.1" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a638f4c8735cc04b5c93920a1f59e679f48b131315a07d146798e0decebf7720" +checksum = "74b5c5f2a1d610c5e20e5fae2680c9a28380f305afafeed62f341bfbce57b79a" dependencies = [ "environmental", "frame-benchmarking", diff --git a/Cargo.toml b/Cargo.toml index 902f741c2d..e8b5a48b0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -129,7 +129,7 @@ pallet-uniques = { version = "29.0.0", default-features = false } pallet-utility = { version = "29.0.0", default-features = false } pallet-vesting = { version = "29.0.0", default-features = false } pallet-whitelist = { version = "28.0.0", default-features = false } -pallet-xcm = { version = "8.0.4", default-features = false } +pallet-xcm = { version = "8.0.5", default-features = false } pallet-xcm-benchmarks = { version = "8.0.2", default-features = false } pallet-xcm-bridge-hub = { version = "0.3.0", default-features = false } pallet-xcm-bridge-hub-router = { version = "0.6.0", default-features = false } @@ -192,7 +192,7 @@ sp-weights = { version = "28.0.0", default-features = false } staging-parachain-info = { version = "0.8.0", default-features = false } staging-xcm = { version = "8.0.1", default-features = false } staging-xcm-builder = { version = "8.0.1", default-features = false } -staging-xcm-executor = { version = "8.0.1", default-features = false } +staging-xcm-executor = { version = "8.0.2", default-features = false } static_assertions = { version = "1.1.0" } substrate-wasm-builder = { version = "18.0.0" } tokio = { version = "1.36.0" } From c2886b940944ba96c87b6e07954e0d945b9a67bd Mon Sep 17 00:00:00 2001 From: Muharem Date: Fri, 17 May 2024 15:24:59 +0200 Subject: [PATCH 09/15] Collectives tests: Teleports and Whitelist Call (#251) Introduce teleport and whitelist call tests for Polkadot Collectives. Based on https://github.com/polkadot-fellows/runtimes/pull/233 - [x] Does not require a CHANGELOG entry --------- Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: Branislav Kontur --- Cargo.lock | 1 + integration-tests/emulated/helpers/src/lib.rs | 180 +++++++++++++++++- .../tests/assets/asset-hub-kusama/src/lib.rs | 2 +- .../asset-hub-kusama/src/tests/teleport.rs | 2 +- .../assets/asset-hub-polkadot/src/lib.rs | 2 +- .../asset-hub-polkadot/src/tests/teleport.rs | 2 +- .../bridges/bridge-hub-kusama/src/lib.rs | 2 +- .../bridge-hub-kusama/src/tests/teleport.rs | 2 +- .../bridges/bridge-hub-polkadot/src/lib.rs | 2 +- .../bridge-hub-polkadot/src/tests/teleport.rs | 2 +- .../collectives-polkadot/Cargo.toml | 1 + .../collectives-polkadot/src/lib.rs | 20 +- .../src/tests/fellowship.rs | 72 +++++++ .../collectives-polkadot/src/tests/mod.rs | 2 + .../src/tests/teleport.rs | 70 +++++++ .../tests/people/people-kusama/src/lib.rs | 1 - 16 files changed, 348 insertions(+), 15 deletions(-) create mode 100644 integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs create mode 100644 integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/teleport.rs diff --git a/Cargo.lock b/Cargo.lock index 4cd32aa1d8..2b5dec6ee9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2255,6 +2255,7 @@ dependencies = [ "pallet-message-queue", "pallet-treasury", "pallet-utility", + "pallet-whitelist", "pallet-xcm", "parachains-common", "parity-scale-codec", diff --git a/integration-tests/emulated/helpers/src/lib.rs b/integration-tests/emulated/helpers/src/lib.rs index c761854512..09f7c99fdd 100644 --- a/integration-tests/emulated/helpers/src/lib.rs +++ b/integration-tests/emulated/helpers/src/lib.rs @@ -31,7 +31,7 @@ pub use xcm_emulator::Chain; /// TODO: when bumping to polkadot-sdk v1.8.0, /// remove this crate altogether and get the macros from `emulated-integration-tests-common`. #[macro_export] -macro_rules! test_parachain_is_trusted_teleporter { +macro_rules! test_sibling_is_trusted_teleporter { ( $sender_para:ty, $sender_xcm_config:ty, vec![$( $receiver_para:ty ),+], ($assets:expr, $amount:expr) ) => { $crate::paste::paste! { // init Origin variables @@ -123,6 +123,184 @@ macro_rules! test_parachain_is_trusted_teleporter { }; } +#[macro_export] +macro_rules! test_relay_is_trusted_teleporter { + ( $sender_relay:ty, $sender_xcm_config:ty, vec![$( $receiver_para:ty ),+], ($assets:expr, $amount:expr) ) => { + $crate::paste::paste! { + // init Origin variables + let sender = [<$sender_relay Sender>]::get(); + let mut relay_sender_balance_before = + <$sender_relay as $crate::Chain>::account_data_of(sender.clone()).free; + let origin = <$sender_relay as $crate::Chain>::RuntimeOrigin::signed(sender.clone()); + let fee_asset_item = 0; + let weight_limit = $crate::WeightLimit::Unlimited; + + $( + { + // init Destination variables + let receiver = [<$receiver_para Receiver>]::get(); + let para_receiver_balance_before = + <$receiver_para as $crate::Chain>::account_data_of(receiver.clone()).free; + let para_destination = + <$sender_relay>::child_location_of(<$receiver_para>::para_id()); + let beneficiary: Location = + $crate::AccountId32 { network: None, id: receiver.clone().into() }.into(); + + // Send XCM message from Relay + <$sender_relay>::execute_with(|| { + assert_ok!(<$sender_relay as [<$sender_relay Pallet>]>::XcmPallet::limited_teleport_assets( + origin.clone(), + bx!(para_destination.clone().into()), + bx!(beneficiary.clone().into()), + bx!($assets.clone().into()), + fee_asset_item, + weight_limit.clone(), + )); + + type RuntimeEvent = <$sender_relay as $crate::Chain>::RuntimeEvent; + + assert_expected_events!( + $sender_relay, + vec![ + RuntimeEvent::XcmPallet( + $crate::pallet_xcm::Event::Attempted { outcome: Outcome::Complete { .. } } + ) => {}, + RuntimeEvent::Balances( + $crate::pallet_balances::Event::Burned { who: sender, amount } + ) => {}, + RuntimeEvent::XcmPallet( + $crate::pallet_xcm::Event::Sent { .. } + ) => {}, + ] + ); + }); + + // Receive XCM message in Destination Parachain + <$receiver_para>::execute_with(|| { + type RuntimeEvent = <$receiver_para as $crate::Chain>::RuntimeEvent; + + assert_expected_events!( + $receiver_para, + vec![ + RuntimeEvent::Balances( + $crate::pallet_balances::Event::Minted { who: receiver, .. } + ) => {}, + RuntimeEvent::MessageQueue( + $crate::pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + }); + + // Check if balances are updated accordingly in Origin and Parachain + let relay_sender_balance_after = + <$sender_relay as $crate::Chain>::account_data_of(sender.clone()).free; + let para_receiver_balance_after = + <$receiver_para as $crate::Chain>::account_data_of(receiver.clone()).free; + let delivery_fees = <$sender_relay>::execute_with(|| { + $crate::asset_test_utils::xcm_helpers::transfer_assets_delivery_fees::< + <$sender_xcm_config as xcm_executor::Config>::XcmSender, + >($assets.clone(), fee_asset_item, weight_limit.clone(), beneficiary, para_destination) + }); + + assert_eq!(relay_sender_balance_before - $amount - delivery_fees, relay_sender_balance_after); + assert!(para_receiver_balance_after > para_receiver_balance_before); + + // Update sender balance + relay_sender_balance_before = <$sender_relay as $crate::Chain>::account_data_of(sender.clone()).free; + } + )+ + } + }; +} + +#[macro_export] +macro_rules! test_parachain_is_trusted_teleporter { + ( $sender_para:ty, $sender_xcm_config:ty, $receiver_relay:ty, $amount:expr ) => { + $crate::paste::paste! { + // init Origin variables + let sender = [<$sender_para Sender>]::get(); + let mut para_sender_balance_before = + <$sender_para as $crate::Chain>::account_data_of(sender.clone()).free; + let origin = <$sender_para as $crate::Chain>::RuntimeOrigin::signed(sender.clone()); + let assets: Assets = (Parent, $amount).into(); + let fee_asset_item = 0; + let weight_limit = $crate::WeightLimit::Unlimited; + + // init Destination variables + let receiver = [<$receiver_relay Receiver>]::get(); + let relay_receiver_balance_before = + <$receiver_relay as $crate::Chain>::account_data_of(receiver.clone()).free; + let relay_destination: Location = Parent.into(); + let beneficiary: Location = + $crate::AccountId32 { network: None, id: receiver.clone().into() }.into(); + + // Send XCM message from Parachain + <$sender_para>::execute_with(|| { + assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::limited_teleport_assets( + origin.clone(), + bx!(relay_destination.clone().into()), + bx!(beneficiary.clone().into()), + bx!(assets.clone().into()), + fee_asset_item, + weight_limit.clone(), + )); + + type RuntimeEvent = <$sender_para as $crate::Chain>::RuntimeEvent; + + assert_expected_events!( + $sender_para, + vec![ + RuntimeEvent::PolkadotXcm( + $crate::pallet_xcm::Event::Attempted { outcome: Outcome::Complete { .. } } + ) => {}, + RuntimeEvent::Balances( + $crate::pallet_balances::Event::Burned { who: sender, amount } + ) => {}, + RuntimeEvent::PolkadotXcm( + $crate::pallet_xcm::Event::Sent { .. } + ) => {}, + ] + ); + }); + + // Receive XCM message in Destination Parachain + <$receiver_relay>::execute_with(|| { + type RuntimeEvent = <$receiver_relay as $crate::Chain>::RuntimeEvent; + + assert_expected_events!( + $receiver_relay, + vec![ + RuntimeEvent::Balances( + $crate::pallet_balances::Event::Minted { who: receiver, .. } + ) => {}, + RuntimeEvent::MessageQueue( + $crate::pallet_message_queue::Event::Processed { success: true, .. } + ) => {}, + ] + ); + }); + + // Check if balances are updated accordingly in Origin and Relay Chain + let para_sender_balance_after = + <$sender_para as $crate::Chain>::account_data_of(sender.clone()).free; + let relay_receiver_balance_after = + <$receiver_relay as $crate::Chain>::account_data_of(receiver.clone()).free; + let delivery_fees = <$sender_para>::execute_with(|| { + $crate::asset_test_utils::xcm_helpers::transfer_assets_delivery_fees::< + <$sender_xcm_config as xcm_executor::Config>::XcmSender, + >(assets, fee_asset_item, weight_limit.clone(), beneficiary, relay_destination) + }); + + assert_eq!(para_sender_balance_before - $amount - delivery_fees, para_sender_balance_after); + assert!(relay_receiver_balance_after > relay_receiver_balance_before); + + // Update sender balance + para_sender_balance_before = <$sender_para as $crate::Chain>::account_data_of(sender.clone()).free; + } + }; +} + #[macro_export] macro_rules! test_chain_can_claim_assets { ( $sender_para:ty, $runtime_call:ty, $network_id:expr, $assets:expr, $amount:expr ) => { diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs index f966578a45..d738a7ab8b 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs @@ -39,7 +39,7 @@ pub use emulated_integration_tests_common::{ xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }; -pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use integration_tests_helpers::test_sibling_is_trusted_teleporter; pub use kusama_system_emulated_network::{ asset_hub_kusama_emulated_chain::{ genesis::ED as ASSET_HUB_KUSAMA_ED, AssetHubKusamaParaPallet as AssetHubKusamaPallet, diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs index a6b9c68e81..540c25d376 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs @@ -546,7 +546,7 @@ fn teleport_to_other_system_parachains_works() { let amount = ASSET_HUB_KUSAMA_ED * 100; let native_asset: Assets = (Parent, amount).into(); - test_parachain_is_trusted_teleporter!( + test_sibling_is_trusted_teleporter!( AssetHubKusama, // Origin AssetHubKusamaXcmConfig, // XCM Configuration vec![BridgeHubKusama], // Destinations diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/lib.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/lib.rs index bb345904d3..786d0b15f4 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/lib.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/lib.rs @@ -41,7 +41,7 @@ pub use emulated_integration_tests_common::{ xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }; -pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use integration_tests_helpers::test_sibling_is_trusted_teleporter; pub use parachains_common::{AccountId, Balance}; pub use polkadot_system_emulated_network::{ asset_hub_polkadot_emulated_chain::{ diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs index 65b25f13bc..8d1462e44f 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs @@ -546,7 +546,7 @@ fn teleport_to_other_system_parachains_works() { let amount = ASSET_HUB_POLKADOT_ED * 100; let native_asset: Assets = (Parent, amount).into(); - test_parachain_is_trusted_teleporter!( + test_sibling_is_trusted_teleporter!( AssetHubPolkadot, // Origin AssetHubPolkadotXcmConfig, // XCM Configuration vec![BridgeHubPolkadot], // Destinations diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/lib.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/lib.rs index 101d2c2b5f..80351d89ff 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/lib.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/lib.rs @@ -41,7 +41,7 @@ pub use emulated_integration_tests_common::{ xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }; -pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use integration_tests_helpers::test_sibling_is_trusted_teleporter; pub use kusama_polkadot_system_emulated_network::{ asset_hub_kusama_emulated_chain::{ genesis::ED as ASSET_HUB_KUSAMA_ED, AssetHubKusamaParaPallet as AssetHubKusamaPallet, diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/teleport.rs index c1aebaabfc..9c17aa2108 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/teleport.rs @@ -21,7 +21,7 @@ fn teleport_to_other_system_parachains_works() { let amount = BRIDGE_HUB_KUSAMA_ED * 100; let native_asset: Assets = (Parent, amount).into(); - test_parachain_is_trusted_teleporter!( + test_sibling_is_trusted_teleporter!( BridgeHubKusama, // Origin XcmConfig, // XCM configuration vec![AssetHubKusama], // Destinations diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs index 4dec6f9570..febcff3c6c 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/lib.rs @@ -41,7 +41,7 @@ pub use emulated_integration_tests_common::{ xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }; -pub use integration_tests_helpers::test_parachain_is_trusted_teleporter; +pub use integration_tests_helpers::test_sibling_is_trusted_teleporter; pub use kusama_polkadot_system_emulated_network::{ asset_hub_kusama_emulated_chain::{ genesis::ED as ASSET_HUB_KUSAMA_ED, AssetHubKusamaParaPallet as AssetHubKusamaPallet, diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/teleport.rs index 62ada3debc..4938576210 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/teleport.rs @@ -21,7 +21,7 @@ fn teleport_to_other_system_parachains_works() { let amount = BRIDGE_HUB_POLKADOT_ED * 100; let native_asset: Assets = (Parent, amount).into(); - test_parachain_is_trusted_teleporter!( + test_sibling_is_trusted_teleporter!( BridgeHubPolkadot, // Origin XcmConfig, // XCM configuration vec![AssetHubPolkadot], // Destinations diff --git a/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml b/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml index 4f72f1c4ae..5ad4da3221 100644 --- a/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml @@ -21,6 +21,7 @@ pallet-assets = { workspace = true, default-features = true } pallet-treasury = { workspace = true, default-features = true } pallet-message-queue = { workspace = true, default-features = true } pallet-utility = { workspace = true, default-features = true } +pallet-whitelist = { workspace = true, default-features = true } # Polkadot polkadot-runtime-common = { workspace = true, default-features = true } diff --git a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/lib.rs b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/lib.rs index d42039ccc4..a2d6d55926 100644 --- a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/lib.rs +++ b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/lib.rs @@ -22,11 +22,21 @@ pub use emulated_integration_tests_common::{ xcm_emulator::{assert_expected_events, bx, Chain, Parachain, RelayChain as Relay, TestExt}, }; pub use polkadot_system_emulated_network::{ - asset_hub_polkadot_emulated_chain::AssetHubPolkadotParaPallet as AssetHubPolkadotPallet, - collectives_polkadot_emulated_chain::CollectivesPolkadotParaPallet as CollectivesPolkadotPallet, - polkadot_emulated_chain::PolkadotRelayPallet as PolkadotPallet, - AssetHubPolkadotPara as AssetHubPolkadot, CollectivesPolkadotPara as CollectivesPolkadot, - PolkadotRelay as Polkadot, + asset_hub_polkadot_emulated_chain::{ + genesis::ED as ASSET_HUB_POLKADOT_ED, AssetHubPolkadotParaPallet as AssetHubPolkadotPallet, + }, + collectives_polkadot_emulated_chain::{ + genesis::ED as COLLECTIVES_POLKADOT_ED, + CollectivesPolkadotParaPallet as CollectivesPolkadotPallet, + }, + polkadot_emulated_chain::{genesis::ED as POLKADOT_ED, PolkadotRelayPallet as PolkadotPallet}, + AssetHubPolkadotPara as AssetHubPolkadot, + AssetHubPolkadotParaReceiver as AssetHubPolkadotReceiver, + AssetHubPolkadotParaSender as AssetHubPolkadotSender, + CollectivesPolkadotPara as CollectivesPolkadot, + CollectivesPolkadotParaReceiver as CollectivesPolkadotReceiver, + CollectivesPolkadotParaSender as CollectivesPolkadotSender, PolkadotRelay as Polkadot, + PolkadotRelayReceiver as PolkadotReceiver, PolkadotRelaySender as PolkadotSender, }; #[cfg(test)] diff --git a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs new file mode 100644 index 0000000000..c7664de0a6 --- /dev/null +++ b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/fellowship.rs @@ -0,0 +1,72 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; +use codec::Encode; +use collectives_polkadot_runtime::fellowship::pallet_fellowship_origins::Origin::Fellows as FellowsOrigin; +use frame_support::{assert_ok, sp_runtime::traits::Dispatchable}; + +#[test] +fn fellows_whitelist_call() { + CollectivesPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + type RuntimeCall = ::RuntimeCall; + type RuntimeOrigin = ::RuntimeOrigin; + type Runtime = ::Runtime; + type PolkadotCall = ::RuntimeCall; + type PolkadotRuntime = ::Runtime; + + let call_hash = [1u8; 32].into(); + + let whitelist_call = RuntimeCall::PolkadotXcm(pallet_xcm::Call::::send { + dest: bx!(VersionedLocation::V4(Parent.into())), + message: bx!(VersionedXcm::V4(Xcm(vec![ + UnpaidExecution { weight_limit: Unlimited, check_origin: None }, + Transact { + origin_kind: OriginKind::Xcm, + require_weight_at_most: Weight::from_parts(5_000_000_000, 500_000), + call: PolkadotCall::Whitelist( + pallet_whitelist::Call::::whitelist_call { call_hash } + ) + .encode() + .into(), + } + ]))), + }); + + let fellows_origin: RuntimeOrigin = FellowsOrigin.into(); + + assert_ok!(whitelist_call.dispatch(fellows_origin)); + + assert_expected_events!( + CollectivesPolkadot, + vec![ + RuntimeEvent::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {}, + ] + ); + }); + + Polkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + + assert_expected_events!( + Polkadot, + vec![ + RuntimeEvent::Whitelist(pallet_whitelist::Event::CallWhitelisted { .. }) => {}, + RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true, .. }) => {}, + ] + ); + }); +} diff --git a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/mod.rs index 63173eaf94..ef4e488518 100644 --- a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/mod.rs @@ -13,5 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +mod fellowship; mod fellowship_salary; mod fellowship_treasury; +mod teleport; diff --git a/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/teleport.rs new file mode 100644 index 0000000000..7d2b7a627e --- /dev/null +++ b/integration-tests/emulated/tests/collectives/collectives-polkadot/src/tests/teleport.rs @@ -0,0 +1,70 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; +use asset_hub_polkadot_runtime::xcm_config::XcmConfig as AssetHubPolkadotXcmConfig; +use collectives_polkadot_runtime::xcm_config::XcmConfig as CollectivesPolkadotXcmConfig; +use frame_support::assert_ok; +use integration_tests_helpers::{ + test_parachain_is_trusted_teleporter, test_relay_is_trusted_teleporter, + test_sibling_is_trusted_teleporter, +}; +use polkadot_runtime::xcm_config::XcmConfig as PolkadotXcmConfig; + +#[test] +fn teleport_from_and_to_relay() { + let amount = POLKADOT_ED * 10; + let native_asset: Assets = (Here, amount).into(); + + test_relay_is_trusted_teleporter!( + Polkadot, // Origin + PolkadotXcmConfig, // XCM Configuration + vec![CollectivesPolkadot], // Destinations + (native_asset, amount) + ); + + test_parachain_is_trusted_teleporter!( + CollectivesPolkadot, // Origin + CollectivesPolkadotXcmConfig, // XCM Configuration + Polkadot, // Destination + amount + ); +} + +#[test] +fn teleport_from_collectives_to_asset_hub() { + let amount = ASSET_HUB_POLKADOT_ED * 100; + let native_asset: Assets = (Parent, amount).into(); + + test_sibling_is_trusted_teleporter!( + CollectivesPolkadot, // Origin + CollectivesPolkadotXcmConfig, // XCM Configuration + vec![AssetHubPolkadot], // Destinations + (native_asset, amount) + ); +} + +#[test] +fn teleport_from_asset_hub_to_collectives() { + let amount = COLLECTIVES_POLKADOT_ED * 100; + let native_asset: Assets = (Parent, amount).into(); + + test_sibling_is_trusted_teleporter!( + AssetHubPolkadot, // Origin + AssetHubPolkadotXcmConfig, // XCM Configuration + vec![CollectivesPolkadot], // Destinations + (native_asset, amount) + ); +} diff --git a/integration-tests/emulated/tests/people/people-kusama/src/lib.rs b/integration-tests/emulated/tests/people/people-kusama/src/lib.rs index 8adf733e48..dac9c8d372 100644 --- a/integration-tests/emulated/tests/people/people-kusama/src/lib.rs +++ b/integration-tests/emulated/tests/people/people-kusama/src/lib.rs @@ -32,7 +32,6 @@ pub use xcm::{ // Cumulus pub use asset_test_utils::xcm_helpers; pub use emulated_integration_tests_common::{ - test_parachain_is_trusted_teleporter, xcm_emulator::{ assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, TestContext, TestExt, From c08d8caf4f89c47a80779c903e54176bbe339d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Andr=C3=A9s=20Dorado=20Su=C3=A1rez?= Date: Fri, 17 May 2024 09:23:15 -0500 Subject: [PATCH 10/15] Allow Sending XCM messages using a Signed origin on Kusama (#290) Since the introduction of this origin control, the XCMv3 release has been integrated on Kusama, and now the `xcm-pallet` is perfectly able to prepend a `DescendOrigin` instruction to the sent message when calling `send`. Allowing signed origins to send messages through the network would extend the possibilities for better integrations with parachains. --------- Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com> --- CHANGELOG.md | 1 + relay/kusama/src/xcm_config.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fad68b5c5d..26b70a801d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Remove one-shot migrations from Kusama Coretime ([polkadot-fellows/runtimes#300](https://github.com/polkadot-fellows/runtimes/pull/300)) - Remove DMP queue and allow `system::authorize_upgrade` in XCM's call filter ([polkadot-fellows/runtimes#280](https://github.com/polkadot-fellows/runtimes/pull/280)) +- Allow Sending XCM messages using a Signed origin on Kusama ([polkadot-fellows/runtimes#290](https://github.com/polkadot-fellows/runtimes/pull/290)) ### Fixed diff --git a/relay/kusama/src/xcm_config.rs b/relay/kusama/src/xcm_config.rs index 9c6e8fbe78..316f14ff3a 100644 --- a/relay/kusama/src/xcm_config.rs +++ b/relay/kusama/src/xcm_config.rs @@ -248,20 +248,21 @@ pub type FellowsToPlurality = OriginToPluralityVoice, ); impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; - // We only allow the root, fellows and the staking admin to send messages. // This is basically safe to enable for everyone (safe the possibility of someone spamming the - // parachain if they're willing to pay the KSM to send from the Relay-chain), but it's useless - // until we bring in XCM v3 which will make `DescendOrigin` a bit more useful. - type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; + // parachain if they're willing to pay the KSM to send from the Relay-chain). + type SendXcmOrigin = + xcm_builder::EnsureXcmOrigin; type XcmRouter = XcmRouter; // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; From 03d25714d790d5408f733b537a4fc27591d8b60c Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Sat, 18 May 2024 12:20:47 +0200 Subject: [PATCH 11/15] Pull all dependencies to the workspace (#314) Changes: - Pull all dependencies to the workspace and add a CI check. - Fixup the crates that had differing dependency aliases. - Add CI check to keep deps in the workspace - Add Taplo config for TOML formatting (follow up: add CI check) This is a preliminary to updating to the new SDK version as we currently use conflicting aliases for a few packages while packages are not able to rename workspace deps, see https://github.com/rust-lang/cargo/issues/12546 This is a No-OP change, as can be verified with this: ```bash git checkout oty-fix-dependencies cargo tree -e features > oty.tree git checkout origin/main cargo tree -e features > main.tree diff main.tree oty.tree ``` - [x] Does not require a CHANGELOG entry --------- Signed-off-by: Oliver Tale-Yazdi Co-authored-by: ordian --- .cargo/config.toml | 46 ++++----- .config/taplo.toml | 29 ++++++ .github/workflows/check-features.yaml | 5 +- Cargo.toml | 94 +++++++++++++------ chain-spec-generator/Cargo.toml | 65 ++++++------- chain-spec-generator/src/relay_chain_specs.rs | 12 +-- .../bridge_hub_kusama_local_network.toml | 12 +-- .../bridge_hub_polkadot_local_network.toml | 14 +-- .../assets/asset-hub-kusama/Cargo.toml | 4 +- .../assets/asset-hub-polkadot/Cargo.toml | 4 +- .../bridges/bridge-hub-kusama/Cargo.toml | 2 +- .../bridges/bridge-hub-polkadot/Cargo.toml | 2 +- .../collectives-polkadot/Cargo.toml | 2 +- .../people/people-kusama/Cargo.toml | 4 +- .../parachains/testing/penpal/Cargo.toml | 6 +- .../emulated/chains/relays/kusama/Cargo.toml | 12 +-- .../chains/relays/polkadot/Cargo.toml | 12 +-- integration-tests/emulated/helpers/Cargo.toml | 2 +- .../kusama-polkadot-system/Cargo.toml | 14 +-- .../networks/kusama-system/Cargo.toml | 10 +- .../networks/polkadot-system/Cargo.toml | 10 +- .../tests/assets/asset-hub-kusama/Cargo.toml | 24 ++--- .../asset-hub-kusama/src/tests/treasury.rs | 2 +- .../assets/asset-hub-polkadot/Cargo.toml | 22 +++-- .../bridges/bridge-hub-kusama/Cargo.toml | 22 ++--- .../bridges/bridge-hub-polkadot/Cargo.toml | 22 ++--- .../collectives-polkadot/Cargo.toml | 28 +++--- .../tests/people/people-kusama/Cargo.toml | 18 ++-- relay/kusama/Cargo.toml | 84 ++++++++--------- relay/kusama/constants/Cargo.toml | 14 +-- relay/kusama/constants/src/lib.rs | 12 +-- relay/kusama/src/impls.rs | 6 +- relay/kusama/src/lib.rs | 78 +++++++-------- relay/kusama/src/tests.rs | 8 +- .../src/weights/runtime_common_auctions.rs | 8 +- .../src/weights/runtime_common_claims.rs | 8 +- .../src/weights/runtime_common_crowdloan.rs | 8 +- .../runtime_common_identity_migrator.rs | 8 +- .../weights/runtime_common_paras_registrar.rs | 8 +- .../src/weights/runtime_common_slots.rs | 8 +- relay/kusama/src/xcm_config.rs | 4 +- relay/polkadot/Cargo.toml | 84 ++++++++--------- relay/polkadot/constants/Cargo.toml | 14 +-- relay/polkadot/constants/src/lib.rs | 12 +-- relay/polkadot/src/impls.rs | 2 +- relay/polkadot/src/lib.rs | 84 +++++++++-------- .../src/weights/runtime_common_auctions.rs | 8 +- .../src/weights/runtime_common_claims.rs | 8 +- .../src/weights/runtime_common_crowdloan.rs | 8 +- .../weights/runtime_common_paras_registrar.rs | 8 +- .../src/weights/runtime_common_slots.rs | 8 +- relay/polkadot/src/xcm_config.rs | 8 +- .../asset-hubs/asset-hub-kusama/Cargo.toml | 60 ++++++------ .../asset-hub-kusama/primitives/Cargo.toml | 12 +-- .../asset-hubs/asset-hub-polkadot/Cargo.toml | 58 +++++++----- .../asset-hub-polkadot/primitives/Cargo.toml | 12 +-- .../bridge-hubs/bridge-hub-kusama/Cargo.toml | 62 ++++++------ .../bridge-hub-kusama/primitives/Cargo.toml | 10 +- .../bridge-hub-polkadot/Cargo.toml | 64 +++++++------ .../bridge-hub-polkadot/primitives/Cargo.toml | 12 +-- .../collectives-polkadot/Cargo.toml | 34 +++---- .../collectives-polkadot/constants/Cargo.toml | 2 +- system-parachains/constants/Cargo.toml | 6 +- .../coretime/coretime-kusama/Cargo.toml | 38 ++++---- system-parachains/encointer/Cargo.toml | 75 +++++++-------- .../gluttons/glutton-kusama/Cargo.toml | 24 ++--- .../people/people-kusama/Cargo.toml | 32 ++++--- 67 files changed, 793 insertions(+), 705 deletions(-) create mode 100644 .config/taplo.toml diff --git a/.cargo/config.toml b/.cargo/config.toml index 5f5b3717d3..df126cfef6 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -7,27 +7,27 @@ # RUSTFLAGS= cargo clippy [target.'cfg(feature = "cargo-clippy")'] rustflags = [ - "-Aclippy::all", - "-Dclippy::correctness", - "-Aclippy::if-same-then-else", - "-Asuspicious_double_ref_op", - "-Dclippy::complexity", - "-Aclippy::zero-prefixed-literal", # 00_1000_000 - "-Aclippy::type_complexity", # raison d'etre - "-Aclippy::nonminimal-bool", # maybe - "-Aclippy::borrowed-box", # Reasonable to fix this one - "-Aclippy::too-many-arguments", # (Turning this on would lead to) - "-Aclippy::unnecessary_cast", # Types may change - "-Aclippy::identity-op", # One case where we do 0 + - "-Aclippy::useless_conversion", # Types may change - "-Aclippy::unit_arg", # styalistic. - "-Aclippy::option-map-unit-fn", # styalistic - "-Aclippy::bind_instead_of_map", # styalistic - "-Aclippy::erasing_op", # E.g. 0 * DOLLARS - "-Aclippy::eq_op", # In tests we test equality. - "-Aclippy::while_immutable_condition", # false positives - "-Aclippy::needless_option_as_deref", # false positives - "-Aclippy::derivable_impls", # false positives - "-Aclippy::stable_sort_primitive", # prefer stable sort - "-Aclippy::extra-unused-type-parameters", # stylistic + "-Aclippy::all", + "-Aclippy::bind_instead_of_map", # stylistic + "-Aclippy::borrowed-box", # Reasonable to fix this one + "-Aclippy::derivable_impls", # false positives + "-Aclippy::eq_op", # In tests we test equality. + "-Aclippy::erasing_op", # E.g. 0 * DOLLARS + "-Aclippy::extra-unused-type-parameters", # stylistic + "-Aclippy::identity-op", # One case where we do 0 + + "-Aclippy::if-same-then-else", + "-Aclippy::needless_option_as_deref", # false positives + "-Aclippy::nonminimal-bool", # maybe + "-Aclippy::option-map-unit-fn", # stylistic + "-Aclippy::stable_sort_primitive", # prefer stable sort + "-Aclippy::too-many-arguments", # (Turning this on would lead to) + "-Aclippy::type_complexity", # raison d'etre + "-Aclippy::unit_arg", # stylistic + "-Aclippy::unnecessary_cast", # Types may change + "-Aclippy::useless_conversion", # Types may change + "-Aclippy::while_immutable_condition", # false positives + "-Aclippy::zero-prefixed-literal", # 00_1000_000 + "-Asuspicious_double_ref_op", + "-Dclippy::complexity", + "-Dclippy::correctness", ] diff --git a/.config/taplo.toml b/.config/taplo.toml new file mode 100644 index 0000000000..fb2fe64824 --- /dev/null +++ b/.config/taplo.toml @@ -0,0 +1,29 @@ +# all options https://taplo.tamasfe.dev/configuration/formatter-options.html + +exclude = [ + "target/**", +] + +# global rules +[formatting] +reorder_arrays = true +inline_table_expand = false +array_auto_expand = false +array_auto_collapse = false +indent_string = " " # tab + +# don't re-order order-dependent deb package metadata +[[rule]] +include = ["polkadot/Cargo.toml"] +keys = ["package.metadata.deb"] + +[rule.formatting] +reorder_arrays = false + +# don't re-order order-dependent rustflags +[[rule]] +include = [".cargo/config.toml"] +keys = ["build"] + +[rule.formatting] +reorder_arrays = false diff --git a/.github/workflows/check-features.yaml b/.github/workflows/check-features.yaml index 98e072f6b6..d5b72129d0 100644 --- a/.github/workflows/check-features.yaml +++ b/.github/workflows/check-features.yaml @@ -32,4 +32,7 @@ jobs: fetch-depth: 0 # Dont clone historic commits. - name: Check features - run: zepter run check + run: | + zepter run check + # We will add this to the config file once its stabilized. Just run it in the CI for now. + zepter transpose dep lift-to-workspace 'regex:.*' diff --git a/Cargo.toml b/Cargo.toml index e8b5a48b0f..f9c0c920ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,14 +3,25 @@ version = "1.0.0" authors = ["Polkadot Fellowship"] edition = "2021" repository = "https://github.com/polkadot-fellows/runtimes.git" -license = "GPL-3.0-only" # TODO +license = "GPL-3.0-only" # TODO [workspace.dependencies] assert_matches = { version = "1.5.0" } +asset-hub-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/assets/asset-hub-kusama" } +asset-hub-kusama-runtime = { path = "system-parachains/asset-hubs/asset-hub-kusama" } +asset-hub-polkadot-emulated-chain = { path = "integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot" } +asset-hub-polkadot-runtime = { path = "system-parachains/asset-hubs/asset-hub-polkadot" } asset-test-utils = { version = "8.0.1" } assets-common = { version = "0.8.0", default-features = false } +authority-discovery-primitives = { version = "27.0.0", default-features = false, package = "sp-authority-discovery" } +babe-primitives = { version = "0.33.0", default-features = false, package = "sp-consensus-babe" } +beefy-primitives = { version = "14.0.0", default-features = false, package = "sp-consensus-beefy" } binary-merkle-tree = { version = "14.0.0", default-features = false } +bp-asset-hub-kusama = { path = "system-parachains/asset-hubs/asset-hub-kusama/primitives", default-features = false } +bp-asset-hub-polkadot = { path = "system-parachains/asset-hubs/asset-hub-polkadot/primitives", default-features = false } bp-bridge-hub-cumulus = { version = "0.8.0", default-features = false } +bp-bridge-hub-kusama = { path = "system-parachains/bridge-hubs/bridge-hub-kusama/primitives", default-features = false } +bp-bridge-hub-polkadot = { path = "system-parachains/bridge-hubs/bridge-hub-polkadot/primitives", default-features = false } bp-header-chain = { version = "0.8.1", default-features = false } bp-kusama = { version = "0.6.0", default-features = false } bp-messages = { version = "0.8.0", default-features = false } @@ -21,9 +32,18 @@ bp-relayers = { version = "0.8.0", default-features = false } bp-runtime = { version = "0.8.0", default-features = false } bp-xcm-bridge-hub-router = { version = "0.7.0", default-features = false } bridge-hub-common = { version = "0.1.0", default-features = false } +bridge-hub-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama" } +bridge-hub-kusama-runtime = { path = "system-parachains/bridge-hubs/bridge-hub-kusama" } +bridge-hub-polkadot-emulated-chain = { path = "integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot" } +bridge-hub-polkadot-runtime = { path = "system-parachains/bridge-hubs/bridge-hub-polkadot" } bridge-hub-test-utils = { version = "0.8.0" } bridge-runtime-common = { version = "0.8.0", default-features = false } clap = { version = "4.5.0" } +codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false } +collectives-polkadot-emulated-chain = { path = "integration-tests/emulated/chains/parachains/collectives/collectives-polkadot" } +collectives-polkadot-runtime = { path = "system-parachains/collectives/collectives-polkadot" } +collectives-polkadot-runtime-constants = { path = "system-parachains/collectives/collectives-polkadot/constants" } +coretime-kusama-runtime = { path = "system-parachains/coretime/coretime-kusama" } cumulus-pallet-aura-ext = { version = "0.8.0", default-features = false } cumulus-pallet-dmp-queue = { version = "0.8.0", default-features = false } cumulus-pallet-parachain-system = { version = "0.8.1", default-features = false } @@ -36,18 +56,26 @@ cumulus-primitives-utility = { version = "0.8.1", default-features = false } emulated-integration-tests-common = { version = "4.0.0" } encointer-balances-tx-payment = { version = "~6.1.0", default-features = false } encointer-balances-tx-payment-rpc-runtime-api = { version = "~6.1.0", default-features = false } +encointer-kusama-runtime = { path = "system-parachains/encointer" } encointer-primitives = { version = "~6.1.0", default-features = false } enumflags2 = { version = "0.7.7" } frame-benchmarking = { version = "29.0.0", default-features = false } frame-election-provider-support = { version = "29.0.0", default-features = false } frame-executive = { version = "29.0.0", default-features = false } -frame-remote-externalities = { version = "0.36.0" } frame-support = { version = "29.0.2", default-features = false } frame-system = { version = "29.0.0", default-features = false } frame-system-benchmarking = { version = "29.0.0", default-features = false } frame-system-rpc-runtime-api = { version = "27.0.0", default-features = false } frame-try-runtime = { version = "0.35.0", default-features = false } +glutton-kusama-runtime = { path = "system-parachains/gluttons/glutton-kusama" } +grandpa = { version = "0.20.0", package = "sc-consensus-grandpa" } hex-literal = { version = "0.4.1" } +integration-tests-helpers = { path = "integration-tests/emulated/helpers" } +kusama-emulated-chain = { path = "integration-tests/emulated/chains/relays/kusama" } +kusama-polkadot-system-emulated-network = { path = "integration-tests/emulated/networks/kusama-polkadot-system" } +kusama-runtime = { path = "relay/kusama", package = "staging-kusama-runtime" } +kusama-runtime-constants = { path = "relay/kusama/constants", default-features = false } +kusama-system-emulated-network = { path = "integration-tests/emulated/networks/kusama-system" } log = { version = "0.4.20", default-features = false } pallet-alliance = { version = "28.0.0", default-features = false } pallet-asset-conversion = { version = "11.0.0", default-features = false } @@ -133,19 +161,26 @@ pallet-xcm = { version = "8.0.5", default-features = false } pallet-xcm-benchmarks = { version = "8.0.2", default-features = false } pallet-xcm-bridge-hub = { version = "0.3.0", default-features = false } pallet-xcm-bridge-hub-router = { version = "0.6.0", default-features = false } +parachain-info = { version = "0.8.0", default-features = false, package = "staging-parachain-info" } parachains-common = { version = "8.0.0", default-features = false } parachains-runtimes-test-utils = { version = "8.0.0" } -parity-scale-codec = { version = "3.6.9", default-features = false } paste = { version = "1.0.14" } +penpal-emulated-chain = { path = "integration-tests/emulated/chains/parachains/testing/penpal" } penpal-runtime = { version = "0.15.1" } +people-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/people/people-kusama" } +people-kusama-runtime = { path = "system-parachains/people/people-kusama" } polkadot-core-primitives = { version = "8.0.0", default-features = false } +polkadot-emulated-chain = { path = "integration-tests/emulated/chains/relays/polkadot" } polkadot-parachain-primitives = { version = "7.0.0", default-features = false } polkadot-primitives = { version = "8.0.1", default-features = false } +polkadot-runtime = { path = "relay/polkadot" } polkadot-runtime-common = { version = "8.0.1", default-features = false } -polkadot-runtime-parachains = { version = "8.0.1", default-features = false } +polkadot-runtime-constants = { path = "relay/polkadot/constants", default-features = false } +polkadot-system-emulated-network = { path = "integration-tests/emulated/networks/polkadot-system" } primitive-types = { version = "0.12.2", default-features = false } +remote-externalities = { version = "0.36.0", package = "frame-remote-externalities" } +runtime-parachains = { version = "8.0.1", default-features = false, package = "polkadot-runtime-parachains" } sc-chain-spec = { version = "28.0.0" } -sc-consensus-grandpa = { version = "0.20.0" } scale-info = { version = "2.10.0", default-features = false } separator = { version = "0.4.1" } serde = { version = "1.0.196" } @@ -166,11 +201,8 @@ snowbridge-system-runtime-api = { version = "0.1.0", default-features = false } sp-api = { version = "27.0.0", default-features = false } sp-application-crypto = { version = "31.0.0", default-features = false } sp-arithmetic = { version = "24.0.0", default-features = false } -sp-authority-discovery = { version = "27.0.0", default-features = false } sp-block-builder = { version = "27.0.0", default-features = false } sp-consensus-aura = { version = "0.33.0", default-features = false } -sp-consensus-babe = { version = "0.33.0", default-features = false } -sp-consensus-beefy = { version = "14.0.0", default-features = false } sp-core = { version = "29.0.0", default-features = false } sp-debug-derive = { version = "14.0.0", default-features = false } sp-genesis-builder = { version = "0.8.0", default-features = false } @@ -189,20 +221,39 @@ sp-transaction-pool = { version = "27.0.0", default-features = false } sp-trie = { version = "30.0.0" } sp-version = { version = "30.0.0", default-features = false } sp-weights = { version = "28.0.0", default-features = false } -staging-parachain-info = { version = "0.8.0", default-features = false } -staging-xcm = { version = "8.0.1", default-features = false } -staging-xcm-builder = { version = "8.0.1", default-features = false } -staging-xcm-executor = { version = "8.0.2", default-features = false } static_assertions = { version = "1.1.0" } substrate-wasm-builder = { version = "18.0.0" } +system-parachains-constants = { path = "system-parachains/constants", default-features = false } tokio = { version = "1.36.0" } +xcm = { version = "8.0.1", default-features = false, package = "staging-xcm" } +xcm-builder = { version = "8.0.1", default-features = false, package = "staging-xcm-builder" } xcm-emulator = { version = "0.6.0" } +xcm-executor = { version = "8.0.1", default-features = false, package = "staging-xcm-executor" } [workspace] resolver = "2" members = [ "chain-spec-generator", + "integration-tests/emulated/chains/parachains/assets/asset-hub-kusama", + "integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot", + "integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama", + "integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot", + "integration-tests/emulated/chains/parachains/collectives/collectives-polkadot", + "integration-tests/emulated/chains/parachains/people/people-kusama", + "integration-tests/emulated/chains/parachains/testing/penpal", + "integration-tests/emulated/chains/relays/kusama", + "integration-tests/emulated/chains/relays/polkadot", + "integration-tests/emulated/helpers", + "integration-tests/emulated/networks/kusama-polkadot-system", + "integration-tests/emulated/networks/kusama-system", + "integration-tests/emulated/networks/polkadot-system", + "integration-tests/emulated/tests/assets/asset-hub-kusama", + "integration-tests/emulated/tests/assets/asset-hub-polkadot", + "integration-tests/emulated/tests/bridges/bridge-hub-kusama", + "integration-tests/emulated/tests/bridges/bridge-hub-polkadot", + "integration-tests/emulated/tests/collectives/collectives-polkadot", + "integration-tests/emulated/tests/people/people-kusama", "relay/kusama", "relay/kusama/constants", "relay/polkadot", @@ -222,25 +273,6 @@ members = [ "system-parachains/encointer", "system-parachains/gluttons/glutton-kusama", "system-parachains/people/people-kusama", - "integration-tests/emulated/chains/relays/kusama", - "integration-tests/emulated/chains/relays/polkadot", - "integration-tests/emulated/chains/parachains/assets/asset-hub-kusama", - "integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot", - "integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama", - "integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot", - "integration-tests/emulated/chains/parachains/collectives/collectives-polkadot", - "integration-tests/emulated/chains/parachains/people/people-kusama", - "integration-tests/emulated/chains/parachains/testing/penpal", - "integration-tests/emulated/helpers", - "integration-tests/emulated/networks/kusama-system", - "integration-tests/emulated/networks/polkadot-system", - "integration-tests/emulated/networks/kusama-polkadot-system", - "integration-tests/emulated/tests/assets/asset-hub-kusama", - "integration-tests/emulated/tests/assets/asset-hub-polkadot", - "integration-tests/emulated/tests/bridges/bridge-hub-kusama", - "integration-tests/emulated/tests/bridges/bridge-hub-polkadot", - "integration-tests/emulated/tests/collectives/collectives-polkadot", - "integration-tests/emulated/tests/people/people-kusama", ] [profile.release] diff --git a/chain-spec-generator/Cargo.toml b/chain-spec-generator/Cargo.toml index 11981fec88..030dccbeb9 100644 --- a/chain-spec-generator/Cargo.toml +++ b/chain-spec-generator/Cargo.toml @@ -7,60 +7,57 @@ repository.workspace = true license.workspace = true [dependencies] -clap = { features = [ "derive" ] , workspace = true } +clap = { features = ["derive"], workspace = true } serde_json = { workspace = true } -serde = { features = ["derive"] , workspace = true } +serde = { features = ["derive"], workspace = true } -polkadot-runtime = { path = "../relay/polkadot" } -polkadot-runtime-constants = { path = "../relay/polkadot/constants" } -kusama-runtime = { package = "staging-kusama-runtime", path = "../relay/kusama" } -kusama-runtime-constants = { path = "../relay/kusama/constants" } +polkadot-runtime = { workspace = true } +polkadot-runtime-constants = { workspace = true, default-features = true } +kusama-runtime = { workspace = true } +kusama-runtime-constants = { workspace = true, default-features = true } sc-chain-spec = { workspace = true } -polkadot-runtime-parachains = { workspace = true, default-features = true } +runtime-parachains = { default-features = true, workspace = true } polkadot-primitives = { workspace = true, default-features = true } -sp-consensus-babe = { workspace = true, default-features = true } -sp-authority-discovery = { workspace = true, default-features = true } +babe-primitives = { workspace = true, default-features = true } +authority-discovery-primitives = { workspace = true, default-features = true } sp-core = { workspace = true, default-features = true } pallet-staking = { workspace = true, default-features = true } -sc-consensus-grandpa = { workspace = true } +grandpa = { workspace = true } sp-runtime = { workspace = true, default-features = true } -sp-consensus-beefy = { workspace = true, default-features = true } -xcm = { package = "staging-xcm", version = "8.0.1" } +beefy-primitives = { workspace = true, default-features = true } +xcm = { workspace = true, default-features = true } parachains-common = { workspace = true, default-features = true } cumulus-primitives-core = { workspace = true, default-features = true } -asset-hub-polkadot-runtime = { path = "../system-parachains/asset-hubs/asset-hub-polkadot" } -asset-hub-kusama-runtime = { path = "../system-parachains/asset-hubs/asset-hub-kusama" } -collectives-polkadot-runtime = { path = "../system-parachains/collectives/collectives-polkadot" } -bridge-hub-polkadot-runtime = { path = "../system-parachains/bridge-hubs/bridge-hub-polkadot" } -bridge-hub-kusama-runtime = { path = "../system-parachains/bridge-hubs/bridge-hub-kusama" } -encointer-kusama-runtime = { path = "../system-parachains/encointer" } -glutton-kusama-runtime = { path = "../system-parachains/gluttons/glutton-kusama" } -coretime-kusama-runtime = { path = "../system-parachains/coretime/coretime-kusama" } -people-kusama-runtime = { path = "../system-parachains/people/people-kusama" } +asset-hub-polkadot-runtime = { workspace = true } +asset-hub-kusama-runtime = { workspace = true } +collectives-polkadot-runtime = { workspace = true } +bridge-hub-polkadot-runtime = { workspace = true } +bridge-hub-kusama-runtime = { workspace = true } +encointer-kusama-runtime = { workspace = true } +glutton-kusama-runtime = { workspace = true } +coretime-kusama-runtime = { workspace = true } +people-kusama-runtime = { workspace = true } [features] -fast-runtime = [ - "kusama-runtime/fast-runtime", - "polkadot-runtime/fast-runtime", -] +fast-runtime = ["kusama-runtime/fast-runtime", "polkadot-runtime/fast-runtime"] runtime-benchmarks = [ - "asset-hub-polkadot-runtime/runtime-benchmarks", "asset-hub-kusama-runtime/runtime-benchmarks", - "bridge-hub-polkadot-runtime/runtime-benchmarks", + "asset-hub-polkadot-runtime/runtime-benchmarks", "bridge-hub-kusama-runtime/runtime-benchmarks", + "bridge-hub-polkadot-runtime/runtime-benchmarks", "collectives-polkadot-runtime/runtime-benchmarks", - "kusama-runtime/runtime-benchmarks", - "polkadot-runtime/runtime-benchmarks", - "encointer-kusama-runtime/runtime-benchmarks", - "glutton-kusama-runtime/runtime-benchmarks", "coretime-kusama-runtime/runtime-benchmarks", - "people-kusama-runtime/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", + "encointer-kusama-runtime/runtime-benchmarks", + "glutton-kusama-runtime/runtime-benchmarks", + "kusama-runtime/runtime-benchmarks", "pallet-staking/runtime-benchmarks", "parachains-common/runtime-benchmarks", + "people-kusama-runtime/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", - "polkadot-runtime-parachains/runtime-benchmarks", - "sp-runtime/runtime-benchmarks" + "polkadot-runtime/runtime-benchmarks", + "runtime-parachains/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", ] diff --git a/chain-spec-generator/src/relay_chain_specs.rs b/chain-spec-generator/src/relay_chain_specs.rs index 63caaeb44d..e8c2fa3c8a 100644 --- a/chain-spec-generator/src/relay_chain_specs.rs +++ b/chain-spec-generator/src/relay_chain_specs.rs @@ -15,16 +15,16 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . +use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; +use babe_primitives::AuthorityId as BabeId; +use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; +use grandpa::AuthorityId as GrandpaId; use kusama_runtime_constants::currency::UNITS as KSM; use pallet_staking::Forcing; use polkadot_primitives::{AccountId, AccountPublic, AssignmentId, ValidatorId}; use polkadot_runtime_constants::currency::UNITS as DOT; -use polkadot_runtime_parachains::configuration::HostConfiguration; +use runtime_parachains::configuration::HostConfiguration; use sc_chain_spec::{ChainSpec, ChainType, NoExtension}; -use sc_consensus_grandpa::AuthorityId as GrandpaId; -use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; -use sp_consensus_babe::AuthorityId as BabeId; -use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; use sp_core::{sr25519, Pair, Public}; use sp_runtime::{traits::IdentifyAccount, Perbill}; @@ -47,7 +47,7 @@ pub fn polkadot_chain_spec_properties() -> serde_json::map::Map HostConfiguration { use polkadot_primitives::{MAX_CODE_SIZE, MAX_POV_SIZE}; - polkadot_runtime_parachains::configuration::HostConfiguration { + runtime_parachains::configuration::HostConfiguration { validation_upgrade_cooldown: 2u32, validation_upgrade_delay: 2, code_retention_period: 1200, diff --git a/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_kusama_local_network.toml b/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_kusama_local_network.toml index e790b90553..3cd10ade0c 100644 --- a/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_kusama_local_network.toml +++ b/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_kusama_local_network.toml @@ -39,16 +39,12 @@ name = "asset-hub-kusama-collator-1" rpc_port = 9011 ws_port = 9010 command = "{{POLKADOT_PARACHAIN_BINARY}}" -args = [ - "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" -] +args = ["-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace"] [[parachains.collators]] name = "asset-hub-kusama-collator-2" command = "{{POLKADOT_PARACHAIN_BINARY}}" -args = [ - "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" -] +args = ["-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace"] [[parachains]] id = 1002 @@ -64,7 +60,7 @@ command = "{{POLKADOT_PARACHAIN_BINARY}}" rpc_port = 8935 ws_port = 8945 args = [ - "-lparachain=debug,runtime::mmr=info,substrate=info,runtime=info,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace" + "-lparachain=debug,runtime::mmr=info,substrate=info,runtime=info,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace", ] # run bob as parachain collator @@ -75,5 +71,5 @@ command = "{{POLKADOT_PARACHAIN_BINARY}}" rpc_port = 8936 ws_port = 8946 args = [ - "-lparachain=trace,runtime::mmr=info,substrate=info,runtime=info,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace" + "-lparachain=trace,runtime::mmr=info,substrate=info,runtime=info,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace", ] diff --git a/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_polkadot_local_network.toml b/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_polkadot_local_network.toml index d2ec0207a9..75a0cb5f2b 100644 --- a/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_polkadot_local_network.toml +++ b/integration-tests/bridges/environments/polkadot-kusama/bridge_hub_polkadot_local_network.toml @@ -39,16 +39,12 @@ name = "asset-hub-polkadot-collator-1" rpc_port = 9911 ws_port = 9910 command = "{{POLKADOT_PARACHAIN_BINARY}}" -args = [ - "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" -] - +args = ["-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace"] + [[parachains.collators]] name = "asset-hub-polkadot-collator-2" command = "{{POLKADOT_PARACHAIN_BINARY}}" -args = [ - "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" -] +args = ["-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace"] [[parachains]] id = 1002 @@ -63,7 +59,7 @@ command = "{{POLKADOT_PARACHAIN_BINARY}}" rpc_port = 8933 ws_port = 8943 args = [ - "-lparachain=debug,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace" + "-lparachain=debug,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace", ] [[parachains.collators]] @@ -73,5 +69,5 @@ command = "{{POLKADOT_PARACHAIN_BINARY}}" rpc_port = 8934 ws_port = 8944 args = [ - "-lparachain=trace,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace" + "-lparachain=trace,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace", ] diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/Cargo.toml index 5f103dc034..3401d3b653 100644 --- a/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/Cargo.toml @@ -19,5 +19,5 @@ cumulus-primitives-core = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Runtimes -asset-hub-kusama-runtime = { path = "../../../../../../system-parachains/asset-hubs/asset-hub-kusama" } -kusama-emulated-chain = { path = "../../../relays/kusama" } +asset-hub-kusama-runtime = { workspace = true } +kusama-emulated-chain = { workspace = true } diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/Cargo.toml index 77be0ca4ab..3bb7ebde64 100644 --- a/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/Cargo.toml @@ -19,5 +19,5 @@ cumulus-primitives-core = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Runtimes -asset-hub-polkadot-runtime = { path = "../../../../../../system-parachains/asset-hubs/asset-hub-polkadot" } -polkadot-emulated-chain = { path = "../../../relays/polkadot" } +asset-hub-polkadot-runtime = { workspace = true } +polkadot-emulated-chain = { workspace = true } diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/Cargo.toml index 3b01d73bff..e79ba4f465 100644 --- a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama/Cargo.toml @@ -19,4 +19,4 @@ bridge-hub-common = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Runtimes -bridge-hub-kusama-runtime = { path = "../../../../../../system-parachains/bridge-hubs/bridge-hub-kusama" } +bridge-hub-kusama-runtime = { workspace = true } diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/Cargo.toml index 9e9adab023..026efeb91a 100644 --- a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/Cargo.toml @@ -19,4 +19,4 @@ bridge-hub-common = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Runtimes -bridge-hub-polkadot-runtime = { path = "../../../../../../system-parachains/bridge-hubs/bridge-hub-polkadot" } +bridge-hub-polkadot-runtime = { workspace = true } diff --git a/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/Cargo.toml b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/Cargo.toml index 4cad7b3eee..ffd5689c64 100644 --- a/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/collectives/collectives-polkadot/Cargo.toml @@ -19,4 +19,4 @@ cumulus-primitives-core = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Runtimes -collectives-polkadot-runtime = { path = "../../../../../../system-parachains/collectives/collectives-polkadot" } +collectives-polkadot-runtime = { workspace = true } diff --git a/integration-tests/emulated/chains/parachains/people/people-kusama/Cargo.toml b/integration-tests/emulated/chains/parachains/people/people-kusama/Cargo.toml index 4564a4de38..a72f24e626 100644 --- a/integration-tests/emulated/chains/parachains/people/people-kusama/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/people/people-kusama/Cargo.toml @@ -19,5 +19,5 @@ cumulus-primitives-core = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Local -people-kusama-runtime = { path = "../../../../../../system-parachains/people/people-kusama" } -kusama-emulated-chain = { path = "../../../relays/kusama" } +people-kusama-runtime = { workspace = true } +kusama-emulated-chain = { workspace = true } diff --git a/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml b/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml index 8a224f7f83..3f5198ea35 100644 --- a/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml +++ b/integration-tests/emulated/chains/parachains/testing/penpal/Cargo.toml @@ -17,8 +17,8 @@ frame-support = { workspace = true, default-features = true } parachains-common = { workspace = true, default-features = true } cumulus-primitives-core = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } -penpal-runtime = { features = ["experimental"] , workspace = true } +penpal-runtime = { features = ["experimental"], workspace = true } # Runtimes -kusama-emulated-chain = { path = "../../../relays/kusama" } -polkadot-emulated-chain = { path = "../../../relays/polkadot" } +kusama-emulated-chain = { workspace = true } +polkadot-emulated-chain = { workspace = true } diff --git a/integration-tests/emulated/chains/relays/kusama/Cargo.toml b/integration-tests/emulated/chains/relays/kusama/Cargo.toml index 91b03372c2..504c79e1eb 100644 --- a/integration-tests/emulated/chains/relays/kusama/Cargo.toml +++ b/integration-tests/emulated/chains/relays/kusama/Cargo.toml @@ -11,10 +11,10 @@ publish = false # Substrate sp-core = { workspace = true, default-features = true } -authority-discovery-primitives = { package = "sp-authority-discovery", version = "27.0.0" } -babe-primitives = { package = "sp-consensus-babe", version = "0.33.0" } -beefy-primitives = { package = "sp-consensus-beefy", version = "14.0.0" } -grandpa = { package = "sc-consensus-grandpa", version = "0.20.0" } +authority-discovery-primitives = { workspace = true, default-features = true } +babe-primitives = { workspace = true, default-features = true } +beefy-primitives = { workspace = true, default-features = true } +grandpa = { workspace = true } # Polkadot polkadot-primitives = { workspace = true, default-features = true } @@ -24,5 +24,5 @@ parachains-common = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Runtimes -kusama-runtime-constants = { path = "../../../../../relay/kusama/constants" } -kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../../relay/kusama" } +kusama-runtime-constants = { workspace = true, default-features = true } +kusama-runtime = { workspace = true } diff --git a/integration-tests/emulated/chains/relays/polkadot/Cargo.toml b/integration-tests/emulated/chains/relays/polkadot/Cargo.toml index 3297be59dd..8c6e2c2a15 100644 --- a/integration-tests/emulated/chains/relays/polkadot/Cargo.toml +++ b/integration-tests/emulated/chains/relays/polkadot/Cargo.toml @@ -12,10 +12,10 @@ publish = false # Substrate sp-core = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } -authority-discovery-primitives = { package = "sp-authority-discovery", version = "27.0.0" } -babe-primitives = { package = "sp-consensus-babe", version = "0.33.0" } -beefy-primitives = { package = "sp-consensus-beefy", version = "14.0.0" } -grandpa = { package = "sc-consensus-grandpa", version = "0.20.0" } +authority-discovery-primitives = { workspace = true, default-features = true } +babe-primitives = { workspace = true, default-features = true } +beefy-primitives = { workspace = true, default-features = true } +grandpa = { workspace = true } pallet-staking = { workspace = true, default-features = true } # Polkadot @@ -26,5 +26,5 @@ parachains-common = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } # Runtimes -polkadot-runtime-constants = { path = "../../../../../relay/polkadot/constants" } -polkadot-runtime = { path = "../../../../../relay/polkadot" } +polkadot-runtime-constants = { workspace = true, default-features = true } +polkadot-runtime = { workspace = true } diff --git a/integration-tests/emulated/helpers/Cargo.toml b/integration-tests/emulated/helpers/Cargo.toml index 2d041aaee9..b5c6401bf9 100644 --- a/integration-tests/emulated/helpers/Cargo.toml +++ b/integration-tests/emulated/helpers/Cargo.toml @@ -15,7 +15,7 @@ pallet-balances = { workspace = true, default-features = true } pallet-message-queue = { workspace = true, default-features = true } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.1" } +xcm = { workspace = true, default-features = true } pallet-xcm = { workspace = true, default-features = true } # Cumulus diff --git a/integration-tests/emulated/networks/kusama-polkadot-system/Cargo.toml b/integration-tests/emulated/networks/kusama-polkadot-system/Cargo.toml index f5eea2f49b..04781b34cd 100644 --- a/integration-tests/emulated/networks/kusama-polkadot-system/Cargo.toml +++ b/integration-tests/emulated/networks/kusama-polkadot-system/Cargo.toml @@ -13,10 +13,10 @@ publish = false emulated-integration-tests-common = { workspace = true } # Runtimes -asset-hub-kusama-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-kusama" } -asset-hub-polkadot-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-polkadot" } -bridge-hub-kusama-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-kusama" } -bridge-hub-polkadot-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-polkadot" } -kusama-emulated-chain = { path = "../../chains/relays/kusama" } -penpal-emulated-chain = { path = "../../chains/parachains/testing/penpal" } -polkadot-emulated-chain = { path = "../../chains/relays/polkadot" } +asset-hub-kusama-emulated-chain = { workspace = true } +asset-hub-polkadot-emulated-chain = { workspace = true } +bridge-hub-kusama-emulated-chain = { workspace = true } +bridge-hub-polkadot-emulated-chain = { workspace = true } +kusama-emulated-chain = { workspace = true } +penpal-emulated-chain = { workspace = true } +polkadot-emulated-chain = { workspace = true } diff --git a/integration-tests/emulated/networks/kusama-system/Cargo.toml b/integration-tests/emulated/networks/kusama-system/Cargo.toml index 036047335f..50f09c6512 100644 --- a/integration-tests/emulated/networks/kusama-system/Cargo.toml +++ b/integration-tests/emulated/networks/kusama-system/Cargo.toml @@ -13,8 +13,8 @@ publish = false emulated-integration-tests-common = { workspace = true } # Runtimes -asset-hub-kusama-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-kusama" } -bridge-hub-kusama-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-kusama" } -kusama-emulated-chain = { path = "../../chains/relays/kusama" } -penpal-emulated-chain = { path = "../../chains/parachains/testing/penpal" } -people-kusama-emulated-chain = { path = "../../chains/parachains/people/people-kusama" } +asset-hub-kusama-emulated-chain = { workspace = true } +bridge-hub-kusama-emulated-chain = { workspace = true } +kusama-emulated-chain = { workspace = true } +penpal-emulated-chain = { workspace = true } +people-kusama-emulated-chain = { workspace = true } diff --git a/integration-tests/emulated/networks/polkadot-system/Cargo.toml b/integration-tests/emulated/networks/polkadot-system/Cargo.toml index 520fc6b92b..9e7c757374 100644 --- a/integration-tests/emulated/networks/polkadot-system/Cargo.toml +++ b/integration-tests/emulated/networks/polkadot-system/Cargo.toml @@ -13,8 +13,8 @@ publish = false emulated-integration-tests-common = { workspace = true } # Runtimes -asset-hub-polkadot-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-polkadot" } -bridge-hub-polkadot-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-polkadot" } -collectives-polkadot-emulated-chain = { path = "../../chains/parachains/collectives/collectives-polkadot" } -penpal-emulated-chain = { path = "../../chains/parachains/testing/penpal" } -polkadot-emulated-chain = { path = "../../chains/relays/polkadot" } +asset-hub-polkadot-emulated-chain = { workspace = true } +bridge-hub-polkadot-emulated-chain = { workspace = true } +collectives-polkadot-emulated-chain = { workspace = true } +penpal-emulated-chain = { workspace = true } +polkadot-emulated-chain = { workspace = true } diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml index 8c0f87f053..3e10c1f40a 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml @@ -8,7 +8,7 @@ description = "Asset Hub Kusama runtime integration tests with xcm-emulator" publish = false [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } +codec = { workspace = true, default-features = true } assert_matches = { workspace = true } # Substrate @@ -22,21 +22,23 @@ pallet-message-queue = { workspace = true, default-features = true } pallet-utility = { workspace = true, default-features = true } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true, default-features = true } +xcm-executor = { workspace = true } pallet-xcm = { workspace = true, default-features = true } -runtime-common = { package = "polkadot-runtime-common", default-features = false, version = "8.0.1" } +polkadot-runtime-common = { workspace = true } # Cumulus parachains-common = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } asset-test-utils = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook"], workspace = true, default-features = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true, default-features = true } # Local -asset-hub-kusama-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-kusama" } -integration-tests-helpers = { path = "../../../helpers" } -kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../../relay/kusama" } -kusama-system-emulated-network = { path = "../../../networks/kusama-system" } -system-parachains-constants = { path = "../../../../../system-parachains/constants" } -kusama-runtime-constants = { path = "../../../../../relay/kusama/constants" } +asset-hub-kusama-runtime = { workspace = true } +integration-tests-helpers = { workspace = true } +kusama-runtime = { workspace = true } +kusama-system-emulated-network = { workspace = true } +system-parachains-constants = { workspace = true, default-features = true } +kusama-runtime-constants = { workspace = true, default-features = true } diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/treasury.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/treasury.rs index 0bf533a613..4c7f4faabf 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/treasury.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/treasury.rs @@ -27,7 +27,7 @@ use frame_support::{ }; use kusama_runtime::OriginCaller; use kusama_runtime_constants::currency::GRAND; -use runtime_common::impls::VersionedLocatableAsset; +use polkadot_runtime_common::impls::VersionedLocatableAsset; use xcm_executor::traits::ConvertLocation; // Fund Treasury account on Asset Hub from Treasury account on Relay Chain with KSMs. diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml index 96ccde7c26..d762ccc96d 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml @@ -8,7 +8,7 @@ description = "Asset Hub Polkadot runtime integration tests with xcm-emulator" publish = false [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } +codec = { workspace = true, default-features = true } assert_matches = { workspace = true } # Substrate @@ -22,21 +22,23 @@ pallet-message-queue = { workspace = true, default-features = true } # Polkadot polkadot-runtime-common = { workspace = true, default-features = true } -xcm = { package = "staging-xcm", version = "8.0.1" } +xcm = { workspace = true, default-features = true } pallet-xcm = { workspace = true, default-features = true } -xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } +xcm-executor = { workspace = true, default-features = true } # Cumulus asset-test-utils = { workspace = true } emulated-integration-tests-common = { workspace = true } parachains-common = { workspace = true, default-features = true } cumulus-pallet-xcmp-queue = { workspace = true, default-features = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook"], workspace = true, default-features = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true, default-features = true } # Local -asset-hub-polkadot-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-polkadot" } -collectives-polkadot-runtime-constants = { path = "../../../../../system-parachains/collectives/collectives-polkadot/constants" } -integration-tests-helpers = { path = "../../../helpers" } -polkadot-runtime = { path = "../../../../../relay/polkadot" } -polkadot-system-emulated-network = { path = "../../../networks/polkadot-system" } -system-parachains-constants = { path = "../../../../../system-parachains/constants" } +asset-hub-polkadot-runtime = { workspace = true } +collectives-polkadot-runtime-constants = { workspace = true } +integration-tests-helpers = { workspace = true } +polkadot-runtime = { workspace = true } +polkadot-system-emulated-network = { workspace = true } +system-parachains-constants = { workspace = true, default-features = true } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml index 994d0349e9..b3385f8dfb 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml @@ -8,8 +8,8 @@ description = "Bridge Hub Kusama runtime integration tests with xcm-emulator" publish = false [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } -scale-info = { features = ["derive"] , workspace = true } +codec = { workspace = true, default-features = true } +scale-info = { features = ["derive"], workspace = true } hex-literal = { workspace = true } # Substrate @@ -22,9 +22,9 @@ pallet-assets = { workspace = true, default-features = true } pallet-message-queue = { workspace = true, default-features = true } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.1" } +xcm = { workspace = true, default-features = true } pallet-xcm = { workspace = true, default-features = true } -xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } +xcm-executor = { workspace = true, default-features = true } # Cumulus emulated-integration-tests-common = { workspace = true } @@ -36,13 +36,13 @@ bp-messages = { workspace = true, default-features = true } pallet-bridge-messages = { workspace = true, default-features = true } # Local -bp-bridge-hub-kusama = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-kusama/primitives"} -bridge-hub-kusama-runtime = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-kusama" } -asset-hub-kusama-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-kusama" } -integration-tests-helpers = { path = "../../../helpers" } -kusama-polkadot-system-emulated-network = { path = "../../../networks/kusama-polkadot-system" } -kusama-system-emulated-network = { path = "../../../networks/kusama-system" } -system-parachains-constants = { path = "../../../../../system-parachains/constants" } +bp-bridge-hub-kusama = { workspace = true, default-features = true } +bridge-hub-kusama-runtime = { workspace = true } +asset-hub-kusama-runtime = { workspace = true } +integration-tests-helpers = { workspace = true } +kusama-polkadot-system-emulated-network = { workspace = true } +kusama-system-emulated-network = { workspace = true } +system-parachains-constants = { workspace = true, default-features = true } # Snowbridge snowbridge-beacon-primitives = { workspace = true, default-features = true } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml index 7a9b30559a..c4034d7913 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml @@ -8,8 +8,8 @@ description = "Bridge Hub Polkadot runtime integration tests with xcm-emulator" publish = false [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } -scale-info = { features = ["derive"] , workspace = true } +codec = { workspace = true, default-features = true } +scale-info = { features = ["derive"], workspace = true } hex-literal = { workspace = true } # Substrate @@ -22,9 +22,9 @@ pallet-assets = { workspace = true, default-features = true } pallet-message-queue = { workspace = true, default-features = true } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.1" } +xcm = { workspace = true, default-features = true } pallet-xcm = { workspace = true, default-features = true } -xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } +xcm-executor = { workspace = true, default-features = true } # Cumulus emulated-integration-tests-common = { workspace = true } @@ -36,13 +36,13 @@ bp-messages = { workspace = true, default-features = true } pallet-bridge-messages = { workspace = true, default-features = true } # Local -bp-bridge-hub-polkadot = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-polkadot/primitives"} -bridge-hub-polkadot-runtime = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-polkadot" } -asset-hub-polkadot-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-polkadot" } -integration-tests-helpers = { path = "../../../helpers" } -kusama-polkadot-system-emulated-network = { path = "../../../networks/kusama-polkadot-system" } -polkadot-system-emulated-network = { path = "../../../networks/polkadot-system" } -system-parachains-constants = { path = "../../../../../system-parachains/constants" } +bp-bridge-hub-polkadot = { workspace = true, default-features = true } +bridge-hub-polkadot-runtime = { workspace = true } +asset-hub-polkadot-runtime = { workspace = true } +integration-tests-helpers = { workspace = true } +kusama-polkadot-system-emulated-network = { workspace = true } +polkadot-system-emulated-network = { workspace = true } +system-parachains-constants = { workspace = true, default-features = true } # Snowbridge snowbridge-beacon-primitives = { workspace = true, default-features = true } diff --git a/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml b/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml index 5ad4da3221..2735efd0b6 100644 --- a/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/collectives/collectives-polkadot/Cargo.toml @@ -8,11 +8,11 @@ description = "Collectives Polkadot runtime integration tests with xcm-emulator" publish = false [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } +codec = { workspace = true, default-features = true } assert_matches = { workspace = true } # Substrate -sp-core ={ workspace = true, default-features = true } +sp-core = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } frame-support = { workspace = true, default-features = true } pallet-balances = { workspace = true, default-features = true } @@ -25,23 +25,25 @@ pallet-whitelist = { workspace = true, default-features = true } # Polkadot polkadot-runtime-common = { workspace = true, default-features = true } -xcm = { package = "staging-xcm", version = "8.0.1" } +xcm = { workspace = true, default-features = true } pallet-xcm = { workspace = true, default-features = true } -xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } +xcm-executor = { workspace = true, default-features = true } # Cumulus asset-test-utils = { workspace = true } emulated-integration-tests-common = { workspace = true } parachains-common = { workspace = true, default-features = true } cumulus-pallet-xcmp-queue = { workspace = true, default-features = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook"], workspace = true, default-features = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true, default-features = true } # Local -asset-hub-polkadot-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-polkadot" } -collectives-polkadot-runtime = { path = "../../../../../system-parachains/collectives/collectives-polkadot" } -collectives-polkadot-runtime-constants = { path = "../../../../../system-parachains/collectives/collectives-polkadot/constants" } -integration-tests-helpers = { path = "../../../helpers" } -polkadot-runtime = { path = "../../../../../relay/polkadot" } -polkadot-runtime-constants = { path = "../../../../../relay/polkadot/constants" } -polkadot-system-emulated-network = { path = "../../../networks/polkadot-system" } -system-parachains-constants = { path = "../../../../../system-parachains/constants" } +asset-hub-polkadot-runtime = { workspace = true } +collectives-polkadot-runtime = { workspace = true } +collectives-polkadot-runtime-constants = { workspace = true } +integration-tests-helpers = { workspace = true } +polkadot-runtime = { workspace = true } +polkadot-runtime-constants = { workspace = true, default-features = true } +polkadot-system-emulated-network = { workspace = true } +system-parachains-constants = { workspace = true, default-features = true } diff --git a/integration-tests/emulated/tests/people/people-kusama/Cargo.toml b/integration-tests/emulated/tests/people/people-kusama/Cargo.toml index 77db521083..4b91b2b197 100644 --- a/integration-tests/emulated/tests/people/people-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/people/people-kusama/Cargo.toml @@ -8,7 +8,7 @@ description = "People Kusama runtime integration tests with xcm-emulator" publish = false [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9" } +codec = { workspace = true, default-features = true } # Substrate sp-runtime = { workspace = true, default-features = true } @@ -19,17 +19,19 @@ pallet-identity = { workspace = true, default-features = true } # Polkadot polkadot-runtime-common = { workspace = true, default-features = true } -xcm = { package = "staging-xcm", version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true, default-features = true } +xcm-executor = { workspace = true } # Cumulus parachains-common = { workspace = true, default-features = true } emulated-integration-tests-common = { workspace = true } asset-test-utils = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook"], workspace = true, default-features = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true, default-features = true } # Local -kusama-runtime-constants = { path = "../../../../../relay/kusama/constants" } -kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../../relay/kusama" } -people-kusama-runtime = { path = "../../../../../system-parachains/people/people-kusama" } -kusama-system-emulated-network = { path = "../../../networks/kusama-system" } +kusama-runtime-constants = { workspace = true, default-features = true } +kusama-runtime = { workspace = true } +people-kusama-runtime = { workspace = true } +kusama-system-emulated-network = { workspace = true } diff --git a/relay/kusama/Cargo.toml b/relay/kusama/Cargo.toml index 9c73470343..e276e2e4c3 100644 --- a/relay/kusama/Cargo.toml +++ b/relay/kusama/Cargo.toml @@ -9,18 +9,18 @@ repository.workspace = true version.workspace = true [dependencies] -parity-scale-codec = { features = ["derive", "max-encoded-len"] , workspace = true } -scale-info = { features = ["derive"] , workspace = true } +codec = { features = ["derive", "max-encoded-len"], workspace = true } +scale-info = { features = ["derive"], workspace = true } log = { workspace = true } -authority-discovery-primitives = { package = "sp-authority-discovery", default-features = false , version = "27.0.0" } -babe-primitives = { package = "sp-consensus-babe", default-features = false , version = "0.33.0" } -beefy-primitives = { package = "sp-consensus-beefy", default-features = false , version = "14.0.0" } +authority-discovery-primitives = { workspace = true } +babe-primitives = { workspace = true } +beefy-primitives = { workspace = true } binary-merkle-tree = { workspace = true } -kusama-runtime-constants = { package = "kusama-runtime-constants", path = "constants", default-features = false } +kusama-runtime-constants = { workspace = true } sp-api = { workspace = true } -inherents = { package = "sp-inherents", default-features = false , version = "27.0.0" } -offchain-primitives = { package = "sp-offchain", default-features = false , version = "27.0.0" } +sp-inherents = { workspace = true } +sp-offchain = { workspace = true } sp-std = { workspace = true } sp-application-crypto = { workspace = true } sp-arithmetic = { workspace = true } @@ -32,8 +32,8 @@ sp-core = { workspace = true } sp-session = { workspace = true } sp-storage = { workspace = true } sp-version = { workspace = true } -tx-pool-api = { package = "sp-transaction-pool", default-features = false , version = "27.0.0" } -block-builder-api = { package = "sp-block-builder", default-features = false , version = "27.0.0" } +sp-transaction-pool = { workspace = true } +sp-block-builder = { workspace = true } sp-npos-elections = { workspace = true } pallet-asset-rate = { workspace = true } @@ -70,7 +70,7 @@ pallet-referenda = { workspace = true } pallet-scheduler = { workspace = true } pallet-session = { workspace = true } pallet-society = { workspace = true } -frame-support = { features = [ "tuples-96" ] , workspace = true } +frame-support = { features = ["tuples-96"], workspace = true } pallet-staking = { workspace = true } pallet-staking-runtime-api = { workspace = true } frame-system = { workspace = true } @@ -81,42 +81,42 @@ pallet-utility = { workspace = true } pallet-vesting = { workspace = true } pallet-whitelist = { workspace = true } pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } frame-election-provider-support = { workspace = true } -frame-benchmarking = { optional = true , workspace = true } -frame-try-runtime = { optional = true , workspace = true } -pallet-offences-benchmarking = { optional = true , workspace = true } -pallet-session-benchmarking = { optional = true , workspace = true } -pallet-nomination-pools-benchmarking = { optional = true , workspace = true } -frame-system-benchmarking = { optional = true , workspace = true } -pallet-election-provider-support-benchmarking = { optional = true , workspace = true } +frame-benchmarking = { optional = true, workspace = true } +frame-try-runtime = { optional = true, workspace = true } +pallet-offences-benchmarking = { optional = true, workspace = true } +pallet-session-benchmarking = { optional = true, workspace = true } +pallet-nomination-pools-benchmarking = { optional = true, workspace = true } +frame-system-benchmarking = { optional = true, workspace = true } +pallet-election-provider-support-benchmarking = { optional = true, workspace = true } hex-literal = { workspace = true } -runtime-common = { package = "polkadot-runtime-common", default-features = false, version = "8.0.1" } -runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "8.0.1" } -primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } +polkadot-runtime-common = { workspace = true } +runtime-parachains = { workspace = true } +polkadot-primitives = { workspace = true } -xcm = { package = "staging-xcm", default-features = false , version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } +xcm = { workspace = true } +xcm-executor = { workspace = true } +xcm-builder = { workspace = true } sp-debug-derive = { workspace = true } [dev-dependencies] -keyring = { package = "sp-keyring", version = "32.0.0" } +sp-keyring = { workspace = true } sp-trie = { workspace = true } separator = { workspace = true } serde_json = { workspace = true } -remote-externalities = { package = "frame-remote-externalities", version = "0.36.0" } -tokio = { features = ["macros"] , workspace = true } +remote-externalities = { workspace = true } +tokio = { features = ["macros"], workspace = true } sp-tracing = { workspace = true } [build-dependencies] substrate-wasm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] no_std = [] only-staking = [] std = [ @@ -124,7 +124,7 @@ std = [ "babe-primitives/std", "beefy-primitives/std", "binary-merkle-tree/std", - "block-builder-api/std", + "codec/std", "frame-benchmarking?/std", "frame-election-provider-support/std", "frame-executive/std", @@ -133,10 +133,8 @@ std = [ "frame-system-rpc-runtime-api/std", "frame-system/std", "frame-try-runtime/std", - "inherents/std", "kusama-runtime-constants/std", "log/std", - "offchain-primitives/std", "pallet-asset-rate/std", "pallet-authority-discovery/std", "pallet-authorship/std", @@ -183,27 +181,29 @@ std = [ "pallet-whitelist/std", "pallet-xcm-benchmarks?/std", "pallet-xcm/std", - "parity-scale-codec/std", - "primitives/std", - "runtime-common/std", + "polkadot-primitives/std", + "polkadot-runtime-common/std", "runtime-parachains/std", "scale-info/std", "sp-api/std", "sp-application-crypto/std", "sp-arithmetic/std", + "sp-block-builder/std", "sp-core/std", "sp-debug-derive/std", "sp-genesis-builder/std", + "sp-inherents/std", "sp-io/std", "sp-npos-elections/std", + "sp-offchain/std", "sp-runtime/std", "sp-session/std", "sp-staking/std", "sp-std/std", "sp-storage/std", "sp-tracing/std", + "sp-transaction-pool/std", "sp-version/std", - "tx-pool-api/std", "xcm-builder/std", "xcm-executor/std", "xcm/std", @@ -251,8 +251,8 @@ runtime-benchmarks = [ "pallet-whitelist/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "primitives/runtime-benchmarks", - "runtime-common/runtime-benchmarks", + "polkadot-primitives/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", "runtime-parachains/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "sp-staking/runtime-benchmarks", @@ -304,7 +304,7 @@ try-runtime = [ "pallet-vesting/try-runtime", "pallet-whitelist/try-runtime", "pallet-xcm/try-runtime", - "runtime-common/try-runtime", + "polkadot-runtime-common/try-runtime", "runtime-parachains/try-runtime", "sp-runtime/try-runtime", ] @@ -312,11 +312,11 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] -runtime-metrics = [ "runtime-parachains/runtime-metrics", "sp-io/with-tracing" ] +runtime-metrics = ["runtime-parachains/runtime-metrics", "sp-io/with-tracing"] -force-debug = [ "sp-debug-derive/force-debug" ] +force-debug = ["sp-debug-derive/force-debug"] diff --git a/relay/kusama/constants/Cargo.toml b/relay/kusama/constants/Cargo.toml index e070c2d0d7..1c8a03a016 100644 --- a/relay/kusama/constants/Cargo.toml +++ b/relay/kusama/constants/Cargo.toml @@ -10,22 +10,22 @@ license.workspace = true smallvec = { workspace = true } frame-support = { workspace = true } -primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } -runtime-common = { package = "polkadot-runtime-common", default-features = false , version = "8.0.1" } +polkadot-primitives = { workspace = true } +polkadot-runtime-common = { workspace = true } sp-runtime = { workspace = true } sp-weights = { workspace = true } sp-core = { workspace = true } -xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } +xcm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "frame-support/std", - "primitives/std", - "runtime-common/std", + "polkadot-primitives/std", + "polkadot-runtime-common/std", "sp-core/std", "sp-runtime/std", "sp-weights/std", - "xcm-builder/std" + "xcm-builder/std", ] diff --git a/relay/kusama/constants/src/lib.rs b/relay/kusama/constants/src/lib.rs index 4310e3966e..335efd102a 100644 --- a/relay/kusama/constants/src/lib.rs +++ b/relay/kusama/constants/src/lib.rs @@ -20,7 +20,7 @@ pub mod weights; /// Money matters. pub mod currency { - use primitives::Balance; + use polkadot_primitives::Balance; /// The existential deposit. pub const EXISTENTIAL_DEPOSIT: Balance = CENTS; @@ -38,8 +38,8 @@ pub mod currency { /// Time and blocks. pub mod time { - use primitives::{BlockNumber, Moment}; - use runtime_common::prod_or_fast; + use polkadot_primitives::{BlockNumber, Moment}; + use polkadot_runtime_common::prod_or_fast; pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(HOURS, MINUTES); @@ -63,7 +63,7 @@ pub mod fee { use frame_support::weights::{ WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; - use primitives::Balance; + use polkadot_primitives::Balance; use smallvec::smallvec; pub use sp_runtime::Perbill; @@ -102,7 +102,7 @@ pub mod fee { /// System Parachains. pub mod system_parachain { - use primitives::Id; + use polkadot_primitives::Id; use xcm_builder::IsChildSystemParachain; /// Asset Hub parachain ID. @@ -131,7 +131,7 @@ mod tests { }; use crate::weights::ExtrinsicBaseWeight; use frame_support::weights::WeightToFee as WeightToFeeT; - use runtime_common::MAXIMUM_BLOCK_WEIGHT; + use polkadot_runtime_common::MAXIMUM_BLOCK_WEIGHT; #[test] // Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds. diff --git a/relay/kusama/src/impls.rs b/relay/kusama/src/impls.rs index e9c3f970ec..20880646cb 100644 --- a/relay/kusama/src/impls.rs +++ b/relay/kusama/src/impls.rs @@ -15,15 +15,15 @@ // along with Polkadot. If not, see . use super::*; +use codec::{Decode, Encode}; use core::marker::PhantomData; use frame_support::{ defensive, pallet_prelude::DispatchResult, traits::tokens::ConversionFromAssetBalance, }; use frame_system::RawOrigin; use kusama_runtime_constants::system_parachain::PEOPLE_ID; -use parity_scale_codec::{Decode, Encode}; -use primitives::Id as ParaId; -use runtime_common::identity_migrator::{OnReapIdentity, WeightInfo}; +use polkadot_primitives::Id as ParaId; +use polkadot_runtime_common::identity_migrator::{OnReapIdentity, WeightInfo}; use xcm::{latest::prelude::*, VersionedXcm}; use xcm_builder::IsChildSystemParachain; use xcm_executor::traits::TransactAsset; diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index a3faef097e..e9e5370ca3 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -20,9 +20,9 @@ // `construct_runtime!` does a lot of recursion and requires us to increase the limit. #![recursion_limit = "512"] +use codec::{Decode, Encode, MaxEncodedLen}; use pallet_nis::WithMaximumOf; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use primitives::{ +use polkadot_primitives::{ slashing, vstaging::{ApprovalVotingParams, NodeFeatures}, AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CandidateHash, @@ -32,7 +32,7 @@ use primitives::{ ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, LOWEST_PUBLIC_ID, PARACHAIN_KEY_TYPE_ID, }; -use runtime_common::{ +use polkadot_runtime_common::{ auctions, claims, crowdloan, identity_migrator, impl_runtime_weights, impls::{ DealWithFees, LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter, @@ -148,6 +148,7 @@ pub mod impls; #[cfg(test)] mod tests; +use polkadot_runtime_common as runtime_common; impl_runtime_weights!(kusama_runtime_constants); // Make the WASM binary available. @@ -586,7 +587,8 @@ generate_solution_type!( pub struct OnChainSeqPhragmen; impl onchain::Config for OnChainSeqPhragmen { type System = Runtime; - type Solver = SequentialPhragmen; + type Solver = + SequentialPhragmen; type DataProvider = Staking; type WeightInfo = weights::frame_election_provider_support::WeightInfo; type MaxWinners = MaxActiveValidators; @@ -653,7 +655,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { pallet_election_provider_multi_phase::SolutionAccuracyOf, (), >; - type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; + type BenchmarkingConfig = polkadot_runtime_common::elections::BenchmarkConfig; type ForceOrigin = EitherOf, StakingAdmin>; type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo; type MaxWinners = MaxActiveValidators; @@ -691,7 +693,7 @@ impl pallet_staking::EraPayout for EraPayout { const MAX_ANNUAL_INFLATION: Perquintill = Perquintill::from_percent(10); const MILLISECONDS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100; - runtime_common::impls::era_payout( + polkadot_runtime_common::impls::era_payout( total_staked, Nis::issuance().other, MAX_ANNUAL_INFLATION, @@ -753,7 +755,7 @@ impl pallet_staking::Config for Runtime { type MaxUnlockingChunks = frame_support::traits::ConstU32<32>; type HistoryDepth = frame_support::traits::ConstU32<84>; type MaxControllersInDeprecationBatch = ConstU32<5169>; - type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig; + type BenchmarkingConfig = polkadot_runtime_common::StakingBenchmarkingConfig; type EventListeners = NominationPools; type WeightInfo = weights::pallet_staking::WeightInfo; } @@ -824,7 +826,7 @@ impl pallet_treasury::Config for Runtime { type BalanceConverter = impls::NativeOnSystemParachain; type PayoutPeriod = PayoutSpendPeriod; #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = runtime_common::impls::benchmarks::TreasuryArguments; + type BenchmarkHelper = polkadot_runtime_common::impls::benchmarks::TreasuryArguments; } parameter_types! { @@ -1570,7 +1572,7 @@ impl pallet_asset_rate::Config for Runtime { type Currency = Balances; type AssetKind = ::AssetKind; #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = runtime_common::impls::benchmarks::AssetRateArguments; + type BenchmarkHelper = polkadot_runtime_common::impls::benchmarks::AssetRateArguments; } // A mock pallet to keep `ImOnline` events decodable after pallet removal @@ -1801,7 +1803,7 @@ pub mod migrations { use frame_support::traits::OnRuntimeUpgrade; use frame_system::RawOrigin; use pallet_scheduler::WeightInfo as SchedulerWeightInfo; - use runtime_common::auctions::WeightInfo as AuctionsWeightInfo; + use polkadot_runtime_common::auctions::WeightInfo as AuctionsWeightInfo; use runtime_parachains::configuration::WeightInfo; #[cfg(feature = "try-runtime")] use sp_core::crypto::ByteArray; @@ -2017,14 +2019,14 @@ pub type SignedPayload = generic::SignedPayload; mod benches { frame_benchmarking::define_benchmarks!( // Polkadot - // NOTE: Make sure to prefix these with `runtime_common::` so + // NOTE: Make sure to prefix these with `polkadot_runtime_common::` so // that the path resolves correctly in the generated file. - [runtime_common::auctions, Auctions] - [runtime_common::crowdloan, Crowdloan] - [runtime_common::claims, Claims] - [runtime_common::identity_migrator, IdentityMigrator] - [runtime_common::slots, Slots] - [runtime_common::paras_registrar, Registrar] + [polkadot_runtime_common::auctions, Auctions] + [polkadot_runtime_common::crowdloan, Crowdloan] + [polkadot_runtime_common::claims, Claims] + [polkadot_runtime_common::identity_migrator, IdentityMigrator] + [polkadot_runtime_common::slots, Slots] + [polkadot_runtime_common::paras_registrar, Registrar] [runtime_parachains::configuration, Configuration] [runtime_parachains::hrmp, Hrmp] [runtime_parachains::disputes, ParasDisputes] @@ -2106,7 +2108,7 @@ sp_api::impl_runtime_apis! { } } - impl block_builder_api::BlockBuilder for Runtime { + impl sp_block_builder::BlockBuilder for Runtime { fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { Executive::apply_extrinsic(extrinsic) } @@ -2115,19 +2117,19 @@ sp_api::impl_runtime_apis! { Executive::finalize_block() } - fn inherent_extrinsics(data: inherents::InherentData) -> Vec<::Extrinsic> { + fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { data.create_extrinsics() } fn check_inherents( block: Block, - data: inherents::InherentData, - ) -> inherents::CheckInherentsResult { + data: sp_inherents::InherentData, + ) -> sp_inherents::CheckInherentsResult { data.check_extrinsics(&block) } } - impl tx_pool_api::runtime_api::TaggedTransactionQueue for Runtime { + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { fn validate_transaction( source: TransactionSource, tx: ::Extrinsic, @@ -2137,14 +2139,14 @@ sp_api::impl_runtime_apis! { } } - impl offchain_primitives::OffchainWorkerApi for Runtime { + impl sp_offchain::OffchainWorkerApi for Runtime { fn offchain_worker(header: &::Header) { Executive::offchain_worker(header) } } #[api_version(10)] - impl primitives::runtime_api::ParachainHost for Runtime { + impl polkadot_primitives::runtime_api::ParachainHost for Runtime { fn validators() -> Vec { parachains_runtime_api_impl::validators::() } @@ -2174,7 +2176,7 @@ sp_api::impl_runtime_apis! { fn check_validation_outputs( para_id: ParaId, - outputs: primitives::CandidateCommitments, + outputs: polkadot_primitives::CandidateCommitments, ) -> bool { parachains_runtime_api_impl::check_validation_outputs::(para_id, outputs) } @@ -2230,8 +2232,8 @@ sp_api::impl_runtime_apis! { } fn submit_pvf_check_statement( - stmt: primitives::PvfCheckStatement, - signature: primitives::ValidatorSignature, + stmt: polkadot_primitives::PvfCheckStatement, + signature: polkadot_primitives::ValidatorSignature, ) { parachains_runtime_api_impl::submit_pvf_check_statement::(stmt, signature) } @@ -2258,7 +2260,7 @@ sp_api::impl_runtime_apis! { fn key_ownership_proof( validator_id: ValidatorId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((PARACHAIN_KEY_TYPE_ID, validator_id)) .map(|p| p.encode()) @@ -2279,11 +2281,11 @@ sp_api::impl_runtime_apis! { parachains_runtime_api_impl::minimum_backing_votes::() } - fn para_backing_state(para_id: ParaId) -> Option { + fn para_backing_state(para_id: ParaId) -> Option { parachains_runtime_api_impl::backing_state::(para_id) } - fn async_backing_params() -> primitives::AsyncBackingParams { + fn async_backing_params() -> polkadot_primitives::AsyncBackingParams { parachains_runtime_api_impl::async_backing_params::() } @@ -2329,7 +2331,7 @@ sp_api::impl_runtime_apis! { _set_id: beefy_primitives::ValidatorSetId, authority_id: BeefyId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((beefy_primitives::KEY_TYPE, authority_id)) .map(|p| p.encode()) @@ -2421,7 +2423,7 @@ sp_api::impl_runtime_apis! { _set_id: fg_primitives::SetId, authority_id: fg_primitives::AuthorityId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((fg_primitives::KEY_TYPE, authority_id)) .map(|p| p.encode()) @@ -2458,7 +2460,7 @@ sp_api::impl_runtime_apis! { _slot: babe_primitives::Slot, authority_id: babe_primitives::AuthorityId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((babe_primitives::KEY_TYPE, authority_id)) .map(|p| p.encode()) @@ -2668,14 +2670,14 @@ sp_api::impl_runtime_apis! { use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { type DeliveryHelper = ( - runtime_common::xcm_sender::ToParachainDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< XcmConfig, ExistentialDepositAsset, xcm_config::PriceForChildParachainDelivery, AssetHubParaId, (), >, - runtime_common::xcm_sender::ToParachainDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< XcmConfig, ExistentialDepositAsset, xcm_config::PriceForChildParachainDelivery, @@ -2732,7 +2734,7 @@ sp_api::impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type AccountIdConverter = SovereignAccountOf; - type DeliveryHelper = runtime_common::xcm_sender::ToParachainDeliveryHelper< + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< XcmConfig, ExistentialDepositAsset, xcm_config::PriceForChildParachainDelivery, @@ -2869,7 +2871,7 @@ mod multiplier_tests { dispatch::DispatchInfo, traits::{OnFinalize, PalletInfoAccess}, }; - use runtime_common::{MinimumMultiplier, TargetBlockFullness}; + use polkadot_runtime_common::{MinimumMultiplier, TargetBlockFullness}; use separator::Separatable; use sp_runtime::traits::Convert; @@ -3062,7 +3064,7 @@ mod remote_tests { .unwrap(); ext.execute_with(|| { pallet_fast_unstake::ErasToCheckPerBlock::::put(1); - runtime_common::try_runtime::migrate_all_inactive_nominators::() + polkadot_runtime_common::try_runtime::migrate_all_inactive_nominators::() }); } } diff --git a/relay/kusama/src/tests.rs b/relay/kusama/src/tests.rs index b5fc87781b..8d00742439 100644 --- a/relay/kusama/src/tests.rs +++ b/relay/kusama/src/tests.rs @@ -20,10 +20,10 @@ use crate::*; use frame_support::{ dispatch::GetDispatchInfo, traits::WhitelistedStorageKeys, weights::WeightToFee as WeightToFeeT, }; -use keyring::Sr25519Keyring::Charlie; -use runtime_common::MinimumMultiplier; +use polkadot_runtime_common::MinimumMultiplier; use separator::Separatable; use sp_core::hexdisplay::HexDisplay; +use sp_keyring::Sr25519Keyring::Charlie; use std::collections::HashSet; #[test] @@ -33,7 +33,7 @@ fn nis_hold_reason_encoding_is_correct() { #[test] fn remove_keys_weight_is_sensible() { - use runtime_common::crowdloan::WeightInfo; + use polkadot_runtime_common::crowdloan::WeightInfo; let max_weight = ::WeightInfo::refund(RemoveKeysLimit::get()); // Max remove keys limit should be no more than half the total block weight. assert!((max_weight * 2).all_lt(BlockWeights::get().max_block)); @@ -41,7 +41,7 @@ fn remove_keys_weight_is_sensible() { #[test] fn sample_size_is_sensible() { - use runtime_common::auctions::WeightInfo; + use polkadot_runtime_common::auctions::WeightInfo; // Need to clean up all samples at the end of an auction. let samples: BlockNumber = EndingPeriod::get() / SampleLength::get(); let max_weight: Weight = RocksDbWeight::get().reads_writes(samples.into(), samples.into()); diff --git a/relay/kusama/src/weights/runtime_common_auctions.rs b/relay/kusama/src/weights/runtime_common_auctions.rs index cad85a6d09..3ae18a8155 100644 --- a/relay/kusama/src/weights/runtime_common_auctions.rs +++ b/relay/kusama/src/weights/runtime_common_auctions.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::auctions` +//! Autogenerated weights for `polkadot_runtime_common::auctions` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./kusama-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::auctions +// --pallet=polkadot_runtime_common::auctions // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::auctions`. +/// Weight functions for `polkadot_runtime_common::auctions`. pub struct WeightInfo(PhantomData); -impl runtime_common::auctions::WeightInfo for WeightInfo { +impl polkadot_runtime_common::auctions::WeightInfo for WeightInfo { /// Storage: `Auctions::AuctionInfo` (r:1 w:1) /// Proof: `Auctions::AuctionInfo` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// Storage: `Auctions::AuctionCounter` (r:1 w:1) diff --git a/relay/kusama/src/weights/runtime_common_claims.rs b/relay/kusama/src/weights/runtime_common_claims.rs index 92f70a3365..30d89a7011 100644 --- a/relay/kusama/src/weights/runtime_common_claims.rs +++ b/relay/kusama/src/weights/runtime_common_claims.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::claims` +//! Autogenerated weights for `polkadot_runtime_common::claims` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./kusama-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::claims +// --pallet=polkadot_runtime_common::claims // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::claims`. +/// Weight functions for `polkadot_runtime_common::claims`. pub struct WeightInfo(PhantomData); -impl runtime_common::claims::WeightInfo for WeightInfo { +impl polkadot_runtime_common::claims::WeightInfo for WeightInfo { /// Storage: `Claims::Claims` (r:1 w:1) /// Proof: `Claims::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Claims::Signing` (r:1 w:1) diff --git a/relay/kusama/src/weights/runtime_common_crowdloan.rs b/relay/kusama/src/weights/runtime_common_crowdloan.rs index c6a9edd129..ea9cf9a120 100644 --- a/relay/kusama/src/weights/runtime_common_crowdloan.rs +++ b/relay/kusama/src/weights/runtime_common_crowdloan.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::crowdloan` +//! Autogenerated weights for `polkadot_runtime_common::crowdloan` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./kusama-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::crowdloan +// --pallet=polkadot_runtime_common::crowdloan // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::crowdloan`. +/// Weight functions for `polkadot_runtime_common::crowdloan`. pub struct WeightInfo(PhantomData); -impl runtime_common::crowdloan::WeightInfo for WeightInfo { +impl polkadot_runtime_common::crowdloan::WeightInfo for WeightInfo { /// Storage: `Crowdloan::Funds` (r:1 w:1) /// Proof: `Crowdloan::Funds` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Registrar::Paras` (r:1 w:0) diff --git a/relay/kusama/src/weights/runtime_common_identity_migrator.rs b/relay/kusama/src/weights/runtime_common_identity_migrator.rs index 9b0cb98e6c..28c80d1c4c 100644 --- a/relay/kusama/src/weights/runtime_common_identity_migrator.rs +++ b/relay/kusama/src/weights/runtime_common_identity_migrator.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Autogenerated weights for `runtime_common::identity_migrator` +//! Autogenerated weights for `polkadot_runtime_common::identity_migrator` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-02-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -32,7 +32,7 @@ // --no-storage-info // --no-median-slopes // --no-min-squares -// --pallet=runtime_common::identity_migrator +// --pallet=polkadot_runtime_common::identity_migrator // --extrinsic=* // --execution=wasm // --wasm-execution=compiled @@ -47,9 +47,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::identity_migrator`. +/// Weight functions for `polkadot_runtime_common::identity_migrator`. pub struct WeightInfo(PhantomData); -impl runtime_common::identity_migrator::WeightInfo for WeightInfo { +impl polkadot_runtime_common::identity_migrator::WeightInfo for WeightInfo { /// Storage: `Identity::IdentityOf` (r:1 w:1) /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`) /// Storage: `Identity::SubsOf` (r:1 w:1) diff --git a/relay/kusama/src/weights/runtime_common_paras_registrar.rs b/relay/kusama/src/weights/runtime_common_paras_registrar.rs index 5ffcd2028f..da7ef411a5 100644 --- a/relay/kusama/src/weights/runtime_common_paras_registrar.rs +++ b/relay/kusama/src/weights/runtime_common_paras_registrar.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::paras_registrar` +//! Autogenerated weights for `polkadot_runtime_common::paras_registrar` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./kusama-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::paras_registrar +// --pallet=polkadot_runtime_common::paras_registrar // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::paras_registrar`. +/// Weight functions for `polkadot_runtime_common::paras_registrar`. pub struct WeightInfo(PhantomData); -impl runtime_common::paras_registrar::WeightInfo for WeightInfo { +impl polkadot_runtime_common::paras_registrar::WeightInfo for WeightInfo { /// Storage: `Registrar::NextFreeParaId` (r:1 w:1) /// Proof: `Registrar::NextFreeParaId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Registrar::Paras` (r:1 w:1) diff --git a/relay/kusama/src/weights/runtime_common_slots.rs b/relay/kusama/src/weights/runtime_common_slots.rs index b0311027df..dccac44368 100644 --- a/relay/kusama/src/weights/runtime_common_slots.rs +++ b/relay/kusama/src/weights/runtime_common_slots.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::slots` +//! Autogenerated weights for `polkadot_runtime_common::slots` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./kusama-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::slots +// --pallet=polkadot_runtime_common::slots // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::slots`. +/// Weight functions for `polkadot_runtime_common::slots`. pub struct WeightInfo(PhantomData); -impl runtime_common::slots::WeightInfo for WeightInfo { +impl polkadot_runtime_common::slots::WeightInfo for WeightInfo { /// Storage: `Slots::Leases` (r:1 w:1) /// Proof: `Slots::Leases` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) diff --git a/relay/kusama/src/xcm_config.rs b/relay/kusama/src/xcm_config.rs index 316f14ff3a..106550cc19 100644 --- a/relay/kusama/src/xcm_config.rs +++ b/relay/kusama/src/xcm_config.rs @@ -27,7 +27,7 @@ use frame_support::{ }; use frame_system::EnsureRoot; use kusama_runtime_constants::{currency::CENTS, system_parachain::*}; -use runtime_common::{ +use polkadot_runtime_common::{ xcm_sender::{ChildParachainRouter, ExponentialPrice}, ToAuthor, }; @@ -297,8 +297,8 @@ impl pallet_xcm::Config for Runtime { #[test] fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() { + use codec::Decode; use frame_support::dispatch::GetDispatchInfo; - use parity_scale_codec::Decode; use xcm::VersionedXcm; use xcm_executor::traits::WeightBounds; diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml index 52fd3131e4..b2cf870f7e 100644 --- a/relay/polkadot/Cargo.toml +++ b/relay/polkadot/Cargo.toml @@ -8,18 +8,18 @@ edition.workspace = true license.workspace = true [dependencies] -parity-scale-codec = { features = ["derive", "max-encoded-len"] , workspace = true } -scale-info = { features = ["derive"] , workspace = true } +codec = { features = ["derive", "max-encoded-len"], workspace = true } +scale-info = { features = ["derive"], workspace = true } log = { workspace = true } -authority-discovery-primitives = { package = "sp-authority-discovery", default-features = false , version = "27.0.0" } -babe-primitives = { package = "sp-consensus-babe", default-features = false , version = "0.33.0" } -beefy-primitives = { package = "sp-consensus-beefy", default-features = false , version = "14.0.0" } +authority-discovery-primitives = { workspace = true } +babe-primitives = { workspace = true } +beefy-primitives = { workspace = true } binary-merkle-tree = { workspace = true } -block-builder-api = { package = "sp-block-builder", default-features = false , version = "27.0.0" } -inherents = { package = "sp-inherents", default-features = false , version = "27.0.0" } -offchain-primitives = { package = "sp-offchain", default-features = false , version = "27.0.0" } -tx-pool-api = { package = "sp-transaction-pool", default-features = false , version = "27.0.0" } +sp-block-builder = { workspace = true } +sp-inherents = { workspace = true } +sp-offchain = { workspace = true } +sp-transaction-pool = { workspace = true } sp-arithmetic = { workspace = true } sp-api = { workspace = true } sp-genesis-builder = { workspace = true } @@ -72,7 +72,7 @@ pallet-staking-runtime-api = { workspace = true } pallet-state-trie-migration = { workspace = true } frame-system = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } -polkadot-runtime-constants = { package = "polkadot-runtime-constants", path = "constants", default-features = false } +polkadot-runtime-constants = { workspace = true } pallet-timestamp = { workspace = true } pallet-treasury = { workspace = true } pallet-whitelist = { workspace = true } @@ -80,40 +80,40 @@ pallet-vesting = { workspace = true } pallet-utility = { workspace = true } frame-election-provider-support = { workspace = true } pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } -frame-benchmarking = { optional = true , workspace = true } -frame-try-runtime = { optional = true , workspace = true } -frame-system-benchmarking = { optional = true , workspace = true } -pallet-election-provider-support-benchmarking = { optional = true , workspace = true } -pallet-offences-benchmarking = { optional = true , workspace = true } -pallet-session-benchmarking = { optional = true , workspace = true } -pallet-nomination-pools-benchmarking = { optional = true , workspace = true } +frame-benchmarking = { optional = true, workspace = true } +frame-try-runtime = { optional = true, workspace = true } +frame-system-benchmarking = { optional = true, workspace = true } +pallet-election-provider-support-benchmarking = { optional = true, workspace = true } +pallet-offences-benchmarking = { optional = true, workspace = true } +pallet-session-benchmarking = { optional = true, workspace = true } +pallet-nomination-pools-benchmarking = { optional = true, workspace = true } -runtime-common = { package = "polkadot-runtime-common", default-features = false, version = "8.0.1" } -runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "8.0.1" } -primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } +polkadot-runtime-common = { workspace = true } +runtime-parachains = { workspace = true } +polkadot-primitives = { workspace = true } -xcm = { package = "staging-xcm", default-features = false , version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } +xcm = { workspace = true } +xcm-executor = { workspace = true } +xcm-builder = { workspace = true } sp-debug-derive = { workspace = true } [dev-dependencies] -keyring = { package = "sp-keyring", version = "32.0.0" } +sp-keyring = { workspace = true } sp-trie = { workspace = true } serde_json = { workspace = true } separator = { workspace = true } -remote-externalities = { package = "frame-remote-externalities", version = "0.36.0" } -tokio = { features = ["macros"] , workspace = true } +remote-externalities = { workspace = true } +tokio = { features = ["macros"], workspace = true } sp-tracing = { workspace = true } [build-dependencies] substrate-wasm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] no_std = [] only-staking = [] std = [ @@ -121,7 +121,7 @@ std = [ "babe-primitives/std", "beefy-primitives/std", "binary-merkle-tree/std", - "block-builder-api/std", + "codec/std", "frame-benchmarking?/std", "frame-election-provider-support/std", "frame-executive/std", @@ -130,17 +130,15 @@ std = [ "frame-system-rpc-runtime-api/std", "frame-system/std", "frame-try-runtime/std", - "inherents/std", "log/std", - "offchain-primitives/std", "pallet-asset-rate/std", "pallet-authority-discovery/std", "pallet-authorship/std", "pallet-babe/std", "pallet-bags-list/std", "pallet-balances/std", - "pallet-beefy/std", "pallet-beefy-mmr/std", + "pallet-beefy/std", "pallet-bounties/std", "pallet-child-bounties/std", "pallet-conviction-voting/std", @@ -177,28 +175,30 @@ std = [ "pallet-whitelist/std", "pallet-xcm-benchmarks?/std", "pallet-xcm/std", - "parity-scale-codec/std", + "polkadot-primitives/std", + "polkadot-runtime-common/std", "polkadot-runtime-constants/std", - "primitives/std", - "runtime-common/std", "runtime-parachains/std", "scale-info/std", "sp-api/std", "sp-application-crypto/std", "sp-arithmetic/std", + "sp-block-builder/std", "sp-core/std", "sp-debug-derive/std", "sp-genesis-builder/std", + "sp-inherents/std", "sp-io/std", "sp-npos-elections/std", + "sp-offchain/std", "sp-runtime/std", "sp-session/std", "sp-staking/std", "sp-std/std", "sp-storage/std", "sp-tracing/std", + "sp-transaction-pool/std", "sp-version/std", - "tx-pool-api/std", "xcm-builder/std", "xcm-executor/std", "xcm/std", @@ -243,8 +243,8 @@ runtime-benchmarks = [ "pallet-whitelist/runtime-benchmarks", "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", - "primitives/runtime-benchmarks", - "runtime-common/runtime-benchmarks", + "polkadot-primitives/runtime-benchmarks", + "polkadot-runtime-common/runtime-benchmarks", "runtime-parachains/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "sp-staking/runtime-benchmarks", @@ -293,7 +293,7 @@ try-runtime = [ "pallet-vesting/try-runtime", "pallet-whitelist/try-runtime", "pallet-xcm/try-runtime", - "runtime-common/try-runtime", + "polkadot-runtime-common/try-runtime", "runtime-parachains/try-runtime", "sp-runtime/try-runtime", ] @@ -301,11 +301,11 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] -runtime-metrics = [ "runtime-parachains/runtime-metrics", "sp-io/with-tracing" ] +runtime-metrics = ["runtime-parachains/runtime-metrics", "sp-io/with-tracing"] -force-debug = [ "sp-debug-derive/force-debug" ] +force-debug = ["sp-debug-derive/force-debug"] diff --git a/relay/polkadot/constants/Cargo.toml b/relay/polkadot/constants/Cargo.toml index 1e7f541293..81fd205db6 100644 --- a/relay/polkadot/constants/Cargo.toml +++ b/relay/polkadot/constants/Cargo.toml @@ -10,22 +10,22 @@ license.workspace = true smallvec = { workspace = true } frame-support = { workspace = true } -primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } -runtime-common = { package = "polkadot-runtime-common", default-features = false , version = "8.0.1" } +polkadot-primitives = { workspace = true } +polkadot-runtime-common = { workspace = true } sp-runtime = { workspace = true } sp-weights = { workspace = true } sp-core = { workspace = true } -xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } +xcm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "frame-support/std", - "primitives/std", - "runtime-common/std", + "polkadot-primitives/std", + "polkadot-runtime-common/std", "sp-core/std", "sp-runtime/std", "sp-weights/std", - "xcm-builder/std" + "xcm-builder/std", ] diff --git a/relay/polkadot/constants/src/lib.rs b/relay/polkadot/constants/src/lib.rs index 1ddd59d86a..49cc6b3560 100644 --- a/relay/polkadot/constants/src/lib.rs +++ b/relay/polkadot/constants/src/lib.rs @@ -22,7 +22,7 @@ pub use self::currency::DOLLARS; /// Money matters. pub mod currency { - use primitives::Balance; + use polkadot_primitives::Balance; /// The existential deposit. pub const EXISTENTIAL_DEPOSIT: Balance = 100 * CENTS; @@ -40,8 +40,8 @@ pub mod currency { /// Time and blocks. pub mod time { - use primitives::{BlockNumber, Moment}; - use runtime_common::prod_or_fast; + use polkadot_primitives::{BlockNumber, Moment}; + use polkadot_runtime_common::prod_or_fast; pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(4 * HOURS, MINUTES); @@ -65,7 +65,7 @@ pub mod fee { use frame_support::weights::{ WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }; - use primitives::Balance; + use polkadot_primitives::Balance; use smallvec::smallvec; pub use sp_runtime::Perbill; @@ -120,7 +120,7 @@ pub mod xcm { /// System Parachains. pub mod system_parachain { - use primitives::Id; + use polkadot_primitives::Id; use xcm_builder::IsChildSystemParachain; /// Asset Hub parachain ID. @@ -145,7 +145,7 @@ mod tests { }; use crate::weights::ExtrinsicBaseWeight; use frame_support::weights::WeightToFee as WeightToFeeT; - use runtime_common::MAXIMUM_BLOCK_WEIGHT; + use polkadot_runtime_common::MAXIMUM_BLOCK_WEIGHT; #[test] // Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds. diff --git a/relay/polkadot/src/impls.rs b/relay/polkadot/src/impls.rs index 3e13683348..8d2d76d224 100644 --- a/relay/polkadot/src/impls.rs +++ b/relay/polkadot/src/impls.rs @@ -17,7 +17,7 @@ use super::*; use core::marker::PhantomData; use frame_support::traits::{tokens::ConversionFromAssetBalance, Contains}; -use primitives::Id as ParaId; +use polkadot_primitives::Id as ParaId; use xcm_builder::IsChildSystemParachain; // TODO: replace by types from polkadot-sdk https://github.com/paritytech/polkadot-sdk/pull/3659 diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 5e1695038c..0a34ccc385 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -21,7 +21,7 @@ #![recursion_limit = "512"] use pallet_transaction_payment::CurrencyAdapter; -use runtime_common::{ +use polkadot_runtime_common::{ auctions, claims, crowdloan, impl_runtime_weights, impls::{ DealWithFees, LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter, @@ -50,6 +50,7 @@ use beefy_primitives::{ ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, mmr::{BeefyDataProvider, MmrLeafVersion}, }; +use codec::{Decode, Encode, MaxEncodedLen}; use frame_election_provider_support::{ bounds::ElectionBoundsBuilder, generate_solution_type, onchain, SequentialPhragmen, }; @@ -70,8 +71,7 @@ use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; use pallet_identity::legacy::IdentityInfo; use pallet_session::historical as session_historical; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use primitives::{ +use polkadot_primitives::{ slashing, vstaging::{ApprovalVotingParams, NodeFeatures}, AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CandidateHash, @@ -134,6 +134,7 @@ pub mod xcm_config; pub const LOG_TARGET: &str = "runtime::polkadot"; +use polkadot_runtime_common as runtime_common; impl_runtime_weights!(polkadot_runtime_constants); // Make the WASM binary available. @@ -562,7 +563,8 @@ generate_solution_type!( pub struct OnChainSeqPhragmen; impl onchain::Config for OnChainSeqPhragmen { type System = Runtime; - type Solver = SequentialPhragmen; + type Solver = + SequentialPhragmen; type DataProvider = Staking; type WeightInfo = weights::frame_election_provider_support::WeightInfo; type MaxWinners = MaxActiveValidators; @@ -629,7 +631,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { pallet_election_provider_multi_phase::SolutionAccuracyOf, (), >; - type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; + type BenchmarkingConfig = polkadot_runtime_common::elections::BenchmarkConfig; type ForceOrigin = EitherOf, StakingAdmin>; type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo; type MaxWinners = MaxActiveValidators; @@ -793,7 +795,7 @@ impl pallet_staking::Config for Runtime { type MaxUnlockingChunks = frame_support::traits::ConstU32<32>; type HistoryDepth = frame_support::traits::ConstU32<84>; type MaxControllersInDeprecationBatch = ConstU32<5314>; - type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig; + type BenchmarkingConfig = polkadot_runtime_common::StakingBenchmarkingConfig; type EventListeners = NominationPools; type WeightInfo = weights::pallet_staking::WeightInfo; } @@ -897,7 +899,7 @@ impl pallet_treasury::Config for Runtime { type BalanceConverter = impls::NativeOnSystemParachain; type PayoutPeriod = PayoutSpendPeriod; #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = runtime_common::impls::benchmarks::TreasuryArguments; + type BenchmarkHelper = polkadot_runtime_common::impls::benchmarks::TreasuryArguments; } parameter_types! { @@ -1504,8 +1506,8 @@ impl pallet_nomination_pools::Config for Runtime { type Currency = Balances; type RuntimeFreezeReason = RuntimeFreezeReason; type RewardCounter = FixedU128; - type BalanceToU256 = runtime_common::BalanceToU256; - type U256ToBalance = runtime_common::U256ToBalance; + type BalanceToU256 = polkadot_runtime_common::BalanceToU256; + type U256ToBalance = polkadot_runtime_common::U256ToBalance; type Staking = Staking; type PostUnbondingPoolsWindow = frame_support::traits::ConstU32<4>; type MaxMetadataLen = frame_support::traits::ConstU32<256>; @@ -1570,7 +1572,7 @@ impl pallet_asset_rate::Config for Runtime { type Currency = Balances; type AssetKind = ::AssetKind; #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = runtime_common::impls::benchmarks::AssetRateArguments; + type BenchmarkHelper = polkadot_runtime_common::impls::benchmarks::AssetRateArguments; } // A mock pallet to keep `ImOnline` events decodable after pallet removal @@ -1908,13 +1910,13 @@ pub type SignedPayload = generic::SignedPayload; mod benches { frame_benchmarking::define_benchmarks!( // Polkadot - // NOTE: Make sure to prefix these with `runtime_common::` so + // NOTE: Make sure to prefix these with `polkadot_runtime_common::` so // the that path resolves correctly in the generated file. - [runtime_common::auctions, Auctions] - [runtime_common::claims, Claims] - [runtime_common::crowdloan, Crowdloan] - [runtime_common::slots, Slots] - [runtime_common::paras_registrar, Registrar] + [polkadot_runtime_common::auctions, Auctions] + [polkadot_runtime_common::claims, Claims] + [polkadot_runtime_common::crowdloan, Crowdloan] + [polkadot_runtime_common::slots, Slots] + [polkadot_runtime_common::paras_registrar, Registrar] [runtime_parachains::configuration, Configuration] [runtime_parachains::disputes, ParasDisputes] [runtime_parachains::disputes::slashing, ParasSlashing] @@ -1988,7 +1990,7 @@ sp_api::impl_runtime_apis! { } } - impl block_builder_api::BlockBuilder for Runtime { + impl sp_block_builder::BlockBuilder for Runtime { fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { Executive::apply_extrinsic(extrinsic) } @@ -1997,14 +1999,14 @@ sp_api::impl_runtime_apis! { Executive::finalize_block() } - fn inherent_extrinsics(data: inherents::InherentData) -> Vec<::Extrinsic> { + fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { data.create_extrinsics() } fn check_inherents( block: Block, - data: inherents::InherentData, - ) -> inherents::CheckInherentsResult { + data: sp_inherents::InherentData, + ) -> sp_inherents::CheckInherentsResult { data.check_extrinsics(&block) } } @@ -2037,7 +2039,7 @@ sp_api::impl_runtime_apis! { } } - impl tx_pool_api::runtime_api::TaggedTransactionQueue for Runtime { + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { fn validate_transaction( source: TransactionSource, tx: ::Extrinsic, @@ -2047,14 +2049,14 @@ sp_api::impl_runtime_apis! { } } - impl offchain_primitives::OffchainWorkerApi for Runtime { + impl sp_offchain::OffchainWorkerApi for Runtime { fn offchain_worker(header: &::Header) { Executive::offchain_worker(header) } } #[api_version(10)] - impl primitives::runtime_api::ParachainHost for Runtime { + impl polkadot_primitives::runtime_api::ParachainHost for Runtime { fn validators() -> Vec { parachains_runtime_api_impl::validators::() } @@ -2084,7 +2086,7 @@ sp_api::impl_runtime_apis! { fn check_validation_outputs( para_id: ParaId, - outputs: primitives::CandidateCommitments, + outputs: polkadot_primitives::CandidateCommitments, ) -> bool { parachains_runtime_api_impl::check_validation_outputs::(para_id, outputs) } @@ -2140,8 +2142,8 @@ sp_api::impl_runtime_apis! { } fn submit_pvf_check_statement( - stmt: primitives::PvfCheckStatement, - signature: primitives::ValidatorSignature, + stmt: polkadot_primitives::PvfCheckStatement, + signature: polkadot_primitives::ValidatorSignature, ) { parachains_runtime_api_impl::submit_pvf_check_statement::(stmt, signature) } @@ -2168,7 +2170,7 @@ sp_api::impl_runtime_apis! { fn key_ownership_proof( validator_id: ValidatorId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((PARACHAIN_KEY_TYPE_ID, validator_id)) .map(|p| p.encode()) @@ -2189,11 +2191,11 @@ sp_api::impl_runtime_apis! { parachains_runtime_api_impl::minimum_backing_votes::() } - fn para_backing_state(para_id: ParaId) -> Option { + fn para_backing_state(para_id: ParaId) -> Option { parachains_runtime_api_impl::backing_state::(para_id) } - fn async_backing_params() -> primitives::AsyncBackingParams { + fn async_backing_params() -> polkadot_primitives::AsyncBackingParams { parachains_runtime_api_impl::async_backing_params::() } @@ -2239,7 +2241,7 @@ sp_api::impl_runtime_apis! { _set_id: beefy_primitives::ValidatorSetId, authority_id: BeefyId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((beefy_primitives::KEY_TYPE, authority_id)) .map(|p| p.encode()) @@ -2331,7 +2333,7 @@ sp_api::impl_runtime_apis! { _set_id: fg_primitives::SetId, authority_id: fg_primitives::AuthorityId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((fg_primitives::KEY_TYPE, authority_id)) .map(|p| p.encode()) @@ -2368,7 +2370,7 @@ sp_api::impl_runtime_apis! { _slot: babe_primitives::Slot, authority_id: babe_primitives::AuthorityId, ) -> Option { - use parity_scale_codec::Encode; + use codec::Encode; Historical::prove((babe_primitives::KEY_TYPE, authority_id)) .map(|p| p.encode()) @@ -2541,14 +2543,14 @@ sp_api::impl_runtime_apis! { use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark; impl pallet_xcm::benchmarking::Config for Runtime { type DeliveryHelper = ( - runtime_common::xcm_sender::ToParachainDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< XcmConfig, ExistentialDepositAsset, xcm_config::PriceForChildParachainDelivery, AssetHubParaId, (), >, - runtime_common::xcm_sender::ToParachainDeliveryHelper< + polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< XcmConfig, ExistentialDepositAsset, xcm_config::PriceForChildParachainDelivery, @@ -2605,7 +2607,7 @@ sp_api::impl_runtime_apis! { impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = XcmConfig; type AccountIdConverter = SovereignAccountOf; - type DeliveryHelper = runtime_common::xcm_sender::ToParachainDeliveryHelper< + type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< XcmConfig, ExistentialDepositAsset, xcm_config::PriceForChildParachainDelivery, @@ -2719,9 +2721,9 @@ sp_api::impl_runtime_apis! { mod test_fees { use super::*; use frame_support::{dispatch::GetDispatchInfo, weights::WeightToFee as WeightToFeeT}; - use keyring::Sr25519Keyring::{Alice, Charlie}; - use runtime_common::MinimumMultiplier; + use polkadot_runtime_common::MinimumMultiplier; use separator::Separatable; + use sp_keyring::Sr25519Keyring::{Alice, Charlie}; use sp_runtime::{assert_eq_error_rate, MultiAddress, MultiSignature}; #[test] @@ -2929,7 +2931,7 @@ mod multiplier_tests { dispatch::DispatchInfo, traits::{OnFinalize, PalletInfoAccess}, }; - use runtime_common::{MinimumMultiplier, TargetBlockFullness}; + use polkadot_runtime_common::{MinimumMultiplier, TargetBlockFullness}; use separator::Separatable; use sp_runtime::traits::Convert; @@ -3172,7 +3174,7 @@ mod remote_tests { .unwrap(); ext.execute_with(|| { pallet_fast_unstake::ErasToCheckPerBlock::::put(1); - runtime_common::try_runtime::migrate_all_inactive_nominators::() + polkadot_runtime_common::try_runtime::migrate_all_inactive_nominators::() }); } } @@ -3189,7 +3191,7 @@ mod init_state_migration { impl OnRuntimeUpgrade for InitMigrate { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::DispatchError> { - use parity_scale_codec::Encode; + use codec::Encode; let migration_should_start = AutoLimits::::get().is_none() && MigrationProcess::::get() == Default::default(); Ok(migration_should_start.encode()) @@ -3222,7 +3224,7 @@ mod init_state_migration { fn post_upgrade( migration_should_start_bytes: Vec, ) -> Result<(), sp_runtime::DispatchError> { - use parity_scale_codec::Decode; + use codec::Decode; let migration_should_start: bool = Decode::decode(&mut migration_should_start_bytes.as_slice()) .expect("failed to decode migration should start"); diff --git a/relay/polkadot/src/weights/runtime_common_auctions.rs b/relay/polkadot/src/weights/runtime_common_auctions.rs index d7506c558f..fe653e91f8 100644 --- a/relay/polkadot/src/weights/runtime_common_auctions.rs +++ b/relay/polkadot/src/weights/runtime_common_auctions.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::auctions` +//! Autogenerated weights for `polkadot_runtime_common::auctions` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./polkadot-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::auctions +// --pallet=polkadot_runtime_common::auctions // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::auctions`. +/// Weight functions for `polkadot_runtime_common::auctions`. pub struct WeightInfo(PhantomData); -impl runtime_common::auctions::WeightInfo for WeightInfo { +impl polkadot_runtime_common::auctions::WeightInfo for WeightInfo { /// Storage: `Auctions::AuctionInfo` (r:1 w:1) /// Proof: `Auctions::AuctionInfo` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// Storage: `Auctions::AuctionCounter` (r:1 w:1) diff --git a/relay/polkadot/src/weights/runtime_common_claims.rs b/relay/polkadot/src/weights/runtime_common_claims.rs index dee499c853..6a79828d81 100644 --- a/relay/polkadot/src/weights/runtime_common_claims.rs +++ b/relay/polkadot/src/weights/runtime_common_claims.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::claims` +//! Autogenerated weights for `polkadot_runtime_common::claims` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./polkadot-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::claims +// --pallet=polkadot_runtime_common::claims // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::claims`. +/// Weight functions for `polkadot_runtime_common::claims`. pub struct WeightInfo(PhantomData); -impl runtime_common::claims::WeightInfo for WeightInfo { +impl polkadot_runtime_common::claims::WeightInfo for WeightInfo { /// Storage: `Claims::Claims` (r:1 w:1) /// Proof: `Claims::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Claims::Signing` (r:1 w:1) diff --git a/relay/polkadot/src/weights/runtime_common_crowdloan.rs b/relay/polkadot/src/weights/runtime_common_crowdloan.rs index 54f973de48..6dea79620b 100644 --- a/relay/polkadot/src/weights/runtime_common_crowdloan.rs +++ b/relay/polkadot/src/weights/runtime_common_crowdloan.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::crowdloan` +//! Autogenerated weights for `polkadot_runtime_common::crowdloan` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./polkadot-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::crowdloan +// --pallet=polkadot_runtime_common::crowdloan // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::crowdloan`. +/// Weight functions for `polkadot_runtime_common::crowdloan`. pub struct WeightInfo(PhantomData); -impl runtime_common::crowdloan::WeightInfo for WeightInfo { +impl polkadot_runtime_common::crowdloan::WeightInfo for WeightInfo { /// Storage: `Crowdloan::Funds` (r:1 w:1) /// Proof: `Crowdloan::Funds` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Registrar::Paras` (r:1 w:0) diff --git a/relay/polkadot/src/weights/runtime_common_paras_registrar.rs b/relay/polkadot/src/weights/runtime_common_paras_registrar.rs index 621cece0d5..8b8bcaf2b1 100644 --- a/relay/polkadot/src/weights/runtime_common_paras_registrar.rs +++ b/relay/polkadot/src/weights/runtime_common_paras_registrar.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::paras_registrar` +//! Autogenerated weights for `polkadot_runtime_common::paras_registrar` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./polkadot-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::paras_registrar +// --pallet=polkadot_runtime_common::paras_registrar // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::paras_registrar`. +/// Weight functions for `polkadot_runtime_common::paras_registrar`. pub struct WeightInfo(PhantomData); -impl runtime_common::paras_registrar::WeightInfo for WeightInfo { +impl polkadot_runtime_common::paras_registrar::WeightInfo for WeightInfo { /// Storage: `Registrar::NextFreeParaId` (r:1 w:1) /// Proof: `Registrar::NextFreeParaId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Registrar::Paras` (r:1 w:1) diff --git a/relay/polkadot/src/weights/runtime_common_slots.rs b/relay/polkadot/src/weights/runtime_common_slots.rs index b81a95dc5b..e9bcadddd4 100644 --- a/relay/polkadot/src/weights/runtime_common_slots.rs +++ b/relay/polkadot/src/weights/runtime_common_slots.rs @@ -13,7 +13,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for `runtime_common::slots` +//! Autogenerated weights for `polkadot_runtime_common::slots` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -28,7 +28,7 @@ // --chain=./polkadot-chain-spec.json // --steps=50 // --repeat=20 -// --pallet=runtime_common::slots +// --pallet=polkadot_runtime_common::slots // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 @@ -43,9 +43,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_common::slots`. +/// Weight functions for `polkadot_runtime_common::slots`. pub struct WeightInfo(PhantomData); -impl runtime_common::slots::WeightInfo for WeightInfo { +impl polkadot_runtime_common::slots::WeightInfo for WeightInfo { /// Storage: `Slots::Leases` (r:1 w:1) /// Proof: `Slots::Leases` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) diff --git a/relay/polkadot/src/xcm_config.rs b/relay/polkadot/src/xcm_config.rs index 678c8d18ea..d4a18b6bde 100644 --- a/relay/polkadot/src/xcm_config.rs +++ b/relay/polkadot/src/xcm_config.rs @@ -27,13 +27,13 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; -use polkadot_runtime_constants::{ - currency::CENTS, system_parachain::*, xcm::body::FELLOWSHIP_ADMIN_INDEX, -}; -use runtime_common::{ +use polkadot_runtime_common::{ xcm_sender::{ChildParachainRouter, ExponentialPrice}, ToAuthor, }; +use polkadot_runtime_constants::{ + currency::CENTS, system_parachain::*, xcm::body::FELLOWSHIP_ADMIN_INDEX, +}; use sp_core::ConstU32; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 174abb81ed..6773a28111 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -9,18 +9,18 @@ repository.workspace = true version.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive", "max-encoded-len"] } +codec = { features = ["derive", "max-encoded-len"], workspace = true } hex-literal = { workspace = true } log = { workspace = true } -scale-info = { features = ["derive"] , workspace = true } +scale-info = { features = ["derive"], workspace = true } # Local -bp-asset-hub-kusama = { path = "./primitives", default-features = false} -bp-asset-hub-polkadot = { path = "../asset-hub-polkadot/primitives", default-features = false} -bp-bridge-hub-kusama = { path = "../../bridge-hubs/bridge-hub-kusama/primitives", default-features = false} -bp-bridge-hub-polkadot = { path = "../../bridge-hubs/bridge-hub-polkadot/primitives", default-features = false} -kusama-runtime-constants = { path = "../../../relay/kusama/constants", default-features = false} -polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false} +bp-asset-hub-kusama = { workspace = true } +bp-asset-hub-polkadot = { workspace = true } +bp-bridge-hub-kusama = { workspace = true } +bp-bridge-hub-polkadot = { workspace = true } +kusama-runtime-constants = { workspace = true } +polkadot-runtime-constants = { workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } @@ -33,7 +33,7 @@ frame-try-runtime = { optional = true, workspace = true } pallet-asset-conversion-tx-payment = { workspace = true } pallet-assets = { workspace = true } pallet-asset-conversion = { workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } pallet-message-queue = { workspace = true } @@ -43,7 +43,7 @@ pallet-nfts = { workspace = true } pallet-nfts-runtime-api = { workspace = true } pallet-proxy = { workspace = true } pallet-session = { workspace = true } -pallet-state-trie-migration = { optional = true , workspace = true } +pallet-state-trie-migration = { optional = true, workspace = true } pallet-timestamp = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } @@ -65,32 +65,38 @@ sp-transaction-pool = { workspace = true } sp-version = { workspace = true } sp-weights = { workspace = true } # num-traits feature needed for dex integer sq root: -primitive-types = { features = ["codec", "scale-info", "num-traits"] , workspace = true } +primitive-types = { features = [ + "codec", + "num-traits", + "scale-info", +], workspace = true } # Polkadot pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } polkadot-core-primitives = { workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-dmp-queue = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } -cumulus-pallet-xcmp-queue = { features = ["bridging"] , workspace = true } +cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } -system-parachains-constants = { path = "../../constants", default-features = false } +system-parachains-constants = { workspace = true } assets-common = { workspace = true } # Bridges @@ -103,10 +109,10 @@ parachains-runtimes-test-utils = { workspace = true } sp-io = { workspace = true, default-features = true } [build-dependencies] -substrate-wasm-builder = { optional = true , workspace = true } +substrate-wasm-builder = { optional = true, workspace = true } [features] -default = [ "std" ] +default = ["std"] # When enabled the `state_version` is set to `1`. # This means that the chain will start using the new state format. The migration is lazy, so # it requires to write a storage value to use the new state format. To migrate all the other @@ -114,13 +120,14 @@ default = [ "std" ] # This pallet will migrate the entire state, controlled through some account. # # This feature should be removed when the main-net will be migrated. -state-trie-version-1 = [ "pallet-state-trie-migration" ] +state-trie-version-1 = ["pallet-state-trie-migration"] runtime-benchmarks = [ "assets-common/runtime-benchmarks", "cumulus-pallet-dmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", @@ -143,14 +150,13 @@ runtime-benchmarks = [ "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm-bridge-hub-router/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", + "parachains-common/runtime-benchmarks", "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "parachains-common/runtime-benchmarks" ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", @@ -190,8 +196,8 @@ try-runtime = [ std = [ "assets-common/std", "bp-asset-hub-kusama/std", - "bp-bridge-hub-kusama/std", "bp-asset-hub-polkadot/std", + "bp-bridge-hub-kusama/std", "bp-bridge-hub-polkadot/std", "codec/std", "cumulus-pallet-aura-ext/std", @@ -242,6 +248,7 @@ std = [ "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "polkadot-runtime-constants/std", + "primitive-types/std", "scale-info/std", "snowbridge-router-primitives/std", "sp-api/std", @@ -263,10 +270,9 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", - "primitive-types/std" ] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml index 9fd39f7cf3..7f22310349 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml @@ -8,11 +8,11 @@ edition.workspace = true license.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { features = ["derive"] , workspace = true } +codec = { features = ["derive", "max-encoded-len"], workspace = true } +scale-info = { features = ["derive"], workspace = true } # Local -system-parachains-constants = { path = "../../../constants", default-features = false } +system-parachains-constants = { workspace = true } # Bridge Dependencies bp-xcm-bridge-hub-router = { workspace = true } @@ -22,10 +22,10 @@ frame-support = { workspace = true } sp-std = { workspace = true } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } +xcm = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "bp-xcm-bridge-hub-router/std", "codec/std", @@ -33,5 +33,5 @@ std = [ "scale-info/std", "sp-std/std", "system-parachains-constants/std", - "xcm/std" + "xcm/std", ] diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml index 4e58c0414f..842f5d723b 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml @@ -9,19 +9,19 @@ repository.workspace = true version.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive", "max-encoded-len"] } -hex-literal = { optional = true , workspace = true } +codec = { features = ["derive", "max-encoded-len"], workspace = true } +hex-literal = { optional = true, workspace = true } log = { workspace = true } -scale-info = { features = ["derive"] , workspace = true } +scale-info = { features = ["derive"], workspace = true } # Local -bp-asset-hub-kusama = { path = "../asset-hub-kusama/primitives", default-features = false} -bp-asset-hub-polkadot = { path = "./primitives", default-features = false} -bp-bridge-hub-kusama = { path = "../../bridge-hubs/bridge-hub-kusama/primitives", default-features = false} -bp-bridge-hub-polkadot = { path = "../../bridge-hubs/bridge-hub-polkadot/primitives", default-features = false} -collectives-polkadot-runtime-constants = { path = "../../collectives/collectives-polkadot/constants" } -kusama-runtime-constants = { path = "../../../relay/kusama/constants", default-features = false} -polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false} +bp-asset-hub-kusama = { workspace = true } +bp-asset-hub-polkadot = { workspace = true } +bp-bridge-hub-kusama = { workspace = true } +bp-bridge-hub-polkadot = { workspace = true } +collectives-polkadot-runtime-constants = { workspace = true } +kusama-runtime-constants = { workspace = true } +polkadot-runtime-constants = { workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } @@ -34,7 +34,7 @@ frame-try-runtime = { optional = true, workspace = true } pallet-asset-conversion-tx-payment = { workspace = true } pallet-asset-conversion = { workspace = true } pallet-assets = { workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } pallet-message-queue = { workspace = true } @@ -65,31 +65,37 @@ sp-transaction-pool = { workspace = true } sp-version = { workspace = true } sp-weights = { workspace = true } # num-traits feature needed for dex integer sq root: -primitive-types = { features = ["codec", "scale-info", "num-traits"] , workspace = true } +primitive-types = { features = [ + "codec", + "num-traits", + "scale-info", +], workspace = true } # Polkadot pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } polkadot-core-primitives = { workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } -cumulus-pallet-xcmp-queue = { features = ["bridging"] , workspace = true } +cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } -system-parachains-constants = { path = "../../constants", default-features = false } +system-parachains-constants = { workspace = true } assets-common = { workspace = true } # Bridges @@ -102,15 +108,16 @@ asset-test-utils = { workspace = true } parachains-runtimes-test-utils = { workspace = true } [build-dependencies] -substrate-wasm-builder = { optional = true , workspace = true } +substrate-wasm-builder = { optional = true, workspace = true } [features] -default = [ "std" ] +default = ["std"] runtime-benchmarks = [ "assets-common/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", @@ -132,14 +139,13 @@ runtime-benchmarks = [ "pallet-xcm-benchmarks/runtime-benchmarks", "pallet-xcm-bridge-hub-router/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", + "parachains-common/runtime-benchmarks", "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "parachains-common/runtime-benchmarks" ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", @@ -225,6 +231,7 @@ std = [ "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", "polkadot-runtime-constants/std", + "primitive-types/std", "scale-info/std", "snowbridge-router-primitives/std", "sp-api/std", @@ -247,10 +254,9 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", - "primitive-types/std" ] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml index 459c812e37..70382050d7 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml @@ -8,11 +8,11 @@ edition.workspace = true license.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { features = ["derive"] , workspace = true } +codec = { features = ["derive", "max-encoded-len"], workspace = true } +scale-info = { features = ["derive"], workspace = true } # Local -system-parachains-constants = { path = "../../../constants", default-features = false } +system-parachains-constants = { workspace = true } # Bridge Dependencies bp-xcm-bridge-hub-router = { workspace = true } @@ -22,10 +22,10 @@ frame-support = { workspace = true } sp-std = { workspace = true } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } +xcm = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "bp-xcm-bridge-hub-router/std", "codec/std", @@ -33,5 +33,5 @@ std = [ "scale-info/std", "sp-std/std", "system-parachains-constants/std", - "xcm/std" + "xcm/std", ] diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index b19f86310e..86c1cff6b6 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -9,22 +9,22 @@ repository.workspace = true version.workspace = true [build-dependencies] -substrate-wasm-builder = { optional = true , workspace = true } +substrate-wasm-builder = { optional = true, workspace = true } [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] } +codec = { features = ["derive"], workspace = true } hex-literal = { workspace = true } log = { workspace = true } -scale-info = { features = ["derive"] , workspace = true } -serde = { optional = true, features = ["derive"] , workspace = true } +scale-info = { features = ["derive"], workspace = true } +serde = { optional = true, features = ["derive"], workspace = true } # Local -bp-asset-hub-kusama = { path = "../../asset-hubs/asset-hub-kusama/primitives", default-features = false} -bp-asset-hub-polkadot = { path = "../../asset-hubs/asset-hub-polkadot/primitives", default-features = false} -bp-bridge-hub-kusama = { path = "./primitives", default-features = false} -bp-bridge-hub-polkadot = { path = "../bridge-hub-polkadot/primitives", default-features = false} -kusama-runtime-constants = { path = "../../../relay/kusama/constants", default-features = false} -polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false} +bp-asset-hub-kusama = { workspace = true } +bp-asset-hub-polkadot = { workspace = true } +bp-bridge-hub-kusama = { workspace = true } +bp-bridge-hub-polkadot = { workspace = true } +kusama-runtime-constants = { workspace = true } +polkadot-runtime-constants = { workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } @@ -34,7 +34,7 @@ frame-system = { workspace = true } frame-system-benchmarking = { optional = true, workspace = true } frame-system-rpc-runtime-api = { workspace = true } frame-try-runtime = { optional = true, workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } pallet-message-queue = { workspace = true } @@ -61,28 +61,30 @@ sp-version = { workspace = true } # Polkadot pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } polkadot-core-primitives = { workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-dmp-queue = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } -cumulus-pallet-xcmp-queue = { features = ["bridging"] , workspace = true } +cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } -system-parachains-constants = { path = "../../constants", default-features = false } +system-parachains-constants = { workspace = true } # Bridges bp-header-chain = { workspace = true } @@ -99,7 +101,7 @@ pallet-bridge-grandpa = { workspace = true } pallet-bridge-messages = { workspace = true } pallet-bridge-parachains = { workspace = true } pallet-bridge-relayers = { workspace = true } -pallet-xcm-bridge-hub = { workspace = true } +pallet-xcm-bridge-hub = { workspace = true } # Ethereum Bridge (Snowbridge) snowbridge-beacon-primitives = { workspace = true } @@ -115,27 +117,29 @@ snowbridge-runtime-common = { workspace = true } [dev-dependencies] bridge-hub-test-utils = { workspace = true } -bridge-runtime-common = { features = ["integrity-test"] , workspace = true, default-features = true } +bridge-runtime-common = { features = [ + "integrity-test", +], workspace = true, default-features = true } sp-keyring = { workspace = true } static_assertions = { workspace = true } snowbridge-runtime-test-common = { workspace = true } parachains-runtimes-test-utils = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "bp-asset-hub-kusama/std", "bp-asset-hub-polkadot/std", "bp-bridge-hub-kusama/std", "bp-bridge-hub-polkadot/std", "bp-header-chain/std", + "bp-kusama/std", "bp-messages/std", "bp-parachains/std", "bp-polkadot-core/std", + "bp-polkadot/std", "bp-relayers/std", "bp-runtime/std", - "bp-kusama/std", - "bp-polkadot/std", "bridge-hub-common/std", "bridge-runtime-common/std", "codec/std", @@ -185,14 +189,14 @@ std = [ "serde", "snowbridge-beacon-primitives/std", "snowbridge-core/std", + "snowbridge-outbound-queue-runtime-api/std", "snowbridge-pallet-ethereum-client/std", "snowbridge-pallet-inbound-queue/std", - "snowbridge-outbound-queue-runtime-api/std", "snowbridge-pallet-outbound-queue/std", + "snowbridge-pallet-system/std", "snowbridge-router-primitives/std", "snowbridge-runtime-common/std", "snowbridge-system-runtime-api/std", - "snowbridge-pallet-system/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -221,6 +225,7 @@ runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", @@ -246,14 +251,13 @@ runtime-benchmarks = [ "snowbridge-pallet-ethereum-client/runtime-benchmarks", "snowbridge-pallet-inbound-queue/runtime-benchmarks", "snowbridge-pallet-outbound-queue/runtime-benchmarks", + "snowbridge-pallet-system/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "snowbridge-runtime-common/runtime-benchmarks", "snowbridge-runtime-test-common/runtime-benchmarks", - "snowbridge-pallet-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", ] try-runtime = [ @@ -294,4 +298,4 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/Cargo.toml index 09616be7a4..fe7729765a 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/Cargo.toml @@ -10,9 +10,9 @@ license.workspace = true [dependencies] # Local -kusama-runtime-constants = { path = "../../../../relay/kusama/constants", default-features = false } -polkadot-runtime-constants = { path = "../../../../relay/polkadot/constants", default-features = false } -system-parachains-constants = { path = "../../../constants", default-features = false } +kusama-runtime-constants = { workspace = true } +polkadot-runtime-constants = { workspace = true } +system-parachains-constants = { workspace = true } # Bridge Dependencies bp-bridge-hub-cumulus = { workspace = true } @@ -27,10 +27,10 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } +xcm = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "bp-bridge-hub-cumulus/std", "bp-messages/std", diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 0e02e51826..56126bb031 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -9,22 +9,22 @@ repository.workspace = true version.workspace = true [build-dependencies] -substrate-wasm-builder = { optional = true , workspace = true } +substrate-wasm-builder = { optional = true, workspace = true } [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] } +codec = { features = ["derive"], workspace = true } hex-literal = { workspace = true } log = { workspace = true } -scale-info = { features = ["derive"] , workspace = true } -serde = { optional = true, features = ["derive"] , workspace = true } +scale-info = { features = ["derive"], workspace = true } +serde = { optional = true, features = ["derive"], workspace = true } # Local -bp-asset-hub-kusama = { path = "../../asset-hubs/asset-hub-kusama/primitives", default-features = false} -bp-asset-hub-polkadot = { path = "../../asset-hubs/asset-hub-polkadot/primitives", default-features = false} -bp-bridge-hub-kusama = { path = "../bridge-hub-kusama/primitives", default-features = false} -bp-bridge-hub-polkadot = { path = "../bridge-hub-polkadot/primitives", default-features = false} -kusama-runtime-constants = { path = "../../../relay/kusama/constants", default-features = false} -polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false} +bp-asset-hub-kusama = { workspace = true } +bp-asset-hub-polkadot = { workspace = true } +bp-bridge-hub-kusama = { workspace = true } +bp-bridge-hub-polkadot = { workspace = true } +kusama-runtime-constants = { workspace = true } +polkadot-runtime-constants = { workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } @@ -34,7 +34,7 @@ frame-system = { workspace = true } frame-system-benchmarking = { optional = true, workspace = true } frame-system-rpc-runtime-api = { workspace = true } frame-try-runtime = { optional = true, workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } pallet-message-queue = { workspace = true } @@ -61,27 +61,29 @@ sp-version = { workspace = true } # Polkadot pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } polkadot-core-primitives = { workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } -cumulus-pallet-xcmp-queue = { features = ["bridging"] , workspace = true } +cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } -system-parachains-constants = { path = "../../constants", default-features = false } +system-parachains-constants = { workspace = true } # Bridges bp-header-chain = { workspace = true } @@ -98,7 +100,7 @@ pallet-bridge-grandpa = { workspace = true } pallet-bridge-messages = { workspace = true } pallet-bridge-parachains = { workspace = true } pallet-bridge-relayers = { workspace = true } -pallet-xcm-bridge-hub = { workspace = true } +pallet-xcm-bridge-hub = { workspace = true } # Ethereum Bridge (Snowbridge) snowbridge-beacon-primitives = { workspace = true } @@ -114,27 +116,29 @@ snowbridge-runtime-common = { workspace = true } [dev-dependencies] bridge-hub-test-utils = { workspace = true } -bridge-runtime-common = { features = ["integrity-test"] , workspace = true, default-features = true } +bridge-runtime-common = { features = [ + "integrity-test", +], workspace = true, default-features = true } sp-keyring = { workspace = true } static_assertions = { workspace = true } snowbridge-runtime-test-common = { workspace = true } parachains-runtimes-test-utils = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "bp-asset-hub-kusama/std", "bp-asset-hub-polkadot/std", "bp-bridge-hub-kusama/std", "bp-bridge-hub-polkadot/std", "bp-header-chain/std", + "bp-kusama/std", "bp-messages/std", "bp-parachains/std", "bp-polkadot-core/std", + "bp-polkadot/std", "bp-relayers/std", "bp-runtime/std", - "bp-kusama/std", - "bp-polkadot/std", "bridge-hub-common/std", "bridge-runtime-common/std", "codec/std", @@ -153,8 +157,8 @@ std = [ "frame-system-rpc-runtime-api/std", "frame-system/std", "frame-try-runtime?/std", - "log/std", "kusama-runtime-constants/std", + "log/std", "pallet-aura/std", "pallet-authorship/std", "pallet-balances/std", @@ -183,14 +187,14 @@ std = [ "serde", "snowbridge-beacon-primitives/std", "snowbridge-core/std", + "snowbridge-outbound-queue-runtime-api/std", "snowbridge-pallet-ethereum-client/std", "snowbridge-pallet-inbound-queue/std", - "snowbridge-outbound-queue-runtime-api/std", "snowbridge-pallet-outbound-queue/std", + "snowbridge-pallet-system/std", "snowbridge-router-primitives/std", "snowbridge-runtime-common/std", "snowbridge-system-runtime-api/std", - "snowbridge-pallet-system/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -218,6 +222,7 @@ runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", @@ -243,14 +248,13 @@ runtime-benchmarks = [ "snowbridge-pallet-ethereum-client/runtime-benchmarks", "snowbridge-pallet-inbound-queue/runtime-benchmarks", "snowbridge-pallet-outbound-queue/runtime-benchmarks", + "snowbridge-pallet-system/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "snowbridge-runtime-common/runtime-benchmarks", "snowbridge-runtime-test-common/runtime-benchmarks", - "snowbridge-pallet-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", ] try-runtime = [ @@ -290,4 +294,4 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/Cargo.toml index 2ef5073045..404058b1a8 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/Cargo.toml @@ -10,9 +10,9 @@ license.workspace = true [dependencies] # Local -kusama-runtime-constants = { path = "../../../../relay/kusama/constants", default-features = false } -polkadot-runtime-constants = { path = "../../../../relay/polkadot/constants", default-features = false } -system-parachains-constants = { path = "../../../constants", default-features = false } +kusama-runtime-constants = { workspace = true } +polkadot-runtime-constants = { workspace = true } +system-parachains-constants = { workspace = true } # Bridge Dependencies bp-bridge-hub-cumulus = { workspace = true } @@ -27,10 +27,10 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } +xcm = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "bp-bridge-hub-cumulus/std", "bp-messages/std", @@ -38,10 +38,10 @@ std = [ "frame-support/std", "kusama-runtime-constants/std", "polkadot-runtime-constants/std", + "snowbridge-core/std", "sp-api/std", "sp-runtime/std", "sp-std/std", "system-parachains-constants/std", "xcm/std", - "snowbridge-core/std" ] diff --git a/system-parachains/collectives/collectives-polkadot/Cargo.toml b/system-parachains/collectives/collectives-polkadot/Cargo.toml index 94ab3b0dc3..93c26766d4 100644 --- a/system-parachains/collectives/collectives-polkadot/Cargo.toml +++ b/system-parachains/collectives/collectives-polkadot/Cargo.toml @@ -9,10 +9,10 @@ repository.workspace = true version.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive", "max-encoded-len"] } +codec = { features = ["derive", "max-encoded-len"], workspace = true } hex-literal = { workspace = true } log = { workspace = true } -scale-info = { features = ["derive"] , workspace = true } +scale-info = { features = ["derive"], workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } @@ -24,7 +24,7 @@ frame-system-rpc-runtime-api = { workspace = true } frame-try-runtime = { optional = true, workspace = true } pallet-asset-rate = { workspace = true } pallet-alliance = { workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } pallet-collective = { workspace = true } @@ -63,14 +63,16 @@ pallet-xcm = { workspace = true } polkadot-core-primitives = { workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false} -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +polkadot-runtime-constants = { workspace = true } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } @@ -78,22 +80,23 @@ cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } -system-parachains-constants = { path = "../../constants", default-features = false } +system-parachains-constants = { workspace = true } [dev-dependencies] -collectives-polkadot-runtime-constants = { path = "constants" } +collectives-polkadot-runtime-constants = { workspace = true } [build-dependencies] -substrate-wasm-builder = { optional = true , workspace = true } +substrate-wasm-builder = { optional = true, workspace = true } [features] -default = [ "std" ] +default = ["std"] runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", @@ -117,13 +120,12 @@ runtime-benchmarks = [ "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", + "parachains-common/runtime-benchmarks", "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "parachains-common/runtime-benchmarks" ] try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", @@ -232,4 +234,4 @@ std = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/system-parachains/collectives/collectives-polkadot/constants/Cargo.toml b/system-parachains/collectives/collectives-polkadot/constants/Cargo.toml index 3684a9aabf..c6f4b792ca 100644 --- a/system-parachains/collectives/collectives-polkadot/constants/Cargo.toml +++ b/system-parachains/collectives/collectives-polkadot/constants/Cargo.toml @@ -4,4 +4,4 @@ repository.workspace = true version.workspace = true authors.workspace = true edition.workspace = true -license.workspace = true \ No newline at end of file +license.workspace = true diff --git a/system-parachains/constants/Cargo.toml b/system-parachains/constants/Cargo.toml index 91de78d491..27dd92e1f5 100644 --- a/system-parachains/constants/Cargo.toml +++ b/system-parachains/constants/Cargo.toml @@ -11,15 +11,15 @@ license.workspace = true smallvec = { workspace = true } frame-support = { workspace = true } -kusama-runtime-constants = { path = "../../relay/kusama/constants", default-features = false} +kusama-runtime-constants = { workspace = true } parachains-common = { workspace = true } polkadot-core-primitives = { workspace = true } polkadot-primitives = { workspace = true } -polkadot-runtime-constants = { path = "../../relay/polkadot/constants", default-features = false} +polkadot-runtime-constants = { workspace = true } sp-runtime = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "frame-support/std", "kusama-runtime-constants/std", diff --git a/system-parachains/coretime/coretime-kusama/Cargo.toml b/system-parachains/coretime/coretime-kusama/Cargo.toml index 5bda2d1681..14b0b42fe1 100644 --- a/system-parachains/coretime/coretime-kusama/Cargo.toml +++ b/system-parachains/coretime/coretime-kusama/Cargo.toml @@ -9,25 +9,25 @@ license.workspace = true build = "build.rs" [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] } +codec = { features = ["derive"], workspace = true } hex-literal = { workspace = true } log = { workspace = true } -scale-info = { features = ["derive"] , workspace = true } -serde = { optional = true, features = ["derive"] , workspace = true } +scale-info = { features = ["derive"], workspace = true } +serde = { optional = true, features = ["derive"], workspace = true } # Local -kusama-runtime-constants = { path = "../../../relay/kusama/constants", default-features = false} -system-parachains-constants = { path = "../../constants", default-features = false } +kusama-runtime-constants = { workspace = true } +system-parachains-constants = { workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } frame-executive = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } -frame-system-benchmarking = { optional = true , workspace = true } +frame-system-benchmarking = { optional = true, workspace = true } frame-system-rpc-runtime-api = { workspace = true } -frame-try-runtime = { optional = true , workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +frame-try-runtime = { optional = true, workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } pallet-message-queue = { workspace = true } @@ -55,17 +55,19 @@ sp-version = { workspace = true } # Polkadot pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } polkadot-core-primitives = { workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } @@ -73,14 +75,14 @@ cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } [dev-dependencies] parachains-runtimes-test-utils = { workspace = true } [build-dependencies] -substrate-wasm-builder = { optional = true , workspace = true } +substrate-wasm-builder = { optional = true, workspace = true } [features] default = ["std"] @@ -101,6 +103,7 @@ std = [ "frame-system-rpc-runtime-api/std", "frame-system/std", "frame-try-runtime?/std", + "kusama-runtime-constants/std", "log/std", "pallet-aura/std", "pallet-authorship/std", @@ -122,7 +125,6 @@ std = [ "polkadot-core-primitives/std", "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", - "kusama-runtime-constants/std", "scale-info/std", "serde", "sp-api/std", @@ -139,10 +141,10 @@ std = [ "sp-transaction-pool/std", "sp-version/std", "substrate-wasm-builder", + "system-parachains-constants/std", "xcm-builder/std", "xcm-executor/std", "xcm/std", - "system-parachains-constants/std" ] runtime-benchmarks = [ @@ -207,4 +209,4 @@ fast-runtime = [] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/system-parachains/encointer/Cargo.toml b/system-parachains/encointer/Cargo.toml index ed55e0f845..a36eba2f53 100644 --- a/system-parachains/encointer/Cargo.toml +++ b/system-parachains/encointer/Cargo.toml @@ -9,14 +9,10 @@ repository.workspace = true version.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = [ - "derive", -] } -hex-literal = { optional = true , workspace = true } +codec = { features = ["derive"], workspace = true } +hex-literal = { optional = true, workspace = true } log = { workspace = true } -scale-info = { features = [ - "derive", -] , workspace = true } +scale-info = { features = ["derive"], workspace = true } smallvec = { workspace = true } @@ -53,7 +49,7 @@ frame-system-benchmarking = { optional = true, workspace = true } frame-system-rpc-runtime-api = { workspace = true } frame-try-runtime = { optional = true, workspace = true } pallet-asset-tx-payment = { workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-balances = { workspace = true } pallet-collective = { workspace = true } pallet-insecure-randomness-collective-flip = { workspace = true } @@ -83,21 +79,21 @@ sp-genesis-builder = { workspace = true } pallet-xcm = { workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus dependencies cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { features = [ - "parameterized-consensus-hook", + "parameterized-consensus-hook", ], workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false, version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } polkadot-core-primitives = { workspace = true } polkadot-primitives = { workspace = true } @@ -110,19 +106,24 @@ substrate-wasm-builder = { optional = true, workspace = true } # so we need to copy all the contents from `system-parachains-constants` and `kusama-runtime-constants`. # We use these crates only for testing to ensure compatible values. # NOTE: Do not add this to the `[dependencies]` -kusama-runtime-constants = { path = "../../relay/kusama/constants" } -system-parachains-constants = { path = "../constants" } +kusama-runtime-constants = { workspace = true, default-features = true } +system-parachains-constants = { workspace = true, default-features = true } [features] default = ["std"] runtime-benchmarks = [ - "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", + "cumulus-primitives-utility/runtime-benchmarks", + "encointer-balances-tx-payment/runtime-benchmarks", + "encointer-primitives/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", + "pallet-asset-tx-payment/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-collective/runtime-benchmarks", "pallet-encointer-balances/runtime-benchmarks", @@ -132,26 +133,21 @@ runtime-benchmarks = [ "pallet-encointer-faucet/runtime-benchmarks", "pallet-encointer-reputation-commitments/runtime-benchmarks", "pallet-encointer-scheduler/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", "pallet-membership/runtime-benchmarks", + "pallet-message-queue/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", + "parachains-common/runtime-benchmarks", + "polkadot-parachain-primitives/runtime-benchmarks", + "polkadot-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "cumulus-primitives-utility/runtime-benchmarks", - "encointer-balances-tx-payment/runtime-benchmarks", - "encointer-primitives/runtime-benchmarks", - "pallet-asset-tx-payment/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "parachains-common/runtime-benchmarks", - "polkadot-parachain-primitives/runtime-benchmarks", - "polkadot-primitives/runtime-benchmarks" ] std = [ "codec/std", @@ -166,8 +162,10 @@ std = [ "encointer-balances-tx-payment/std", "encointer-primitives/serde_derive", "encointer-primitives/std", + "frame-benchmarking?/std", "frame-executive/std", "frame-support/std", + "frame-system-benchmarking?/std", "frame-system-rpc-runtime-api/std", "frame-system/std", "frame-try-runtime?/std", @@ -187,9 +185,10 @@ std = [ "pallet-encointer-reputation-commitments/std", "pallet-encointer-scheduler/std", "pallet-insecure-randomness-collective-flip/std", - "pallet-message-queue/std", "pallet-membership/std", + "pallet-message-queue/std", "pallet-proxy/std", + "pallet-scheduler/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", @@ -198,6 +197,10 @@ std = [ "pallet-xcm/std", "parachain-info/std", "parachains-common/std", + "polkadot-core-primitives/std", + "polkadot-parachain-primitives/std", + "polkadot-primitives/std", + "polkadot-runtime-common/std", "scale-info/std", "sp-api/std", "sp-block-builder/std", @@ -215,13 +218,6 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", - "frame-benchmarking?/std", - "frame-system-benchmarking?/std", - "pallet-scheduler/std", - "polkadot-core-primitives/std", - "polkadot-parachain-primitives/std", - "polkadot-primitives/std", - "polkadot-runtime-common/std" ] @@ -230,7 +226,10 @@ try-runtime = [ "cumulus-pallet-parachain-system/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", + "encointer-balances-tx-payment/try-runtime", + "encointer-primitives/try-runtime", "frame-executive/try-runtime", + "frame-support/try-runtime", "frame-system/try-runtime", "frame-try-runtime/try-runtime", "pallet-asset-tx-payment/try-runtime", @@ -245,8 +244,8 @@ try-runtime = [ "pallet-encointer-reputation-commitments/try-runtime", "pallet-encointer-scheduler/try-runtime", "pallet-insecure-randomness-collective-flip/try-runtime", - "pallet-message-queue/try-runtime", "pallet-membership/try-runtime", + "pallet-message-queue/try-runtime", "pallet-proxy/try-runtime", "pallet-scheduler/try-runtime", "pallet-timestamp/try-runtime", @@ -255,15 +254,11 @@ try-runtime = [ "pallet-utility/try-runtime", "pallet-xcm/try-runtime", "parachain-info/try-runtime", - "encointer-balances-tx-payment/try-runtime", - "encointer-primitives/try-runtime", - "frame-support/try-runtime", "polkadot-runtime-common/try-runtime", - "sp-runtime/try-runtime" + "sp-runtime/try-runtime", ] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. on-chain-release-build = ["sp-api/disable-logging"] - diff --git a/system-parachains/gluttons/glutton-kusama/Cargo.toml b/system-parachains/gluttons/glutton-kusama/Cargo.toml index e5014e173e..192e6a9721 100644 --- a/system-parachains/gluttons/glutton-kusama/Cargo.toml +++ b/system-parachains/gluttons/glutton-kusama/Cargo.toml @@ -9,8 +9,8 @@ repository.workspace = true version.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] } -scale-info = { features = ["derive"] , workspace = true } +codec = { features = ["derive"], workspace = true } +scale-info = { features = ["derive"], workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } @@ -37,25 +37,28 @@ sp-transaction-pool = { workspace = true } sp-version = { workspace = true } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-primitives-core = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } -system-parachains-constants = { path = "../../constants", default-features = false } +system-parachains-constants = { workspace = true } [build-dependencies] substrate-wasm-builder = { workspace = true } [features] -default = [ "std" ] +default = ["std"] runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system-benchmarking/runtime-benchmarks", @@ -67,7 +70,6 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks" ] std = [ "codec/std", @@ -121,4 +123,4 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] diff --git a/system-parachains/people/people-kusama/Cargo.toml b/system-parachains/people/people-kusama/Cargo.toml index a4e7a9d11a..58016385c7 100644 --- a/system-parachains/people/people-kusama/Cargo.toml +++ b/system-parachains/people/people-kusama/Cargo.toml @@ -10,11 +10,11 @@ version.workspace = true [dependencies] enumflags2 = { workspace = true } -serde = { optional = true, features = ["derive"] , workspace = true } -codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive", "max-encoded-len"] } +serde = { optional = true, features = ["derive"], workspace = true } +codec = { features = ["derive", "max-encoded-len"], workspace = true } hex-literal = { workspace = true } log = { workspace = true } -scale-info = { features = ["derive"] , workspace = true } +scale-info = { features = ["derive"], workspace = true } # Substrate frame-benchmarking = { optional = true, workspace = true } @@ -24,7 +24,7 @@ frame-system = { workspace = true } frame-system-benchmarking = { optional = true, workspace = true } frame-system-rpc-runtime-api = { workspace = true } frame-try-runtime = { optional = true, workspace = true } -pallet-aura = { features = ["experimental"] , workspace = true } +pallet-aura = { features = ["experimental"], workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } pallet-identity = { workspace = true } @@ -52,30 +52,32 @@ sp-version = { workspace = true } # Polkadot pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true , workspace = true } +pallet-xcm-benchmarks = { optional = true, workspace = true } polkadot-parachain-primitives = { workspace = true } polkadot-runtime-common = { workspace = true } -kusama-runtime-constants = { path = "../../../relay/kusama/constants", default-features = false} -xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } -xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } -xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } +kusama-runtime-constants = { workspace = true } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus cumulus-primitives-aura = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , workspace = true } +cumulus-pallet-parachain-system = { features = [ + "parameterized-consensus-hook", +], workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } -parachain-info = { package = "staging-parachain-info", default-features = false , version = "0.8.0" } +parachain-info = { workspace = true } parachains-common = { workspace = true } -system-parachains-constants = { path = "../../constants", default-features = false } +system-parachains-constants = { workspace = true } [build-dependencies] -substrate-wasm-builder = { optional = true , workspace = true } +substrate-wasm-builder = { optional = true, workspace = true } [features] default = ["std"] @@ -97,6 +99,7 @@ std = [ "frame-system-rpc-runtime-api/std", "frame-system/std", "frame-try-runtime?/std", + "kusama-runtime-constants/std", "log/std", "pallet-aura/std", "pallet-authorship/std", @@ -117,7 +120,6 @@ std = [ "parachains-common/std", "polkadot-parachain-primitives/std", "polkadot-runtime-common/std", - "kusama-runtime-constants/std", "scale-info/std", "serde", "sp-api/std", @@ -198,4 +200,4 @@ try-runtime = [ # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = [ "sp-api/disable-logging" ] +on-chain-release-build = ["sp-api/disable-logging"] From 2f8a10ecfa26a999379135f01852f8649d27597e Mon Sep 17 00:00:00 2001 From: Clara van Staden Date: Sun, 19 May 2024 14:54:22 +0200 Subject: [PATCH 12/15] Unstuck Snowbridge (#313) Upgrades Snowbridge with an Ethereum client fixes: - https://github.com/paritytech/polkadot-sdk/pull/4504 - https://github.com/paritytech/polkadot-sdk/pull/4482 Adds a migration to reset the Ethereum checkpoint. Will be reset again to the moment recent checkpoint before merged. TODO: - [x] Check migration works - [x] Check converting Sync Committee to prepared keys is OK for a migration --------- Co-authored-by: Adrian Catangiu Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com> Co-authored-by: ron --- CHANGELOG.md | 1 + Cargo.lock | 4 +- Cargo.toml | 2 +- .../src/bridge_to_ethereum_unstuck.rs | 122 ++++++++++++++++++ .../bridge-hub-polkadot/src/lib.rs | 2 + 5 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_unstuck.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 26b70a801d..206de34099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) - Safeguard pallet-balances against consumer ref underflow ([polkadot-fellows/runtimes#309](https://github.com/polkadot-fellows/runtimes/pull/309)) +- Polkadot Bridge Hub: Unstuck Snowbridge ([polkadot-fellows/runtimes#313](https://github.com/polkadot-fellows/runtimes/pull/313)) ## [1.2.3] 29.04.2024 diff --git a/Cargo.lock b/Cargo.lock index 2b5dec6ee9..98cd39b3c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13052,9 +13052,9 @@ dependencies = [ [[package]] name = "snowbridge-pallet-ethereum-client" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb89a9f375672031669fef4b2f4037cdf84dc1624ebd204c5cea839a0844bcdd" +checksum = "e41b74c0509a263bec0b86a5892d3a5fbac0084fc7f7b2e5cc523119ed91c7e3" dependencies = [ "bp-runtime", "byte-slice-cast", diff --git a/Cargo.toml b/Cargo.toml index f9c0c920ce..37d5374525 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -189,7 +189,7 @@ smallvec = { version = "1.13.1" } snowbridge-beacon-primitives = { version = "0.1.0", default-features = false } snowbridge-core = { version = "0.1.1", default-features = false } snowbridge-outbound-queue-runtime-api = { version = "0.1.1", default-features = false } -snowbridge-pallet-ethereum-client = { version = "0.1.1", default-features = false } +snowbridge-pallet-ethereum-client = { version = "0.1.2", default-features = false } snowbridge-pallet-inbound-queue = { version = "0.1.1", default-features = false } snowbridge-pallet-inbound-queue-fixtures = { version = "0.9.0" } snowbridge-pallet-outbound-queue = { version = "0.1.1", default-features = false } diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_unstuck.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_unstuck.rs new file mode 100644 index 0000000000..1b00e18b26 --- /dev/null +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_unstuck.rs @@ -0,0 +1,122 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +use crate::{weights, weights::RocksDbWeight, Runtime}; +use codec::Decode; +use frame_support::{traits::OnRuntimeUpgrade, weights::Weight}; +use hex_literal::hex; +use snowbridge_core::RingBufferMap; +use snowbridge_pallet_ethereum_client::{ + types::{CheckpointUpdate, FinalizedBeaconStateBuffer, SyncCommitteePrepared}, + CurrentSyncCommittee, InitialCheckpointRoot, LatestExecutionState, LatestFinalizedBlockRoot, + NextSyncCommittee, WeightInfo, +}; +use sp_std::boxed::Box; + +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; +#[cfg(feature = "try-runtime")] +use sp_std::prelude::*; + +const LOG_TARGET: &str = "runtime::snowbridge::migration"; + +/// Last successful imported beacon header +const LAST_IMPORTED_BEACON_HEADER: [u8; 32] = + hex!("8ea383d85a87a2e27b088571aaf219231c1f6b3510d7be3c160eb1bd93dacc25"); + +const NEW_CHECKPOINT: [u8; 25122] = hex![ + "80c58a00000000009cde110000000000f118ba039276d46ba87cd50790e2547060aa6cd260476bdb499dc38ef834d618910884d25c9608dfe669a39ae64814db99553d82cd7a5bf5808240d2dbef04e6035075425a8cfe9d2bc194fa1ce245681e84909e4159e0c5cc1be7f876ff57d0af821d9b65aecbfd133c02eeecf2d8f64a164474274529f0a0fa9f8ab033cddc183b5dc028ccbc6c27887cbd65da8d4b8d6983ebcf4a910e6e2403b68f52628fb555e3486e21fd446483ed9df35377b07851e0e07803b7af34cc02494fe7a71fb32ec66a1c279dfa9e12b96b4a1e44fd1d3ca5db007ab2b953f6708514bc65ea545ad562b10a900bf3d9b25b5153d552ac07a256fe4f7761a5f9fe130c8e65b8f35ec53499db3a67c630148b7baf1ae8b79c00ed0c5f8f808bcb9e01cdeb963d8a6319e82af0f8a64b1819e2b21ddd3b07b74c8ef2bf01450a4bcb4180795b745f2f11c449223cb5590c155b284ef45ca108dd0c6e2ebeeb1e93bf710e1573e1cf7d2e3ce4c45cd5e5cc6aabfb110fc1c748b6a22677b333aa36d283f3d99eb09577cbd44b3fe69dea5d5651887877aac4f7f7eb0856e272144e187aeb92df3bc4b789b16ccc3b9f014b60b56159692db7f9ec5f2bbf753c0e19a5a22400b614c45da5ee07ff2a4558c2038f3772f2da1772070d65ecf063b908ad751a192cf1aafe980d1b628aff8bb34f7cead01aa4baf5d8be084e112f2cad65561c40a0932cbda6d5d37d6650500f14b7269575e1ac157dae537eab19abb957f40043c71954cde60e164200f453233a8b77fcf8ffe5d95463b486da0e6e873a1a00d3b04aa4f0672ad6b6d03180cc0a089adcf50b7e3688c68b47d1d5812972cfd5952b4197c414bfad6025d8c8f060f16edcf8ba8bb9075672310a1e10745e4e90fbbbc61f2fcecf5399045b103317086f544bef7b5414e373401b13893a7520fe0201de90c58991af476a86d9eec14cfd0baaad4278204b6d822cd32414da207ec86da840cefe31c5cbfa6ceff0546294c296e6aa5683093bf0a69ba502c89e50a6084b899a36f3d60db2dc9ba128210c4e75d76e83799132cbd4fdd9fd17eb704703cea9df391c83d66a2d7ab894cb5a15a575d1e71389b8c57d63ea48017254c02c106c64b3e8aa0c2f33b9af3ebc44e541aca5e69cfae22549ee562eb8e825d81830317e565d04563ed05fb8682f1ff79e0c855990e03a9d18ad8ce8983fc55deb5398b333a26db57d0e690ef6ad56d85512859d9bea389877d01d3fd8ce1a0517c87ca515b12ac524c47439b2c4c00b553f8a9a6831fccd0641f8eb33c0eeba8cb5ed88e035f5bfa079644258f5077483b45589d5cf4b53915bdab34d4030dfa8ad85af76e194db58d453df3411431cbbd8dd19e619ff613cc3cc9e88745bd1b3d24422d3dd4ebd82467bd232600401a39fa3134a2cc099b690158e52694b2141ce2979ee84416d8c89f55c23cfab2804e26fa2f58e96fa9d8e7f7fa8c33022247ca0cd1808fbccfa4f3dc4e70ed62e031598f4776745fee59bf0fd5369246ad97c2f2798e808fccf295ce5f8ad8e7e70268d6667508104ed10beb70a794196a3b7c7e7188e766d9a68d32ba7297f9f916e7e20f5afe0a758dcd16953dd81ed2ef48f4d8bc8190f601dd3da1df6f78ded9ced42b00a310957f65ae029e7e170d106e9593dc2df9b54d9d6692ab68e9d42688304fe8257fdade19bca9d162c83b3bac4b6626979a8fc77f49105f49103d55374bdf18e1638be1d8db2945dce2a9b7ca3c772605f9059f0754a06cd170268ed71a19419ec3c88bacb63bed8086c29322bf2d5ede197f3dc626dc83fcf7d3ad2aa959d28c9f659824abd2e7392a2658f1cda46be4fccca644292573c21ba76cd183817fe7d59641bb39a369f4b43237eb752ee6e0647a94c0cd1ee669010a851f133e7d674bf23e6ba23028bfcf6ead7d960833ddf004e335b83ee062938bf9183c99d97a411ee79b18725de81a5131e8c8f0e5dcac8837d036ed9c85cc02314994d865c8476e63100deeb615722ad6f8110b209ba9eff76fbcbff25b1d83f31e7439c00ba009d8ec4f87d32ed566e7f516e7dd48d085808641df325942b46d98b616d8bf622147f24e180a6be27fb74e042439e19ab3c73f833439a86dbbcd4e0ac43db4b891b67155ddb007d2475fbb070e847fa254273b63d0bad326ba60dd8c0849725be0496d270c2cb30804da546d94b3071e6de53a2ccd167acaa2439920e9c77e475fc120a12d91be2176a87f6c7f57061fba362e5c38ebd01f01c659c3631bccfd6973d68beecc3b363ba5ea9fe3918cc7629672fda8922852fdae18a99ca7536861c73a6f241440fb9116ffb3c9144d649d00255a4f15b1f6afa5c88e59885eae06fa271e0e1ab7b5a1b4ce2827d3e2cb309ae2d58e98a926d2ed525a8e8e1d4bb55f621eb6f688ba7184688819bc8aa9e95b114b78584247ab2f7e8c217ca0de8e219646f9c0184d03f292bb3138feebdd38de30ba4951cb1665a81994db24b5105ddd683075f6cf5f884ce7ee6525dcb09e04903424d7b8610a4be604a89d099d71d038091eca1a6317291e4fdbd84837621ae37182bb9eedc4182c1b3e3af35491cfa701ae2f55522c2042e7d8a93a54c2f505b62a748e1377789780f6fd9c54981e93f76b65a7c0010ce6f84bf03154c2d75b1da316b9dc62a2f62736944cb935f2f985da9f6fac23ea4d578136a1b3cd1ad29818cd02e9a72da1779f07c7a9f88b4e9fef6ae1db26de2946ba6edaa1b43fcb1c7e10ad49b9d84d060c6ffe0ee4f2fdcc34d27601a6bb3fc326b7dd600aed38ebdb605282d7346c990194aa7bc8775a1dd5f64c61abe8b375d61223917fc8427e659d431a27391ea0df523a25e96210e17ca85cf5a4f5f6fb6b5c4473b4b92c62609bf31e8bf8402e391e3a7ae63d4aff55a17ac1d97620b97983e3ca421a81ab97f811921df29e09948dddb325945e3a7c53fd68c9c9633321afd3873ce4ebb4a6856b4a4caf2e57a2e2532a20bd768404e84d2b2044b22f9b2e8f76946029db8b84290f6ed94df22c8596dd9c6bce3cdaadb43bc90d1f263e64bc00863fa218495994cd4b42025b22d257d3ab275ca382ee10231e8850ada2b50d0fd507b34c0b74b13d1794ea68c1d594d221ef84f9557bb43495f9652e3fdee490cd327116aba0bde4812a95c47955ea446dd6548aac044e14798beccee03b10a59ea6d9a5a2bf6e6bba2f2130128a29ead57203869d1fff9467d835cf8e7ad3f3d2fc077dfe11769982b2fa5e94379c3a2087edf3bc587d27987811204505bd74d8ef13acbec609ae24793f5a2b101eca199dcfaa4531a987b6524018fbe4c9ffc95985096a67bb041c37056498dc3733b5be3d6d03a001b418ab4c0ef72c609ff263136e14c16e9ffcc8a2c6ab4b3b1bb730feec0a1ae7c15fed5509ddef0e00b8de4dcfdb93be4e6ac902462ae732c20a79209499b9b87870e0476d016889a60ed361c5353020a3ec98e34e63b9f3182ac02fe66da7efbb1a3895c727cdca56fd43edd20bff709ce5f86fe5f9c880c11ec739b9485c0132efeca6f6014be637028ec04a36b57345d5680ca76837e1aa7f14999c928578daf668cea7358c4110d88abfbe25380352feba160638608ae27c8336fc4fccccf4eb0abe8942f11a77c6a39786aa8287ecff1af4732e63c834f325d0719e5870914a7ee8cd22592c42b6bbe86ece668f7b75ab921fb30979ea979d9a67dc6cd4b3ae2cb3751b35f51c7c8fcd75505d656d10fd54bb1afa2d24afe1502740275589f07b5371914d703690da14b54285e8943f0e6c532a977f5fc3c1564048b19d731cba84f69c076a823353ce020094fb46c5784c2098313f99c96c539258b59630de96d217795318faa7bbdc52aa37525c7091c8574c4a9a03b5cbf80963facc40ea68ec48cc24f71f3337c8f7871aea9a18aed2b1664c9c5f5af76dec55f74bb441abc21da357de621473325018aecc06917aff025087275ca4f964b8cd945c7c41964fea49386cb3ed22036e0474cc2def65a6a380f9a120e5560722b942f5b88369817d0a965d6482ab324b7af23bbf854a41fc2510c2898712f6177f9990a2587a2fc9d2cc0b7ff3c07b5ed0ea20c24bbaf58d5a29ab1c64f42e8d94ba4400c65a90a6ea0a7d2623dca1b2e4f74a4374faef87e0a77b09a1b45558a9b81b9402b933317fce57824dca4b911f066892672e667f37ad0a750e09802784f2a0f6ca3a675b5f6a6e76e96ed60a36cb09046b39975f8575adf33e2b0ec9eea1cc61ec6364a0ebae32e9902129aa3b174c0332bd338a33dd91cd8159b47b10883b32a4ba60759c14f12b8741582bce5cfa0f7d86743e0da364170d9677cf448d7fa3590256ea01dcf11905726b88b15056236d8b65ea63039efd66b7fb4f168e6ff46fc5f7d7dc734d2d406153340788216a5df6ec9fa169ac78540cedd4fd9a00382798ed054223ebbac19c32a0e02b9a27c5db531e507c1855fcb354bea4e484bb30bef99bcd63be47e4d3d4a4e0249f41588a18519584d6086e0b2039b5d14130a4b6aa53a088e98ac24da38b83b8f1801b612370c71613612bae8e5f1ec6e07260fa081bacbefc947bd612ab85eafe775db1aac43fd4abefc58d49aacb57307b29ac2ba517af4e7b26d6a836338d6c8941db0bbb9ea279d33bdb9632be5ffd687acd2b9003040d346aa947425b475d04333b54958b6f4600f7d7456050f160e2a078302e7011c634abff5e0dc08880d5cf6ec705f94951273125ee1886396fd14df2ebb8f39e6171876ad7eb0797e97facf88217ecb60eda8fb336efd13715928f1311606187e38e0d7a4cc94d9a1a0c36aca43f3a98440724e8704b935fb52a0d9aeb1b8861c6a7c4535af798f2d46a769f897bceceaf1f5fb55986a40567a8d13731b4274787ac1995b77d08d780fe788b45ac80dc136504f7e1f8a96f55add4bc347ebcadac13dc5f43436192b7ef765a23dd8a82083dafd346a8ed35890a855a0856abe09f943f27d2ae609efb77499ed7fbac5f5d6ebb58bc1aa061fe70397143434f1b318e3d9aa8f5daa5543f7af91f534d2193d7a09097c373ebbcd9982c24bb1ef2c3b6125466ed13ecf5776c032a3bdd2a77107d6a1323fed662ee74a8650bcf27ba22e9c5172c069b0db13a03a0aa7e689a0c6cccd03b894348e2b88a577921a1934a3888a13c4219057df4393158c7202ed74ba8ccce6491af1b143758cc25e4261cac346a38761c0a6a24f275e1fbb117e9fe566a555e86ec79072ab3e3c17471bd6fd429af98b00b8abe4cbb397660351dcdd941bd3c8b6f77ba9a6f7bfce57d1820273a8000b9a9cc23fb8536bdac8a3f780f0ad86964828ea9be5595640b4a7a6c14427d7cde445d1fa4985a032beaaa5ad2d47bf2a536f25fd855247c5e229f5084f4d3edce308fc0e3e92c00ce3ea6b6c81381cab6d769c81410b76120343202a0fe78b083c4b3da0a5a16d4169cbe2f18fd611cff69d75673dbb01dc2e288335644825e3297a6b94ef4407036fc2c15109ac307d8c83ab4d8029afd1213fc4c2df73da3eb545c6c55cdc003bbf6bd302c8a792263c2ffb1acff931957e761bd98ada159b91c5db7db9cc5708843bb0ff18b82d85d51f9227de4a5292d4cad152bee03e97007f40dff61b9f326121e4d533322a8a04cc5421aa4fbc8256bd21c37943bc25be49e8ada61e5f240c754dae5fb242b5f4e101317143d0f7da29a42dc81dac6987517ff085cc9b2eaf258fc97aba502d83e38247f5ed56a7eaacc68f850b3541a435304344f3b466925cdc531d54ea55988271c18f993ff6ac2f02a4c1f1aeedda7c20082dd5a7c2291e1ee60a449a6b8f66f2938af7b48a2ba01b453cc2d98baa4bb2449139c3cd4436daae2c1f637c8f7fee6e3897534250f313ddd3417bc92b0129c347c648d7773c79655b4aec68623b2924aee7da53e8ba56772cd6520a5c6d78b553627f3de75b056bc618ecb17a94b4d6b60a7164b024a693e526bb32e97f612b92e6a798b10b774f3cc7886a3bf419c0562801baa67fb28b3c02909bca1d542cd6da0f359d6a89aa73760b8d3642e3e688294ccf604369978ae4c9b220a9661205ba7a1fec3e96e2e10d73af9af284d7218dc9c249c6fd5f339ceb3380cea7f5b9ca305c04d9f0322c827bfd5ff8704d9a0b95c10ef7a4e3a332ac2e227beab26f367fd5a61ecdc228c73455890e935d949dfaa52ca8e65dfd5be9d73c4be0f8d2c0666c688de7e98de4f567627d3aedee8eb7fc75c4ab573e3fbdc7adf0d934a25d5312c8ff2cebb7959177aa440fb3a7cc8f4b85dbda4c65524df016c7e77ef90b11038e6da568d6c04bec1d53740d8d0e669d7a7f9ac3e979e816194cbdc54ae7fdee3d793a0006d415e048fe4e0f3f69c04bde7bf192686e53f7783fe7caaeee6019ceec793e54f3d0ec024e9feae6f643b8826dee65647b9f53a51509d36464685f44e1964eafb98b825d53ee3a8e9f85894ad6097a5cefe8daf6931ea7033400c7808d6be6cbbd244a6a694ec9bb3602a1bffaeeb3ac266ee3dafb4a0b8af48486c8c682e70597d5952e78a5fb01137dde04b8dc0af662de6b8a33a890f40e3c68c1c49dba60fa5e7e9d8d1414a36b0394acb7549bdd405732d118ce9e18899f897ada4be16a73a5d2f8e83b36d1370e0d71a3f0b1ab6e956ae959fd878374a31d52c8f6a5a30442652760c9de032cd6e1f621cd557b802777f290fa716771bd240f23217c2993a56aff4205f5b233e4403d73c719b6c483c0ee81c51056125793efd502e3b7be54138357335f7ed5370be3baf470ed7287a0da23815690ccd6d59c55ae1b272d46d2d57d7186e8b2550350b023b09cf34947fa86f24ca0b8b71a3ae3933cf8aa43afc46d87de82b57b3fa83e09e87ac43e362625ffddc02d4bf35f1514f755ebae9aea374dc7720319d4f80d4c9609d0970f16ab5b6ab96d10040777e2ba8dcac635a9358e636fe84a4c9794ee9f7c9e6b4682a4c9ec5b2a594071eb34a5c581d1288678dac0b525b459f96f377ba56a1eb1ae9275d70d33c3d4741e66144ea92f880fb154ce6d5dd8fc74fba41d12e9d66c859a8cb892df9a8d9398a80fd1a746ed19cda457c58fac722259a67573b7add86ce157cb3fd1e01c077e93a1560b2ff3c79c4cca88100a4cbd6e0a40fa3631d1de6e035bc197ab7573f10eddcca678433f231dd23ec2fe50652473af6133bc8c1033953baea90012e2878afa07e842f8b47a328ca9df0d21b58ace0fa8e7e501a5b03313764c81e2786e9489fdfe741521bd4fe299548e89bab19e8847ab274d0273f70f52e71e9003d42a7276521750e5c0792ee01cea2be884920f52075dcd02e9e25c8307dd499764fc029717c2ae5178607d17a730978a8896b6bb3b97b47cac98aba15ab24e1bfbefc5a2f8e2ac0c4eef44b26917de5e7d8b7330fca531689569fbe31003b760c6f4bf17460eb51d21c11b4cb8ac3bb28ba7e0c16d35104d92b1738e84b31cd27408d095984d8d0b20e0386e4e4670f34d0e8a0314500df98a568303486dac06ee4c6b14e1747062c34af8ae21b715a30e4654806717a334660155b8ef0d713e7cd2d0ab0386016b90eaaf8468e75bdedb81aa9f3467a86e012916afc5ed65ee4542016b22a6926c58962decf0319b73397e000a8ac83245564e5ba5adae8e0c76eb64bc4a82e05f9b376185aa44aa9ae831f3b2338badaff0436c57c38e9f3242aa9c9f7c00807a9ac8a97ed812c5ca69767766f87ab3711cfd478f6f60f9218c32a1c5d9d7b5bac1c1093b399c46f3270e26f035fee1e5b2c9680298b570a2db6fc8f2ed1c5b9eb65c8b915378db43893c9f4ad7026c4867f04e286d26c70e52fbfbd0420c4fddc0179675d2b2a5b7a7a3bc325967566662192b93e1fbec87f90e4861809e84e5a691bb1aed7b03797036c668fd07aea5d5586d1ed72df9fce56a6c599bff50a70086e689fe0d102e078358e4ebcf70746e7b86ba97ef46eda5927fcc5bd63564794ba207b1d85a2b38ec7a93e84768962ac23cadd9e4d66daf8f9772ffdf311a1d28fcd2187b8a5f83b03c64dc49660f630303ca5d8e37e4169dfdbddf490dd8f226b29774d95082314ff6112ae77869e72886c7a93bee730897b7d38ceb673d4030283a248b66c62c9554e3236655486c214baed7631a301fe780d283adb6fede12e43e848f81f16b36f97149263fa6bf54484c201f51665e2532f6b29d4037a19bb798d5d73aba460e78794afd7f3dc2efe998eacc597a27ae8c7d0378a6aa42dbbd2606b9a9f0045adc22ca004ac27a7e0b87d282c2102797566e215a456cd34e754c67258a067db1a6af16ee8dd50a863da3939ea8f26e89c5e87c3a35dfbe08a98c0f2a45b297609ae574173d9cd07955814ba24fd0810b686a6a6487a34bdadb76cbe8d7a100e29eb66a4d2ab72df6738d15092f519d8cd1ff5724e359d2cebc2ace815c4c11012aefe433e176b394315c6ff6b31d745b65de56fd842c78de07a1b22652fcd11a340caaf56626a999625d32d762c81e097f4d548d94eb075849beeed2d57c40ff9a545371ce9bd9f42caea334101a01afb0a73bfce8fa0c6ba88e9c159f8009701773f2b9d79f48bb793c04fedf8278efc1a54c1f77a1f8ac4e83e784054e76160e05af8b06e565a5eef9b06e5623f5c0dca6f2c741de8e71241d94055e0115056200cc5a5de25c4cc3a7507e3b153bddcd89bbd9faa0e13c30c6aa4f3b8b28e7436b0564625c15e7425ca2e1dfcdab8a721d5a01314e23358e991ae4eaee313c8efe723b19a22ea8f857667afd92267cca94bc82d6bd73f4a935c2f32d79dbff17f9e54b463911d81d80b3c9d98d45e7a93c3b6198ea8b8223f2223950196950dcd4f5f4d81423d61c682c040b2748e57dd3e51b207b4bb1658fa013f1f6ffcffb5a3df119753e65619a5dca4e507f510360721e37654b76771814fba673e1c8ef24ebcf91f2f7d08db30da1a1b0bf3300a66d992072f15daddfb5d08a08942f14e854dc29c3029f6c27968118aa2d23b528148a6e70f2438faacb3c4ce494dbeef03508206826ca8b0bada57796f4a4cace53a1339b41331dae0c6cd3f620ec58d04dfdb03d0710da8cbc876ba222b16ede82ec4f8839d42d8d92f4e67f804baf44790c00918f7e231d6b79016cccdb2efeb7858e1e9e4a1eaa67ce4bb608790b09894b06bd0803684ef706c0ccdea713ea7ee376d9d6c9f676efecc91ea317cccfebfe465edf03278410fb011e5fbf8d50192e98bc0f65aa4a8615e44660d3e047e2703d60f7a6d08d468611fc0b1a0f16d3293842c80a3fa7de450ef0ae47a084763780da1d7e9755b80fbb07ec7304d1c19a7f6dd3c2878ecbeb46706d9939922b92b3390dd918a11eedccee7188a65503c983b8804acec6bced9dfccde579891a1a884a4000adb864d8f9be54657d653713184a81225a83f314b07e32fad554ae49697d5cd9927761fb78eae1e8571efffc50072b44a3d229e07cd8cc57751a33537e66ddd2e4950793b39d471821a8bb26943e0307d924e82d3adb7fb04dfbbc1b1b832643d84362f465a8ba7bb8543ab793caea761c9986b845aa2ae3d99604185bc12c25019d5a981812348c662cae1795aacd0eea8609ea2dfaa0e772e9aea92d2d654305ab6a0068ad1475fe14f733483b03e768562e563739a412f4d3eff2ae6c19883681e3b22432943b32d9ebc6941674deb3920c52624605ad196bf1f8146689872672ddba241100425d7b73d8ce99f141de338f94e3e6e1a9bd8d6ccc8dc87e585ea8120121308ab58517549e87e8d9e358f7c653af923c2b56a0ab756afa52c2fc5b1133407ff0d088914f04adde7d8b9a840156135b5991dff05165e34974d92702d93d7027d56a6fe2a9004c05446ccb7283f2994cc064cbe6850dc82c9865738e9ee7bd205a50ae83128f007bb1b6e5f330fdb634e823fbb09c279609e9819df52bfd3214635c80c4fcfd47672cd7dcb05a7ffe0bb71867e7061764cb68fed668b00335d6d011be76c3545c4ffb3d54810fae5c498a29ead7fbf6d0c4e707308ad95103f9b9bcfd3e3a66c8cc66e506a650a9a2f55de7724254943e076a0aae77969219f0df9f7781278b9a7cf9960fb6ec69d05e819b3b448910a59f1eb3307135b469dce550594709cd9bd7e2ae8defb1526dba97db70b04c2d361f468a3193fd57d0fd328117d05bbbfed2a6d3ae4a555c332dc38fd74daaa6a8b3b55624836e41d8aad26be0982de48a98f93153b27ccb597b8f68f798789a9d46d84cb72ef3cebc064e428613757eb75c86f535b3dfb13f7abb8bd9216e70f04c67da84b6d684ba7bccc57b5d4b67aec5a1ccfa2c858017c579cbed366c29b6cd1ce009d5879ffba0c650dc18e683b9610e651584b9a04a9fd73cde3a56904b09f6ae9f6a4bdcb0bab6c1e5b8e7e0eb5c8bc1d130cea0f4a6be6e364a28021fa476893e87e779022b6cf983dcb394fa936a2245cedf379642716df1a932d899e56a9d42ac668e783a910fa39284ec7ab00f08918acf9119f9e964cfea71404064417aa574c0416acfdbadca8ba43895bfff699cedc1603f781b4b7c353724019562a947afc7e7c30ffe6d9857346aaee04143e19d8429e486003243387444b718ddf52bf372f542a95e1280c4a54299d13e3879b8e479925aaa84368b47a69f9c1fe7598f0d0f5fa405ef3829299e970a8822e1885aa33e7eb400d538d335ab97b746bca8da82350e3d52a9833f010d9b998af92b54a67f6d906d12fdf22d64db5902452071bfc8fa65fa010d2a8ec2a1b8f3f38fe4c37fc95cdc46a8ccb9743534278d225a5ce233a15d503158e1db6e9d016db93b240aba04afdd7ed2f8f909f32d478b149569b768c13c4f9f7bc14fd5da12bec4692dd6119bb35693bc0ba09cca16c496164bf598d24e5fa641ca59d4b283a60b2a3d30f365014f6c8d79f0b3d878a5cff8f0ef98e48b5864c9e0a450fcc3467e19a3761ff916ff1e2a89f61bb73080cab649a91ad197fa3c3b17c6859b57f49a845fadf994fd36f575724226e32866725d8f641bbf052bcb41c96c6b7dfbb13324b10a801ae1314373b77b6cfc61580c46bfaef27b0b0446801d054be7f1e33266bbc267c09c6aba0c3b81ad54da83c0b627503d9462b75249569c8b97b6da662c18e2269b37ae6eb3e07e995d92466a990b3f8856bbe83a478a7f8725b49285b479e1cb89335af647463a4892216851668daeaadaffb0bb37d8dd651c509c3743274eaf7a2a51a0e1777fd21ef8a1555f625d5f21823aaf317e36369bd5c4976ff3c848256df750c421c9145f64a59a62218ae70d4684935b63ac3ff6f4a96aeb2910993aa02dffa434ee1ce52cc899089eac0c142a6d2ff99cec8107649c42b61a32e9e4b0541635191007ba47803c1c351ff2302104f39c4d5dd1614175cef07ca15cbd0a774dfbb79e897bcce54c4f49124d0abb171159eed866101f8bc4782c167ad4332e04d659c071fc7cfa8530854f8e6e93f21bc8152e672ee134b93e64eebe550f35e53691d1ea6993ad2158006191f1e2973efc194ca0ab66fc174758f0226dc531fb265a560e5e38a4225c01b2bc362af73af9cf446491578ecfd176663c471c60a613ad7a119659ee68c43a5a08cc7c737c58447668644f2444fdd978bda86c60bbfabd0098e7d29746440da19e9ec5c8cba161f299fb9a5a83ffe05ef8433746c7eb6e174b4f245bdd63973c76c73befd9b7230fc8f115813e6651f1cc7445c5622af346dacd00bd0d6d47f204caa07f54d4c8c3a6a1ffccf161038bb7e2184821427e2bc8fe3c8cfddd731c8d98b4e6386d70a6d9040a8a4993061e72773d1a82dadc8c9e0d0927d990916ecc59118eacb586294277fc8f63de585929d522e13f8e27331a96499ff0f1daa43e30176853767fa3362209f69dd13004e6e6f7e898182dcbd2c1cea23b682caf8d9139d4f0baa12592284c3569031f77d4cb3df039991d2d032f5fc61b035a0eb2f70f7cf1177be908cb8eaea47baccaa254a1533cf91f52c586e5648d1271cefe9633f39cdfce209e09530056123ddafaae6c8cf7cdc4a5ee592ba291292adaff17a97ed3de2ee575af0ed4b4705c90b30f42902f7f5591aebc1e5e9a25b103c16aadbae2682df90eddca8610025bcd0254fc55833850ce6b1121defec4a9e502ec46af0293dd87f90fabe7e8eb0d758cf4a6c2c6b4ea6bd2183ba734471c82f41105179d222f34b40dc1df7d4370be2d0b1c985ced4311a85479e7d5b520fad7ad6a30fdf272f3c6140487ce28a9b490c65e3976f35e51d1e5d3147a1fc418c8fb9b98dbb032af3193f1196689423632d92fa81302e998faa9b9964d0a92a7159bfb362749ae88dfcdbb7e3b87ea009a4fa76880b817aa55df06b1d2327b01c387a0b926d8ba31a32a3696402c64e0a02efbfc32af918129a4e2184833c3a763c9681092db63fa29ff811de4fb7f34211d7a05c5d46a890e5e058b18522565e89649c9e397b3c4a2a35065fc996469416425e3e59cf69fb886b9f89785c9c4bdd8c4c224bb826c0c2fe2928a66d78432d240c1aadee7acc061727d3ca44db2ba819cd401cb9404751d1f48f23184f3aca22245791be2ffe23c25a811adae614effe498d6f0c5cb0d2cdc6714b3f23a1c7858ffd43dc1d1be0f760cf28d2d3e64d6310854d6d54471d71e8a8d7f77f3098378ba1e5122eabbe0cb9d224ed4904429b2b275f5bdc45bd8eb71f9d243e5b7e55161ff23e35434e83cb38c3873c037f255995350869d8c06ddb813aef18bdafd7a280d92f25b5719a242000ebf0a89ca4589894f6aaf04e0288534f83560c53c82e472ae8ce54c5dd9812a6964174192b857f8144a77af9c6a86d4d301212ea8137352c14a002fbfcfa6c56d4df69fc9c235ae58b7fb11df3bfc2f087a051095beb722f58d1d1c6b644f989ebaf4bdf648b8addcc90ce1d8d080acd5ca2e6499bdac856177d8b121b77e7998ed394b47a5e6badbedb0e63207d84190b721b7a40037df1bcf45bfee6c953aa2dd319498200365a5518ef7815c71bdc88c1d8c317d9c1174c401cec7eef84e49fd2e13b60210d58cece2b3ef17b0fc0253c68c125cc18e028311623ba3f0ed6126e71e0af814fb5137bd5653b6fd923ce03df31addb6728df0932d710f876b87e4ec88b05fc406b2cb5ebf3a7097068a0a3edf583d44f7a52e042fecb083bc6bf8927b503fe23134d1fca2d7238e894606860ac772a3d371643acac90dd864107a046dcace6e1089135612040ed33ca50ccd15358813ea65077abf2da58b84891ecebd6856ec6da84e1aa05007db848d95b27246565d7fa46b2f4515fa38c33b0c190b343ac27e18779082eed3a54eb129c4e889f52779cfebf26b915227724e16bad10f4a2037128bc44c341f90418332f8037c34cf4e781a01bb9421922b747ac89ab2a8a3378709ed1c401e8445c2272d26ebd9b585127fb57d5d183e52b2e17861336cf9e10e34073a97a4880794a507bdc3c9dc553735787357eb8f726cd7ac0b56559fdbb1e3758ac97fda1c37419da24450c62eb6dad5e479608bbd4ed4296c6ebf812b6a57c379c796a5a6baa3045f715c0a7894427d314ef37f454c83cc888b165aca2a3eae11a768834b6b358bd399fed1dd302fd79ebf951527a448669c516cc2d0f63f7f968d138c3af179d42f02d3c0f627eb7dae2f4489baec3626c85116dc23072b4d9c59f35564137816b4ff91fa4988cca72f0583ccf80a5ce91edb8642758f49118ddd7cb598f92cde96e8cc7873c34c1d50988346307c7ad359a5fb1e2a8f21b54fc1f800d83a5db56f7d3c459500429346de68a1a049a610c86dcc5a7dd737a0b1525791d8712d4de313bf3e68fca59a38a43145074bd0235a4e599da5f58197d353bfa8c9432c709eb3a6a8b533930531b16388e0d9df67c46dd2199188be257c065c55091a1006ee6f8f93677f3f9ba7a7e0989b993fdd53a97b92b7a33d4ab0cda47ed4a26bb9e6f0ce3ce05f9cc563231e020fb655e76ac7276febba742c99f5928f17c2f5788f0f9bb4c3021dfcbe7b86cd1396aac2828455064d7cd2c56cab823e2e1b56e6f41db25ace49d092eddbb0913c13f9c8783bf986e7de6fc5f2db09ca04c6837730c7ecaed255c6147b6974a29fdd2e3b7140e3397fee402c9d478d879aeabb03f0f3362f5b5a2ee4d8b92aa97a0dc8c8465d0375d8e0eb3db05589a86dea8ee32ba2b040048f0ec7ed391691a1cf93c439737fee4445fc2750378f3c3dcef47310dee2ec95558e2fdcd69fbe4eed7fb4f804970c4afb7ea2f54486a6122bb870abac18656546f92efc00660503ed2ed25be1b43275cb454bf1cefe62865830ae736357dee7eb125ac93a308a7144662371d634c3ec003aca83647443cac5f8e8a324d2a8ff69722da02fdaf0f1ddcfbf836411cd5994f0c8f816fc8e5a738d6778d4afadbefd3eb830ca2168a1cd941d037f8f0889dcdbc7321b131c7bd6d6dedbef81e9162b8a6028696391a5f4d40d52e8bde21fc8f4df1396b58d6c9d125cf676a93029994d13255f14b6f7ef90fd6aab2e8d0e8297cb53d7faad0e361be240b127d5d275fb84759ab13a7ad8be346518eb425d471b2600b78fbe5218878aa6997cdee9baa4eb483c7d979162ab1418ba5d4de7c2609837607bfd9e24ba0aedecd13d0253aa10c91fa13cce0ea826bd9c4964e416f9d0ce064e8abe60dfdee2845d2c393196cc17f7f5cafcd2fe059b217ff9b97ee17b779401e701c971a99a378635cb6fa1389d6aa5ae5027d924743a3a4c68919efb780e4bae0b725df4e1b1d4f9a5c3efee2beecb428d4ea0b1232e073350c30d86ca6197b5d079bf1c9d0fcb1e705d2b54951027000245ba068b7c6d9af593e8ef64834d47489a673df93960b90c54ba259150e989c941fef9de78403bd7e8e6961811c5e824f43cf71e6a48ecb0c65f14d168fcab6eca03d7ce316f8b3a40c0cf4a5baab0ca4d339aef0b5d027c75daa258941cd6f6ad7260c1bc5c1ffc463b0be9a40ac7f96f90d269b60c8c583e624e0c11aa951a4542df0684fa5c699a5416067d5e2e26d9e28b90bc50b6f9ad2365f31cab40ec0e58d824e047914b97cab112ac35b49ec606d981c0c3083e013be7fdcaa80a2686bda1c58386aee9507801aec128641ac6c2fb6346aeef8ac2e86e122621b7e95131dbb576d6975ff0c12bd7990c3c94a19eb85efe8b682bb526e5ab6645767b9fc86cfe92101773fa7348076ec58c1991cb182a949b52178a353299114d4c20e389d4dee383d6750cad56fe52591635a8dc94af1208782bda71108f03d9a14a41310c4dae567c7dcb22f1f42c6475319cea9701834164fbe9418a9eb575b516e5c64b3ec3952fa51ba06685f0d79378e8e5e8c0b61c662f0dd48b1a9ad44ca7f94bca32ab8affc2d7f1f48301a491d0d61fb47a59e14cb84688f5d6b6a68052d4850d1490da9a0e764565c4c57f06ca7e23341dddf122499ac666eb2c9fb4cc9190ef9c7cfd595f49a12b383706b7b1424d77102738eaf01ed34326776776f3d69ca39b73ee4706e7bef37ab288554bb51e9050fd7d86540db0b550f463a17485483d5932a3962ba3be881298d314d25ff8716e670d2938f6cdb250fc4a05ee338c0977900498d1fe2b194b1e47b6b674ec87f43ca2d4dc70103395ed85b20574c5fe4c62c4fe092262cb3b06ec0fa3fb7eede7f0c9e7461835c73160998b03c3249eb465667b1363875db308e837ec4843a20773df183663ca92b1af0dbf790cf3d3ba94c95668fe939eaf2cba82006755730e94e86f3ef600bba835371552ec4258cd64920bc19e6618bbdfde8c600bfb842c054040fc9792403147d48ada0fad576b0535312225418dcb0c82334a3f14dcfbbc9fde1200e3ab2d7f3e3a993182af99213c0e00b4e4dd3581bdaced70e7116a7916e62bcf0a78668112d43d23291aa30b3acb4bab4d4bda8d2824192bffc4f7eaa5b8aa056f178b6ddeaedb7e38af6197ec370691a6e6819e6b4080aa8f51e412d504656ee70b782995848b1e7e5df415e86a646ce2c86fc126a21fc4b00d3f4927700c53615b79a72da6124854014aa16f6f8e05e316003bf4542bda9a03705c456d22c668f9d5f8cda0231785bac0986001de9d41aeb2b8b21f4996483d7bf61dac2618a42c329fd514eec5c80de4604269cd1f1f74cffba98acd54dbbacf938dd42c9564b145c5dcf21f8aaed19d238f2ee3519489898ad2bb00f235bfb6b34ed913871fc1ee5af2a832b01ad5be44ada3b1d53df21ea0145611688e1ecfc4579f5cd951a04aa8a5a1865b93fddff38aa6bd6f67b43680efa558192feb644672003e95ff12e9d7616108f4bebdccd422e0a46d4275ffbff3a7bba3b9ca3cf10a4202f71e0a24fb98874ea983b7e98de2dc70d3802fe2f9ac074335b1c002f429ed56645d532d8436cd9d068100d536416fd2b48796dd5bfea7048362d70ad1217f17090d388bcad7f7758079e1d0ec27442731e9ca09c5a9033860039617da07628933dd0dd5c8c98956ff072840ff2128749d747c70db6ece43f1a54d239eebac6b380b71437307bb78741da5f310bb10431164010b0729b55c1686427dfd6ce56e5a24c38d4c64f81f3b2ef7dda5a0e524e6302f2577af7bdc9f898ba5930528bb3380b8b57e60ab77ac5e6df651a89a7ce535fc5f615aa057624745d1be6611c591fa3c4ab2f6c235904063f7df82c374fede0ab2cfb983f4a63455889234e41716baebd9fa6d797ee58fa56bdb5b02e50594e1cf0c43744a26e0ccd230545d79656e6ee161f4a27b3acc65e472f89281f4c12bfe8f3c412fd5abc2c6593b6b8ac71c17dbaf42e639dd4b869792418fded79484e56b758531293cab094cf0895c922f57780ac7a27c7e92d6a8c1b859833ab9753b745bfb17c3e84430db225ad04abb9fd5fe5ab337773c3226c2934809fef9b2d9a6e981042508330551f0e7a248e1e546c42d79449ed43fbef745aae18f3d9745cb1d95669c521c1e1375a161209918ea32cb8cabee764637e7071f3b0d0fffab98672ea5bc3ff0e2418db5a76bb7aa28bc5095c487d12c42be09c7ec7c8030b54826af316d3782353d709c62b16d65e65af2d1f17a2655e46674a0bf82f38f2f53bfb8add3b43bd66041a346c9cb65e8d73d53d077c0fee758215942aea0af363b33f562b0614a186afa1cc5479fb797bff0957b49d1b5ca904307568d147e598869d72d9e9516cbebf153b427511c0b10c9792c62be54c51af4bf6a6fd90403aedbb67669e5f47ee010c2369d716774be289391ea80e07d756ba2669a6825ab425430cb9ca3ac1921997db50c424d7a6b9b829dbb3a4a13de16227ad16d62f820bcedd88aba5368bf9fc4f6206f186572898c0fe88509d87ec32f18108490f7404d856448393ae8440668b090146419e3b93008568800432213455cad46c504d51906674c602f1ef66d5a4caf76ec1ca319a80eddc66f438cc7aee775120210515b19107a01777e10cf23a7915bf2ec11f9e3d3defa70b77291670c5cb99d46bd5d89ba4a7019297cecb1014e78882ce25822dad5fa6b9671431bbf83539e7bf1537ce0b152a3e618c0b1285ce2955531e28c508b561b2e11757ad4c71e86e4f56b2f24d65acc5acacc3601f3d69d5622867eeb72d39c6b9860df450096f5fab66693662ca3e6e36d9e0ce8c486856243a9249c155dc6be52f09415d848af3444603e3e3e94e39b188641df7f548265c9f2b0741f275eb2210cbfa22d522b9cf1bd89424a644b97d1471a175cc7dc1a26a0f180dbf97316b8344a48d2063bafda91af0826a37b8e97c64317fefe2ad1c8bf7e80b78981ac14589c11daba097540122105e6e9a99554343f50ca6b9e6ab4a3ad3f005b5ec04c421e84e69feff6003c1e8492024595e31483ae9117cdaafc8b7db08d732618594c92ddcd2a0c84104291dc5e997ed9b4a149d99522ab2245bf225d848d790824e4630899e3e1dfe6f12e4afec92a1952fcc0d3a5ac8b02ef1c98b4735e4e478d34e0837779dbc3c32c7806e3922561605117e632eee86e250f64033a51b27d2e6fb36f9bea0dfa9931a0f76e4c98f142bedd160653a9b1072b258dcd9d5f86cf1c76f14afd79eef7e17709cbf259f94b7fd0cbd136d0ed5c5482fedbfecd845c0dc52b2fa674d51f26826b538ea62dfa20b4d8a41bd26c0b056b34eb1753281910cdc1c149c14da6cfa5d062fde59dde7f29c1a6a72ff8670e4ff6a7260f836ed9527fb64e8b0e925b0c83269fe58b07b5950bdf8cd209f5939713c5e24ef439b2020131c1fa10af61c4afcc81d49909d0a37441b9861bcf4babf7f490bf3c397298c4a475d1614be8a3897595f83cf1b96d56390dfda29304b1eef5acdcad0a15ab4a13c61ac03a9e08ca433aaf9329710c683a7faf2a613fa721c7ca98552a28b357277c30843222db2d54e033fc99a94c6c59111fdf18f54c287cf4259a00ced3653bf01a9f1941abed36a6bcb6f806662e0c82b94ccd760835ae922a81d0b01d7ae7987233e61320228d5393431362d430c8860c020bf2a43444fc05ec36b02d428a02669370ec6bb036dcfecbd3bba4acbb7d65e59a4fbd5580964e60e74476f6662cc58c5dfe8aabaa001e6ea5eee885c69523eba01118381dc608f4c2671e36f1abfcccea32fe08755bf203b6408fa4d982f729d571984902adae18fa71a15b363792a9e013b06a30def5db262d0ec542d933a02c6ed1d9f09d5240f7fbc23d4bcc1f4745f6ad256d37665a57888e9746d81d39edbf4cbecd2a5f4c219657b85885ee35b806685fb0e50e544ad151952ce1d5eb0fcaa05e1dffbb1bb82e407bd99cb5cb4b793f39ff10aa5f1c9e5c158606ec3eec64d60e4a7bcd228a8a2fe5807d68a4952cb29906c0fd627df3019a234f82ce9974c95cfcacbe6b9d6de25b5b1d425b985027967128fc1395e009acb2becb9f339a96345749ad459ff4a8fa749aa47b33ab7aa1b6a79e6d9cb73e46675235eb0a8b1b82ca8c5ec91b694f09c826243310558e062554423cb1d837bb4c06779fa47d7c88e1a5e71feb2c707dee677a5e07baca4001ed4ee9e2c165be2824291dd3f397edb022b03c5b49246a22eb669e3525c92a6faffd400dd53b66973343aed34c5b99480ee0980a8f611b5f5389869ec6b0f7020cc3f73bfed687c06ab5f23c3757c730309240d7840bbc20c4d09b9993a0706890b76d543d37e1c4741f44751ca3549de3f1d721c0a196424d1d2c62edec2172c155d522995c75776424d3ba9b4310ffc50a51863f5895829ec2909a0997d91d18cf8044b0722fa6487a27ab6cc0eb88b35102338c65a62427cc3cb212c045d2c659cfcb111becf2b71b9a2a6e93714b15132e7261dd821966e8dfcc09d86a65218801844f374afea830dc4107d38effe63ab01cc1d6505c8771fa0387a2726fe96094c24d048638e2ba9def73f70e0f0fea802cb733151c652e8c3f512cd5ec8d7c369c092075fbaae060f2ba8a1f0b7f1c6f505d908e5a302592446cb26737b57e038242b8daf06d6feeb2c9a4031654e7d9a8b07fcb529fd3c77bcea6c4fa97027fc292d32b5b834606412e1ab5a4cd25ab3af24db414cc35b6aaf4e2800dc1c3c655b0bbdc2a1501070f96a7839e5ca3653b4596d8210f725fc3f24fbf8e506953d9c2077dfdab76046dda37945acafa2326e00524321283b7d8de962c6babb6a4826ea24b8f6abbe18cf8cfc322f75f08b11eb612bdbbd6dbaad2314e3523ce196a4c7b7ed01a290526ca828b3886b36e316478aec8199cdd4c40dccd17e14c5b8a3743166a41bebf0099f2d38aa1817dfc0c54b04164992416718eed4563357bdea26e952ceacf2a4ce6cebccc3c188873e0b4628e90d2474632753bbe7373db04a528f06f04240f362cb9ca48e67a236309f82602cc62765aaba724d07f542fa0f42c537e8a772203e400f92f27f36f8cba341dfdb613d9bd81857f8fe530fac2c593d92b5138d92c36570d25f70b19dc4c1ea3f2cb60bd9d2cea7a80a3d2e624ef3c1aa8ac466a7ab494b123e4dc026cb1b4528df1593f58971b3f9f6f1b31083eb8b6c40365957e0b3c89b8efd120c6fd16e93915f989368492a44b759a47847e4190409e62b82ece30d1aa63f8a553a70829c7c60a3d627e7154a390b83b1ebe01156b00ba2b1153b924bc9fbde0e01c35b09fac0ab9fbf4e86c5a0cd7fe094a15da00d28532ed2eba4243893aaa7708d6e70519d25bcb2985bf2596086c4cdd020bf330f45bc5251b20723e71a1ff9ea6ba65b0548023690f7f3553bd483a338f45902d4a53dd319234012016748fb642eaf36265ba94010b3d544ebf355322a32836c4e7ffb140faf971018bda3e5352012db80b80fa10a8d287a4c6772f6dc258d933e8404d22387ad40d8a92ba731812f4d7c9f0cc7f02a70b496ef969a56f843312d0d57f71a2f36753ab37dee4059404eb8755e3831a6c3900bce4b25a6cc86a722c574fbf118ab60f5d93cd8dccb884cb06e5501eb332a69b5d90ca50cb328a4d3cd0a62fbf943a8ac87cedaa1b062dee70dc185f58e41e6f6930f77528485f715f5dcb2bac5d49f4d06e1501aedf675066a688af26c84448c114d1e8120ea68584d728067ec03ad23c75bd6caa3abe9c54d92c53924aaed4e2ed70b414e9b5c57f1ae35fb099856e24e7a9414c1d4c26f4b486d238c6304510ee3c4dd18bbbb8ba195dc9b63d0f357a33dc87373822fec9443a814606f44fa13324dce0e099921077b83edc9f19849dd0917e943dc721ae520bf2a1b15d29b8f12775ebc14b5be224c65f369e3d305f03fff87fb5e91b45ecbaea7571905ad14407d079898e7883b3e334880ab16a5bbed13d38e271357f03184d31fd55f66e6e1f1a9d49ce029841ba7672e103de0b0a48c3b71a8d626c578da391c429db8766bd825f3b8ff98c76cee1a76105e2ff7685f4705499108d920dfe2389c2c65222f4ad435c78fa86ad94bc84e8db3ab29823469574c9b596e2e070b258640b33d402da3213cf53c7550243e3f5faca65791ccb4f456ad51adc0e1589df67d0ab448d486155b8b26be4dcbc2bddaf70383a6338fd234a532516647f6b6967a51d3b7f65fcc60af45f2d46028cded491058ead42e78f898a70468e9112d7085fb21792fc74ebaa7afe80267b33fb1e62fd1561b94ab2c94148f94e2a898d31c37ad5fdabbd3754dfba6e48db7979d808acdfa2b85ad4e4637d1bbbfb5add0f67aa31f709da8856ae5ec34235b5f9a170558b9ea06b9ab63b0014a800aa41c716a851bc9e4460348db50bd4c18293719c2f60a2442fb5eea3d33efee7b1134f3328161e67ca307316d44160e8e1257a4499f57d0e098429a13048a105d7d34bde433e8610ad4aaa237bff7271914e526b96564e7a3c210c88192a59f3bcdbf558a7a8e6a732472aaf6020d30821cd3a04a5f49ff7ed41549faf9ac8ce82a32650e1cab5a4bea50f749d51855f76d7a2ba7ecfa0026ef50d9002c1f455fb814ba024122311757feb22ab7c2723a1cd5efe2a55848b347f7b62aac34ff7369b0cb479714e97fc943a136b20fc1149e900e56a9e667b1ea9d2691ae9ec72a20e722d5a4c87ca9d51526d1a37b4dc0638abd12d1f58cb6e02d096514d8f4de73c8b989052e3eec5f7a7fc72a11cf6ac2cf20022b862b312fe4e4dce760ea7d75ec8f01e595966154033f30783402e9eeccee22712a78a8646ad493777177692910aa01e5f402b47d76c27f43b4824b03beb9996c39dec280b3e0ec0ab390c7e4cc00df6314984cec4b76750627afe99eeb998d02dafd64b9505dd39d889d2f0217095963e5f7e38aac3ac3f5531e285808609db23be1d1ff8d4a5999666b984b6bd0a865ef8e195343c8dc6a2fc3b34385ee72f83ec049991f6999fdcb8e1efebe92a71f2f9c788c6bc6b2ddd84658b1ca4a87c3fec78396311eb498d46d3a459ccc9dc5b8362597f9d67abc3ba900afd8bda4bd20d55d22d371f87bd32898b58eccb42dbc524c8294f00fbacc62fffa1e6e7c6b6707427f2121f9437811e72a7ac0da7563d81b0275429e4e15e5d80b67392bb1cf4a75ba0e4ff27c7eaf72681f41c5b94076ae263c0fa311547a1610fd4240ed106c5c5529ba611dc1155a4541562e4c4fff585ccfa3a425516ff917cab5ebd4d5b219795887362628789e9e996de906eeba05ed747c4a7c532b092be5e7c14750f6ef6dac5983ffab22709d942ecf807869653657e89a98eb298e2e24d3ae263fe4f25ac168a715d476c85d532eba1a43448019ab43754a5c0f72c620dc0856dd7bfdfea72ac7fa7d2ce9705c4ff0c6e91106f47dde089cd6796a8c6c5e585cea5d0744a53c28efa2b678e98817411e583191d64ad5c3896a9881cd6e642b104ceaba79a47ffada4851caa7abdfd8803597a4b4c8f38e278d6affd8934ef17c495cfd3382cd36504f10f3eed146539caea34aca98987dd6f6a2ab44f20346477238e09335fe9ecac88f385625b2573710a88a48fa5da761d39a340974ba8bbfb6f1d5acdab9d8b2c7ceb86cd60ca7da608ea7e79c1659346cf59375847d48504b920364c08bf17d465c7eebc57aeefaa0f3312880108b954892aa76b5b70886e1ead98751950a4af8d5446481c7141c3351cedc596a3b132d471244df56c2a3c28a7a3e7d65762cb431a8e4c093401ad9f50f8366e6b24e9d0e6adaf1ccd219adb4e628eef8d033872c41ddb2a5436b91a8112df55813b5ad6bf96fe9a3b5b1860ee2e41f35873fc8141da0a6753120d91ebf1c4fc8b3b58d4bdbbf12449b1c48331d6e36ec303cdaeb58303eba7e478a2249bd6cf81c5e11018463ab8f5a4fca2813ce0eabef7d9dfb310060fc7b0267611463c81ec58753450ab7e7f58c7b3c7c286befcd33fc317c55c4401c1a1dc3617ffb7cd049998449927387e70d519b7d07ac617f193409e6a965ff20953978269c3e73dfeac852d3dd7a09a058d6a79fda1133992caa3c71ab2a85f857a05308b027b017d085d73fa9971e87e527e23299766a1079164e70d1ed7750ef7e25a976e69aee6e35e1e46802b958157043aab9f5b8132a250fa918cdbc69a8e1b191c06c2c433c10342e6f6e7422635058914c099ed0a435a8611e141b46053886315b8908a4ab6a0823aa1dae7329656270d54b9c9636205297171cf4e63c4db4e810078d93d765f78f224562a163a5d5770393bb54b666737a0a13fcd5e8024cf8e25973f36925e92823d81b4d6260365454dc01dab3a02b4190448549996fd8ce52a0cdac9ba702bc485d4a62d48a26650fc11c0eeb60232787508ecae3395529c41e86c024c40cd153474d8698f035e8fd450e41bfa57fedf841bcdf891e077c1c5893d7c5c8dcf0ae417f8d141f101a94ca97a859fca42e92f9db94cf11b70204cdefe9ca4e51934a1225d0820b59ab2209c7f1dab9df65e1bc80a3e9a862ec63f73cd38bc4b7794eec4c67691bdf18d1cf601da22bf100ea9883f7c079be1b45647b2685cabbc5f5ac0f43fc96ebbad1e3ce6c7ffe25e72387d0ec9f3efc81de04e8c6c1b3a900aa7aa9703394def15d532d649064b40ddd3fc1d71287bd5985667356034f8a39576b3492e9d6c4e1f685e159b40085473acf9bd1c9108d8b4471a62ef613d67fcf44b73f22ef17a03c9d10c310449479f710f7ffc66784d065beeea0977b451c98422f629da448a54bdc442b1e19a55e8bac544f6122b1b7d185ac3bd4340f93c3063dd337940b530c39c443d17f15f1bb7052402ea380961ee19a83271eb9c53341996a55ef77ba58a696e3cfd7c37b1b992047985be1a7bd26b053571d0dc84b1265a97d03614c2d45c0df3b61d09c790336d24226ba600c821d29f8d694bcdde887fe9f0c0fae0ee60ccbe55a520eba4ecfc7c9b734612dc9ca777571e63ea32b1738677fab634dd3f0e07d625b045142142d3e204ff5f937883c0fc6c9855a971421e7bdc38bca00cc9ad32f6a556ab243612d3964e30574bde4ed1abf7352fa1dd7ac0bdf387bcec1782ed6d1012886e81fd3e919a53c785cf0c28aae1248766ae9653ac43632c4f6d3123c240c6014ef90111248952452c5a8f19c98e1a97e9d856d7470df70046359900e01b3ac906fe305277d802781a7a02e5782bfea2fd290cbda2d367110ba39c1e3260a1b41d88126b921e1c34f8578a5715303d80d227de9aedf5337b602165972dc9676e40b9b118f8e797606271d736e42b518f74ae72a3333a847a79299b4de1db49f426260bdd5454fdf18b56daef690264e7e675b856fdade54fef5aac36c52657927c1afd0868c13b7ec29be409913cff2b9f357c7857b83321b3380396de09abe5517926ab23b40c68f8c971e6c357ac81e6694b5d23d2674711acc817b1dc6a1e9cab51bedb61eddd5b0d6502fc766505315e2993bf6cb0136f8fdeb9b9cb3ba5bae4d1a95275c1a78b159ee15bf47fc7ca1af3be779ef0c7a3f45e8b66b7c0f03cc8870272ddacef8efc3e9e1867e2ad2958a3d48800a8352a4a3de143f93254389db5330346705d7566c2a24e2a5c4eb5cc432d3e55e8aac37fe77903cf17a13e9e5da6e52febfb491528370980624db7427366cc841aba23a6680aaa39ee760f9c857541e6a6bcbf2a66e8197078b70361f465038bf9a1e44be41a48facc4c62972d2a2303dcf07f82b7ee979a31e292ad84009b529ff0512f13c9cf14ba87f5da317d0e3b468e9ab258fcc87c87c6cf0aaf7db05345edd6309e451704e85a52a2942736e69d0ff9a4ab7b35450ea9162286711d4906a5ce3ea7d3f79c95c93d772d10a39aaca284d118f31857213d9dfce4e0f2d80830c0816fa8c6850bb1f0a2a117879185361d7ca996ec4f94e21bfcf117e396de524f3e3778540bc06673decfc447b8536574bf8166febc99b876ffe55e6777e8ed486cebbcd594a307ba3d5da6e666dcb1ff95880614675aa92bc3f1dd7630ae7b84c07abdd42254b9f6961246f2f284b12e0e32265603d0df6d9b99184d8acd3b064a4bd22eb031e244d269308d4241b05d49a5ddd2d3ebad6701dc8eef502cf633d9892cf84e6c1bc2a53ef2121e8f791bf2fe36d631b5f3064c5ff47861c969c505b5d2041cc68d922bf12cfc6387d124b2ef3b22511481e07f601765930beb55e8781aa71cddc70856729453aa7350719d9cacc1e23f87b64c70b0ef52b421faf36b393f2a57889e42f59fbb16ec710fee23d770b5645160fd5194ce609b91291de4eeb49588ac272219fc701f29a2c3fc50dcdc0d2d01954a910b963313b61dc88260c7c598ab3bc79bddd57ca1d42cbf8f1f0d4b8186729ffbbeaa668550fc36e510fb3c5970804272f57c7622f51e63303ac3bf5b0ae45cb28b7c985889c39ccbe15b30c3909d093093aaeba34cd089bf87d16e07257cf21444863ec1d131a5e8a5724d02959e748919cc18bb8311d5c7452f390883f7b693d2a0b54519a6ca41f9f35443a85ca48e8481cb350851bea417ba42be4b3bffc76a7e71f1fbe9c9a8319f61a7abecbbf218c377c0ec1c5512ec379ab333cfef78a0f88bfa516e5b0dc37b2b9387107cd09c0a68454762f69d4601a500a0fbf1a5746c22efc2bda7fe595cc53263fb759eb0adf651ce221836c34c8e018a9d5cf7f11f0b49adbd2f8b844d6bc889a8a12d52f96543da3ac3d20f4f17509e76999212923d584a50626b54f4d50d0a389db3648d29371df62dc49ff938c4ad51d8e49805f266555bcf22bb261dc8a8efc0ca6f6d29aca55e110d92eaaae583d4cd784529f7998fbdff084dfc260eb1af5e1ed3a43993971a923b803bacb3cf3a493175152e8ea3af1e1862a467bd1d29add3a47f6911d651e4a526da163b8da718ff5ab6f95d7468cbd7d07b0323a75cdcbf7cd1170d185ab74e47fe508ffaa30fd847e38fa2b42bcb83cf67516db1b773c6c3d5a5cb22f425cb57d62734d1534e816c2fef0a7d30821beae76e216c251e9e55fc1db5096cd28dde7943de9858bae95b7e7032f2076cbcc2b7d934219ed0d3b29cd049ee94ec5ece7ea9f0c6fa2faf6615cfac2caa63424c72817baa90807bae132b06b21567393c8ab71827e00103f0b9cb2a6aa8e50f5260a301d36d6e2e29fe51d46f50b1a7fd7e89a790b98fe62bdae71b24981e1285ae27a8e2e4eeba9e629f477db6378aef7d68492553bf89a955b4ae84f96927035e374aafd9c7f49bc05de73089991669eab370d7a69bfa6f322134b78e67959ee7a2600efae6f37bddbe6c6aa49a068bcdcb92847dad27b4cff7b37bfaad5b7e441124e19eae304059ffe9fbe1fef5b0f153566c05ba49cbc75a057ef7f5f336a06ba58a4cce365cf207eac2ecae5abb2d9077bf252737abecc3cf30b9cbb68d66a69624eddf58e9c8d8e20f40cffc0905bbcfafb57c09571e635f3452e6a459dfa0d548658a9fb0b1837d10478c8b17c1300b42e8eb462eedfbdf85c5b7291c59a05e8bae729ca8fb7e9c32a00d8bf943f6412413f660c9807fc931294e5788ba2f184f2bf69e67703a868be8f0b7029284768f88634a6a185a37d1b4ae0d7b858837b2e23b07d9fd045d73849e5a8cfb279940ac515ca97131e703455ff844d211b281761c751ffbeb44059b32d6a8a8da2062e0a493db7cb050e3443d7f76e37ab19ddc5996828ae143c40e753f64a433b381424363dbd9ce965f84d001c686de80a04dd270d4d3e2c3a9ce3a5fd5e8c50e04280a3d3512f90759f2c4afe03dbbeb8cf183391ce2edae7bc81b62699ef006874cb0c95b8ba5ce0c5361c4e8ef358f106aff304c30acf17015144895b812b4a61b9ac841d8f4402f6484b275e18350278471fbd47981fca3a0be0e5740ec259867f4e88c716379f4fcc43dcd432904918a0e2a4e2615ec7cfc2584c202722413c8a843bc3625ed9fe76da0159d85ce5ba462c23d390f163e7b08c4c1f160e8b4989cad558d913696b06817912b730edef40ae3a1d727783ddfb5fbd0a8271d6d624253957b6209a3e2101afc2d2df082304be41b2141a6e5c38eb13df0874cf402c9cf57f6735dfcf0422e86efd775fc578d64f78bce8a0b1f367a0c7cb009935f30c13a7713b029f6ec3748334b3205c5d2ceca3abd81f032003cc90b6fb23cc284dd690d1be1c2bd3602b60891d3a52982858e275eb6a1ae5280145c34c207c556acd3eb36d771f10e13b1f3a1101c047328e40d4cf45bf7970f14d91c61811d24a852257d9bba4821db57af1b326100fe262b492fbd7f697fd86cf44b5a59c3e86d2c22608bffbd534846b9bedd97553d7a047e834249650679a7d018e9efa60eef00637439841e761b481cab5fc88fdf3c8d1d61e22005790c9b1b52da8160366b372087f3f7cb1eccc303a85a8879a10fd6cce12319c9f64b95a3367d885268d647a2ab5f43166b2d5f94516b919a55c6a03516207dec1c0e73ef454c3a52487552109cf635c1028883040af0969352b04f142c5ce8a2ac5a37531dd7b6a3557533c0ee7a25fb25eea77de284898a0e5b57066c1edcaa2292cefe1bf43960d7723c27f56b3d5054d037cf14508571a36ae42ba5f9eeda34bf5915907869bacc66ad83d2fda0ed5ca9e3b073ae8ec047d4add458669015850c248cac2f8b39f2da267264e7bef215c6ff4651b36cddef2f57453e5ab6de7ba7a7999fdc66fba3c60cf8c070dc2e0bd28c9f4cbfa049f4af736f80bfbc80d585831d544f961684a35b14a41dd40111c4274d356e9f2fffbb4eb77b0edd58a4490a34f5a6b834ae596f349ba131263b7e7318a4646c936475864fe6a14b0fcad82eabf7a355ef04ab0718a8a3cffa114c551f44a6a71b864420036885b89c998b7f47308426700b800176268b6b9cee4af3be48c003e6126cf4cab9ff061606686a373a21a7a4a61ffd7df5eb769063ff6bcc3682c5ec432757df673f9aff6c1a5e8f675790f8a6b8751d7c79f8db32b302c1d3a9b5108e24ff30c1f2e68b4801ad433b141a46e9c827c538600278e65a51f8ebeb8194c77fc99ab4c91a6fdf75c292554196b8eb006e652c7c97018db8ce3f7a21a73296bd269e6fc1c42d3d02bfb145a5e4202d6056f40562bddcab9e81e69add85439c933ccb2dee1b333181b2e174802c8cda0ce8bd936e20a418794fae6ed58c0e9b5ea91e61cedc091665bd7038d7af7cc9175e6457fd626c351aa03a5d76b86e8f090624dd7a6575c3f17994423f9d70677e3a84d2965ee6d4f70614d7c8998b741a9e9a81362a1b3f7746013f35ea2919966e3030799dfb7e263e63ed9a9a936a3775c17ddc139a2aa369d78777b53587088739a8ee9bcfe03f561541468090308e6d21db9bde1d40095d34a9e0a1513a7fabdade1309fa77f80d4f51bf8f92cd49cf74e48b80d0413fc9fe861e91c431838091e61bffe94a9a8f9b6448660dc7c3fb8ab8c6a9467c4b580fc6c588b702945a125368261312a9c40e781066b77dfd95afb2278b4a737a0ddec847b48045366688b9424a694390a111165ab4b28f2da525cffdd81f0e3624e10a52ba2f3891fffaa0ba1c650ffe4509794a404126470d811a81ddaf0464d5a8cf31b7238e75ddfa9999f975136353ac68eeb39d1a4f66a71170590e6ba91aba97ac7d039428c85fa425d6d707acf1411618a144f08549f74ac6938fdabc25e7b7a44edd8b3213fe6dfc62046da4aea5f4b85d48c09c01a994ddc9eb0c5a190416868476134b991eb66f16b224bc770cb2df36f42a33b413d36e3f02965f9a2c3bbfbca15be770786376e7b35e7c5a1c390ca07f98f358b981fa18a0a0bb6802d3a67c4d2545252e71ebfa6df775982ae70f9eb737ced39f1921263c16d261f5cb1b84dbf1a3a578fd9460cdc6122265527d34a19480ec6851cd28b0740a5535a9b45d15fe0f9fe60cfff4e8bc840a14ad0388df257375ef8c0729eeef028cd6aa863ea0cce6951d4a6adbd0052ea14349f4726ba763d366319da7e48191ae3faf38a03351e4a5af31c70e3e4f69cf995d783853ef70a9570ec0c7fa1893ddc28104bc29b905e66d618434d4a4c80e5e1503a771751e3f84836e63c020f7d264cd62cb39acac61b53609c3a399e2ed4436cbb5b83f185dcccea986e5371f030bb0e3a25316026166aa81c8a8a3154b2591c52552f1c30da447a2f8377058202dcd2dabc90976bc9b3a0fd1d782c2d9b3fcd68ee62dd5bcd2813c4d80025337a5dde84223aabeb91a12a52fe38fe7f2e5d689ae07233260783eb1720f652d20789dbdb794dba5c941da246396a4de7cf19fdf481ef78ff59be601f0a220b7e5991b25dcacf8edb5a637105fb139c8d7d04d9e88fe3559cf133aa38725b8a4cb00a491652676ca731513d7e03bca1fa57b648a25f1f7ec079b7a1aeec7598e1c0cd228930df20e2aaf0fb97c8cb8e4567d119d3ac25fee1c0e031575eb1e1e6cbdf7a6dafc444055ab1646ed0e0c63774b222b99e08096a0d6a09689dcf8b80271f0082babf29a6260a9ab5021edec8e6a3c7f915e0b742437e420443def7aa3f9aedbb3089fd0473200c31d7ca20e403d3bdcd40b6e73dd772610cd582a1d07d07500f8c043a1098fb3a120d93ddf836c3775a5997b9842bdfdc78615dc83d7bbe97ec7c1c3d4ec504158ab297b755facbc9ef00caaf5c6a4ac45e9dba22cc5b73350a107e123276b84d96601fed3f2e1af18ffa29517dc9cd046d273428627889fd18ddf6a8ac8901509d53bcb3026c62570a0370505ee1d6baeb689955c4b39bbff2fe875e5b9d3eef2a5f61b570ef043bf8d7b7d8090b37364cf01f7b5fcefb538998eff4fee8699e97fd0c91a62c4960b64e12454eb31fc19b3978baaff0c43bba5132c12c27a8817a3e2ac0bb37a74dbaf602504d61538ebcb03aeb277acc64760bf3e0ca2df55da1bcbd00187953c3cd968a90b74beddfe008f90be48bf959091b68f2ce78c0427705411b23fc2e764957cee78869647b67b61da29c33403df1c075730af2246ad2bbf059c962b84dcaaf2de43237578b2efb92b1f66cd6c29e5f5adc2304a87bc416bd71c53350541d444b768f9ebb50ffe3255001f0fc4fa804731710025f253bc005adf1aba619ef6168a5722b185d5075211abb9b09ed00db760dee50167d39777151d14bf12ae9826ddae793eaf601c8aac2f1603dd3b62fdb91ac326063c999e668d7171c98a91705a6fbd617041517afb93d322a823b06ea31a0d6129b0ff9d060305d6dffdd764d02efc129a666ecaa0f109c4a30209c4bbf2cc2156e984c9663ac4bbd655a4a9678e735cdd555c9b73e34480e7ff2878c5f0c29e6d2524ebdc6b67fbd291c3f8509500460649f3dce066879ef2c2884902790fb1309d3e3ecb6dd42179983bd11dc7c6180f27edf97a1563c385127d43166cedb710db3eb326355d00ac08aee1ae4b2b399f357695a41b25ee6dbca79d973e294a25eb06f5159c44f129e2a4068d1dc1eb8f1512dda907a11b911c85a54800f65d91e5dedb9cf1fe7aa027e3fef4c6de92c73e56f96e368acfb62fb156609c72dcf3fc882f9fb889b15b57840114d3709482805b02614c494e95cbc5e382c61857a1726ffa7a88cd135fb8e7ef8e8f24169aba8a356c0a1cb0bf90b26f0d6ea59bf882f653d7630503054c2e9785b21c83f9c93a33dc13c1cb3e7f3d8fd5f40e0e92af02cc4dc37bd1d49bb87dba6d410523b4031974279d9275920fcf8dd50b72e781161bd8a6f5a5b70b096d94c671a0bad05b3ece99921cc250884eaf550e685e12a6e00f59c8a8259c492973ed998444f5b9797b6c342a49aa808c54ef3dc1a65ae297db972936f7cb88fe731d572f423599630d979142643e263e5a773d30915fc2ed0d785197c6bf6bb86156607b328a58a4bbdbd8bb7eb4a2cca4b9ce799b20c8532751c2e088f3d0846326a69d42db34360f8e0a3c5ac1cc5dfb5ec065d68f2b4e5755f890491ca7e56b65a9e70817e50683241b2079fa9fe7f537f67e4434bd5dbe9b194d6913613143ec838a1ab8b219511124290a1d927944e270325cf7bbb21c3a01fe787364101d87777bfef36cc977e47f787d0c39e604f840834d9f086609a28b6b49ab83155ef32cb6193a9abddcb06a6993cb40a396c1e085f600347c2b7ea619eee2c5bb3eb816d2822c46b47d59f1b639dea69ad6a6fc19b2d5418eb624d5a92f26e550e71da463a9f0eba29510dec09e59977dbb9522c9eacda7a6ce1f07908bba9999b86087987c2c38f2c45f85a8de97716957581746b992239e0c96f6d275e9d07e36713de9a5a3becb94ec5621360f8d248a310075ff378af138703e50329bade76649dea85a90e5f07729a94cc8e4f48296f0a05c36c82e3500e6f46b9b1db46b420c39de4b7d1fb13e89bbe469876ee4b244f3778eec28e65f3a2c2e7b2b311e6f8d365d8988d5822feff28cab30b95fa085e2410d5eb82f5480793a9e8fa27063706b5f011d5b7339c03975413b49ad48103dcd770ae60d693b954a07fa8b9e0f2b3a223d82087ffe594d6d7829600273de919a96d0f2452c8716b0e2971dc02a61525f8694b8eba3679238b73ba37383d4718993a0646bfa1c85b7e36df79ae1261ff4ca2ce7b777e45a1a3517acff247e2222ba73f65befb42d94faa88a8c145af5154477f14b5a3cad90858143f159c5008cc5ae69a762298adf36ede7314fe0084538acb9229198e301e0ebb5ef62ece69eca57cd1fc0b905a662c98fa62a30bedbd22ff797add0a167e1e953918b132dd4cfcc8bf7b3ce1cf3002f8917dc4552848c9bc21771fdceb0fbd77dd7618123234b6743fd29dbb18c23b4eff50e38e0409f2a2cfe4bbe734ac85d85b5fc05191402986dc2d4a278956e4fadcc1d641158c05428f7128138c785bccc8c06c59ba5b8988c1c3e5fc92bf40a959662879fc2f4b00a462335ce971e7f7b7553261c798912ed9872328842a1394c84a2af5f1da00fd5dfaa87b37964b7ace8bd7e110aa7c7c65fce19a17c8049488e80d95cea228134b5f05d3f17cdbcba1887fb38279bb6864ec4ec191f1d8181784b135b363978b89358ab9bd8bf0848c1bfcc1934e2de2eaf3f5d2dc23d53bb0f415ee675bac37e5d1e48585a105c9478cd94ace5d1059fc3258f7cf8a197c9bd0ec4658f223053c53101240ca478c11bc6dd8b94462c1243807156080b7f827d94ec85674b703f5fcfecc7f90af2f65f9ba70bab70e474b37b2544a425df406dd0775a5d8719e2316963d53f13708b31a67d7a996ec0b1c4e320dfb25938a4d081e1009672e318779468ba2d5d507d924327919f0b7f76bd45a306cd4fbba5b2a0e945eab386caba321d452a62ce40d1398a7ca5e447329e657987178f006617ca5191dee1676d7a3a566f841c8b82cd9e89bf947c3fbee75125093190d512cb70bc167c29f62ce2c4d82c7279b27c011c3a1e5adb5dd8b5cf64a250c590a0f13be4f38ba4c688f6af4496c396c1ce97cd371499471e890f1a421b94d404192af783fcc4b7996a5753725731782f8b9cda9f82fb9a089c4bff3bda28a2baf48fd97443bfe8f95ed711efe9ccc4d2e1b65f5d67bc49503d8fcfeef5df2300b2f2df07382924451c22579bb55fca85f02e8fcdabf2a2ece3f429204423b39372379dc6d48b350b5c16e18ac78cf212b2655bd8795b21b689039e49820f4e6a0299d74ef23968ffce5c98393395d2833c092039a02861040a9253a0611f40ac89a828c9caa407cf9dc57d8b048d5a07341b8f9061fad1d678bcbe4988db97e9dbdb353e7a8ea5655554b9d7b5992d4983a6db77c5ec95a462354d0db9ca680e13ffd6ac07f75f52462151f914331f89b2dad85cd88d44bf800d4c6aea0fa9c48b7fe25b3ea46ecff43c89e285cbad27ad0ae245c46be7d0b9eb188bdabc3b9b501c4fd13998ff2498aa10cdb52f8e9aa2180b52dd722214560934856cdd413a0844682b450c072341c396fdb1e7232c83311f95461b43d907a6cf2052570cdcae75aec4ebc2d21e111223d0fc4d75df4d53d3bc893baa3fb91ee99b8009d76f49cdaa476894237758fd795f987ec95f88ebafc6e509a9c56c704d1e07772191bb0a9ea2974451471ff1131e8fb0880efec56f6bf6dedcabdc784ca30190db8aaccb5d972ee5227958df1586556fe6c9bb7fbfcc2dba5c2b9c78961327635d147f663cd76a5442dc54e0e1d3930f627c8fb36bd813d59c49a62f5c157c5b9250e58aa02851eea9f6a2fe14857750a558260552d504bb9039d777572fa71f52e88a1841ab10a54b7aebe94046a9a2c7621c4df3b6142fa3a1e2cda6332b927a484fb9578186e5e9f47438f4a2a123e3b7b34c88f5c51739649e5b87c5e0fe8ecd68a6278ce0afce79a7b82010fe7f41d71e73d804601364a3dee89b9b919d51e1b8f3fb696fb9787df427d46e75db528a051fddd1e4c314c3da0ca15e03c16be82a0816fc0840189b0ba45523e7fb1ae5a1c98b384689d8775ac7f675f7f1f4a28368032b30795986ed95033607aa72689c44551243416db292007da123b7700dac53ea18973b24c63e9f8e0331450d672b99d1a9bb7116444c01f46040997d6c720d836e0daa109368db89927d2d6280b22684f581cb129268295b281103746348c288f0e904989ff638892ddca22952fde2cc8cee6dcc4b3601f22e7c27f1f78427c324d57dd56437cb31462909da1a0e1485691a47858c36034ae13a2997b7569d8a81a62494bc56203c57a3c9a6bfa3684aea392df1a537ddaed992814dc81719e95e443a21a85d03f633438d152b2df343acd7c2c570f3b2bfdb0a057c86b3d800c827fc1d4d39a4f6b22f89c3774296da68ba5f37542753eccaf92a8d0742951dc2f4cf4a0d19de7456ad4f7cfeb1a0f6fcf9af6dabaf462b4ecced3d195fe1b2e82bae23af088ed48f9dcbe3704ff614adf382373dc8dd9432c39cdbd48f2730e08be81dcce2179494f98da010b7e6164ddd88f7604b1e813505b6803d9611fb22b86801b986ee8d72a5e6d25dadf9f13e4d7c558e045d6c9ec1f7a607414ed6726d08ac780a2dd5bf5cb03c8bbd896fb0d94aae4925eb2f24ca2783b7a061d9bed376b3724ad6393ed08c817aa5dd9ffbee22f3656d0948d312264976dae5c6b2dd5fe93dec513c13680c5371a6f742957e248ecedd5220472c28c930d2f2d863e52d15af9e1570a88b01c9632dcc7f038c4e264d83997f3694751f808788a7a652b5b00361b7588a0855f6fd123434766ef36128b2aed370199f1b98d62a7e8f75e6471e248cd7ad615d1cf5a0e037d894a007dd467211ed07f0564777b676f88de294c659b5b7ec9dc46f68529f518d85d5c9be6b82ecc73137a7c3a9192258d189ff7efb598d202c501c7606b48c899b5c9aba85aadabc1d67c055d998d2321016823e4dd6c2be473bcde5ad5c7f4264ecad21d7252bc5418e74c99d7db7675aa9b5383dddf1082eb6bbe1efbbd05487ef3a61315eef3933d32ddda3360712724cde070e4ed36349abb3f756881d3dfb7fc71e646277abc197662d1d81b24b70663b347c0e06a2c48fb23fb4ed42716a72c09033b386563a08968c5b55dc9a77c7789896ba14266d3023d388b1811b87d21454a90d8d5853183d3ba3d3d3f8af59167d120ea504acb005d73a8169f59c8c6cae07dd77458f9b28a11a6f08d65acd478c814d0eccd98ca43ba251804df69c446611a42977b6ef9c09cf906329317c0930a6e15832957e8e51f34ddb288408d57a55ccd6e9443cc17a81ad57bbc52928e855214afbf1fbe48138fbb25a71df3a1cb2abe803df77e7f7086ba591ecb7f098b0d96178c161a9ac146fa4666731ceb355c7c48baf392f2f02e3545d448c0237c4b552a6e6cf0cfcf28e130ae50e41a9c491bb05d6baba768677bbc68b682e136c6829fc30c93a93276ca96ab5170e3c41d47031a0c1de7fd5dd6da9730e79ecf095dda3ab815e3a7f451948a098bf915ca849de967d2a11ad8ff0376172e67b065364d3bb28f9ce095fd7f31df4c3e499d6129ac17d3e1a243937503878833ebc0280f781c3ac14164b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe950fc8893ce690c41c30bb1a9846adcef56fe53eeb84398327326ce74b71f9069214cebea7c0677ad4c1c530bb2516bab0ca560779be256a7260acf5d576b9b3118d409387e386ddf67b1f02a03542b092edfb32be734144f947a53916972e39d515f7bf0f4839e721dfbf7814e4a990deaf77cbc2517c38d54e651caf8a34dfe0d59daf186fbe30b578aa59f9add67080011d2b490316ec124cdf0f936282d5d0b3ee9c1c79fe5f6cb5d7a3359f607b62472ea5bdc75008d17e4e608e514be761c2" +]; + +pub struct UnstuckSnowbridge; + +impl OnRuntimeUpgrade for UnstuckSnowbridge { + fn on_runtime_upgrade() -> Weight { + if !is_bridge_stuck() { + return RocksDbWeight::get().reads(1); + } + + log::info!(target: LOG_TARGET, "Updating beacon checkpoint to unstuck beacon client"); + + let checkpoint_update = checkpoint_update(); + let sync_committee: SyncCommitteePrepared = (&checkpoint_update.current_sync_committee) + .try_into() + .expect("checked by tests; qed"); + let header_root = checkpoint_update.header.hash_tree_root().expect("checked by tests; qed"); + + CurrentSyncCommittee::::put(sync_committee); + NextSyncCommittee::::kill(); + InitialCheckpointRoot::::put(header_root); + FinalizedBeaconStateBuffer::::insert( + header_root, + snowbridge_beacon_primitives::CompactBeaconState { + slot: checkpoint_update.header.slot, + block_roots_root: checkpoint_update.block_roots_root, + }, + ); + LatestFinalizedBlockRoot::::put(header_root); + LatestExecutionState::::kill(); + + weights::snowbridge_pallet_ethereum_client::WeightInfo::::force_checkpoint() + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + if is_bridge_stuck() { + log::info!(target: LOG_TARGET, "Going to unstuck Snowbridge."); + } else { + log::info!(target: LOG_TARGET, "Snowbridge is not stuck."); + } + Ok(vec![]) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_: Vec) -> Result<(), TryRuntimeError> { + frame_support::ensure!(!is_bridge_stuck(), "Snowbridge is still stuck."); + Ok(()) + } +} + +fn is_bridge_stuck() -> bool { + LatestFinalizedBlockRoot::::get() == LAST_IMPORTED_BEACON_HEADER.into() +} + +fn checkpoint_update() -> Box { + Box::new(CheckpointUpdate::decode(&mut &NEW_CHECKPOINT[..]).expect("checked by tests; qed")) +} + +#[cfg(test)] +mod tests { + use super::*; + + use snowbridge_beacon_primitives::BlsError; + use sp_core::H256; + + #[test] + fn validate_checkpoint() { + let checkpoint_update = CheckpointUpdate::decode(&mut &NEW_CHECKPOINT[..]).unwrap(); + let sync_committee: Result = + (&checkpoint_update.current_sync_committee).try_into(); + assert!(sync_committee.is_ok()); + + let header_root = checkpoint_update.header.hash_tree_root().unwrap(); + + // Header should match https://beaconscan.com/slot/9094528 + let expected_header_root: H256 = + hex!("84a581291c4a4fe66879c4647a1084ee584ea5c8ac82009aee323a66bf865e82").into(); + assert_eq!(expected_header_root, header_root); + } +} diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 37d537ba48..046e66e3d3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -23,6 +23,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); pub mod bridge_to_ethereum_config; +mod bridge_to_ethereum_unstuck; pub mod bridge_to_kusama_config; mod bridge_to_kusama_unstuck; mod weights; @@ -149,6 +150,7 @@ pub type Migrations = ( ConstU32, >, bridge_to_kusama_unstuck::BridgeToKusamaUnstuck, + bridge_to_ethereum_unstuck::UnstuckSnowbridge, pallet_collator_selection::migration::v2::MigrationToV2, // permanent pallet_xcm::migration::MigrateToLatestXcmVersion, From b6f99f2f039af925f405d07318698787b804d4d4 Mon Sep 17 00:00:00 2001 From: Muharem Date: Sun, 19 May 2024 16:57:57 +0200 Subject: [PATCH 13/15] Drop ED Requirement for Transaction Payment with Exchangeable Asset (#310) Drop the Existential Deposit (ED) requirement for the asset amount exchangeable for the fee asset (DOT/KSM) during transaction payments. Currently, every swap during transaction payment, processed with asset `A` for native asset, must be for an amount greater than the ED of a native asset if the user lacks a native asset account. Since fees are typically smaller, the current implementation necessitates additional swaps to meet the ED during `pre_dispatch`, with refunds for excess ED swap occurring during `post_dispatch`. Further details can be found [here](https://github.com/paritytech/polkadot-sdk/blob/115c2477eb287df55107cd95594100ba395ed239/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/payment.rs#L115). This setup presents an issue where a user is unable to transfer their entire balance and close the account. Instead, the user must transfer slightly less of asset `A` to ensure there is enough not only for the fee payment but also some extra to meet the ED requirement for their native account during `pre_dispatch`. In some cases during `post_dispatch`, the user will have the excess ED swapped back to asset `A`, while in other cases, it may not be sufficient to meet the ED requirement for asset `A`, leading it being left in the user's 'temporary' native asset account. Example: https://assethub-polkadot.subscan.io/extrinsic/6204018-9?event=6204018-79 Given the importance of this scenario for CEX, I propose a solution that does not entail breaking changes to the pallets' API and open PR to the runtimes without waiting for new polkadot-sdk version. Additionally, I have opened a draft PR with these types in their respective pallets in FRAME, where they have been tested against existing tests for types implementing the same contract. PR - https://github.com/paritytech/polkadot-sdk/pull/4455 Target implementation with breaking changes: https://github.com/paritytech/polkadot-sdk/pull/4488 --------- Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> --- CHANGELOG.md | 1 + .../asset-hubs/asset-hub-kusama/src/impls.rs | 303 ++++++++++++++++++ .../asset-hubs/asset-hub-kusama/src/lib.rs | 16 +- .../asset-hub-polkadot/src/impls.rs | 287 +++++++++++++++++ .../asset-hubs/asset-hub-polkadot/src/lib.rs | 19 +- 5 files changed, 611 insertions(+), 15 deletions(-) create mode 100644 system-parachains/asset-hubs/asset-hub-kusama/src/impls.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 206de34099..1547495505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -123,6 +123,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Update the fellowship salary budget amount in alignment with the Fellowship Salary [RFC](https://github.com/polkadot-fellows/RFCs/pull/50) ([polkadot-fellows/runtimes#121](https://github.com/polkadot-fellows/runtimes/pull/121)) - Set up an account ID for the local root location on Polkadot Collectives ([polkadot-fellows/runtimes#125](https://github.com/polkadot-fellows/runtimes/pull/125)) - Increase confirmation period for treasury spend tracks on Polkadot & Kusama ([polkadot-fellows/runtimes#119](https://github.com/polkadot-fellows/runtimes/pull/119)) +- Drop ED requirement for transaction payments with an exchangeable asset ([polkadot-fellows/runtimes#310](https://github.com/polkadot-fellows/runtimes/pull/310)) ### Added diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/impls.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/impls.rs new file mode 100644 index 0000000000..68a3bfb318 --- /dev/null +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/impls.rs @@ -0,0 +1,303 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::*; + +// TODO: move implementations to the polkadot-sdk. +pub mod tx_payment { + use super::*; + use core::marker::PhantomData; + use frame_support::{ + ensure, + pallet_prelude::{InvalidTransaction, TransactionValidityError}, + traits::{ + fungibles::{Balanced as FungiblesBalanced, Inspect as FungiblesInspect}, + tokens::{Fortitude, Precision, Preservation}, + Defensive, OnUnbalanced, SameOrOther, + }, + }; + use pallet_asset_conversion::{Pallet as AssetConversion, SwapCredit}; + use pallet_asset_conversion_tx_payment::OnChargeAssetTransaction; + use pallet_transaction_payment::OnChargeTransaction; + use sp_core::Get; + use sp_runtime::{ + traits::{DispatchInfoOf, PostDispatchInfoOf, Zero}, + Saturating, + }; + + /// Implements [`OnChargeTransaction`] for [`pallet_transaction_payment`], where the asset class + /// used to pay the fee is defined with the `A` type parameter (eg. KSM location) and accessed + /// via the type implementing the [`frame_support::traits::fungibles`] trait. + /// + /// This implementation with the `fungibles` trait is necessary to set up + /// [`pallet_asset_conversion_tx_payment`] with the [`SwapCreditAdapter`] type. For both types, + /// the credit types they handle must be the same, therefore they must be credits of + /// `fungibles`. + pub struct FungiblesAdapter(PhantomData<(F, A, OU)>); + + impl OnChargeTransaction for FungiblesAdapter + where + T: pallet_transaction_payment::Config, + F: fungibles::Balanced, + A: Get, + OU: OnUnbalanced>, + { + type LiquidityInfo = Option>; + type Balance = F::Balance; + + fn withdraw_fee( + who: &::AccountId, + _call: &::RuntimeCall, + _dispatch_info: &DispatchInfoOf<::RuntimeCall>, + fee: Self::Balance, + _tip: Self::Balance, + ) -> Result { + if fee.is_zero() { + return Ok(None) + } + + match F::withdraw( + A::get(), + who, + fee, + Precision::Exact, + Preservation::Preserve, + Fortitude::Polite, + ) { + Ok(imbalance) => Ok(Some(imbalance)), + Err(_) => Err(InvalidTransaction::Payment.into()), + } + } + + fn correct_and_deposit_fee( + who: &::AccountId, + _dispatch_info: &DispatchInfoOf<::RuntimeCall>, + _post_info: &PostDispatchInfoOf<::RuntimeCall>, + corrected_fee: Self::Balance, + _tip: Self::Balance, + already_withdrawn: Self::LiquidityInfo, + ) -> Result<(), TransactionValidityError> { + let Some(paid) = already_withdrawn else { + return Ok(()); + }; + // Make sure the credit is in desired asset id. + ensure!(paid.asset() == A::get(), InvalidTransaction::Payment); + // Calculate how much refund we should return. + let refund_amount = paid.peek().saturating_sub(corrected_fee); + // Refund to the the account that paid the fees if it was not removed by the + // dispatched function. If fails for any reason (eg. ED requirement is not met) no + // refund given. + let refund_debt = + if F::total_balance(A::get(), who).is_zero() || refund_amount.is_zero() { + fungibles::Debt::::zero(A::get()) + } else { + F::deposit(A::get(), who, refund_amount, Precision::BestEffort) + .unwrap_or_else(|_| fungibles::Debt::::zero(A::get())) + }; + // Merge the imbalance caused by paying the fees and refunding parts of it again. + let adjusted_paid: fungibles::Credit = + match paid.offset(refund_debt).defensive_proof("credits should be identical") { + Ok(SameOrOther::Same(credit)) => credit, + // Paid amount is fully refunded. + Ok(SameOrOther::None) => fungibles::Credit::::zero(A::get()), + // Should never fail as at this point the asset id is always valid and the + // refund amount is not greater than paid amount. + _ => return Err(InvalidTransaction::Payment.into()), + }; + // No separation for simplicity. + // In our case the fees and the tips are deposited to the same pot. + // We cannot call [`OnUnbalanced::on_unbalanceds`] since fungibles credit does not + // implement `Imbalanced` trait. + OU::on_unbalanced(adjusted_paid); + Ok(()) + } + } + + type LiquidityInfoOf = + <::OnChargeTransaction as OnChargeTransaction< + T, + >>::LiquidityInfo; + + /// Implements [`OnChargeAssetTransaction`] for [`pallet_asset_conversion_tx_payment`], where + /// the asset class used to pay the fee is defined with the `A` type parameter (eg. DOT + /// location) and accessed via the type implementing the [`frame_support::traits::fungibles`] + /// trait. + pub struct SwapCreditAdapter(PhantomData<(A, S)>); + impl OnChargeAssetTransaction for SwapCreditAdapter + where + A: Get, + S: SwapCredit< + T::AccountId, + Balance = T::Balance, + AssetKind = T::AssetKind, + Credit = fungibles::Credit, + >, + + T: pallet_asset_conversion_tx_payment::Config, + T::Fungibles: + fungibles::Inspect, + T::OnChargeTransaction: + OnChargeTransaction>, + { + type AssetId = T::AssetKind; + type Balance = T::Balance; + type LiquidityInfo = T::Balance; + + fn withdraw_fee( + who: &::AccountId, + _call: &::RuntimeCall, + _dispatch_info: &DispatchInfoOf<::RuntimeCall>, + asset_id: Self::AssetId, + fee: Self::Balance, + _tip: Self::Balance, + ) -> Result<(LiquidityInfoOf, Self::LiquidityInfo, T::Balance), TransactionValidityError> + { + let asset_fee = AssetConversion::::quote_price_tokens_for_exact_tokens( + asset_id.clone(), + A::get(), + fee, + true, + ) + .ok_or(InvalidTransaction::Payment)?; + + let asset_fee_credit = T::Assets::withdraw( + asset_id.clone(), + who, + asset_fee, + Precision::Exact, + Preservation::Preserve, + Fortitude::Polite, + ) + .map_err(|_| TransactionValidityError::from(InvalidTransaction::Payment))?; + + let (fee_credit, change) = match S::swap_tokens_for_exact_tokens( + vec![asset_id, A::get()], + asset_fee_credit, + fee, + ) { + Ok((fee_credit, change)) => (fee_credit, change), + Err((credit_in, _)) => { + // The swap should not error since the price quote was successful. + let _ = T::Assets::resolve(who, credit_in).defensive(); + return Err(InvalidTransaction::Payment.into()) + }, + }; + + // Should be always zero since the exact price was quoted before. + ensure!(change.peek().is_zero(), InvalidTransaction::Payment); + + Ok((Some(fee_credit), fee, asset_fee)) + } + fn correct_and_deposit_fee( + who: &::AccountId, + dispatch_info: &DispatchInfoOf<::RuntimeCall>, + post_info: &PostDispatchInfoOf<::RuntimeCall>, + corrected_fee: Self::Balance, + tip: Self::Balance, + fee_paid: LiquidityInfoOf, + _received_exchanged: Self::LiquidityInfo, + asset_id: Self::AssetId, + initial_asset_consumed: T::Balance, + ) -> Result { + let Some(fee_paid) = fee_paid else { + return Ok(Zero::zero()); + }; + // Try to refund if the fee paid is more than the corrected fee and the account was not + // removed by the dispatched function. + let (fee, fee_in_asset) = if fee_paid.peek() > corrected_fee && + !T::Assets::total_balance(asset_id.clone(), who).is_zero() + { + let refund_amount = fee_paid.peek().saturating_sub(corrected_fee); + // Check if the refund amount can be swapped back into the asset used by `who` for + // fee payment. + let refund_asset_amount = + AssetConversion::::quote_price_exact_tokens_for_tokens( + A::get(), + asset_id.clone(), + refund_amount, + true, + ) + // No refund given if it cannot be swapped back. + .unwrap_or(Zero::zero()); + + // Deposit the refund before the swap to ensure it can be processed. + let debt = match T::Assets::deposit( + asset_id.clone(), + who, + refund_asset_amount, + Precision::BestEffort, + ) { + Ok(debt) => debt, + // No refund given since it cannot be deposited. + Err(_) => fungibles::Debt::::zero(asset_id.clone()), + }; + + if debt.peek().is_zero() { + // No refund given. + (fee_paid, initial_asset_consumed) + } else { + let (refund, fee_paid) = fee_paid.split(refund_amount); + match S::swap_exact_tokens_for_tokens( + vec![A::get(), asset_id], + refund, + Some(refund_asset_amount), + ) { + Ok(refund_asset) => { + match refund_asset.offset(debt) { + Ok(SameOrOther::None) => {}, + // This arm should never be reached, as the amount of `debt` is + // expected to be exactly equal to the amount of `refund_asset` + // credit. + _ => return Err(InvalidTransaction::Payment.into()), + }; + (fee_paid, initial_asset_consumed.saturating_sub(refund_asset_amount)) + }, + // The error should not occur since swap was quoted before. + Err((refund, _)) => { + match T::Assets::settle(who, debt, Preservation::Expendable) { + Ok(dust) => + ensure!(dust.peek().is_zero(), InvalidTransaction::Payment), + // The error should not occur as the `debt` was just withdrawn + // above. + Err(_) => return Err(InvalidTransaction::Payment.into()), + }; + let fee_paid = fee_paid.merge(refund).map_err(|_| { + // The error should never occur since `fee_paid` and `refund` are + // credits of the same asset. + TransactionValidityError::from(InvalidTransaction::Payment) + })?; + (fee_paid, initial_asset_consumed) + }, + } + } + } else { + (fee_paid, initial_asset_consumed) + }; + + // Refund is already processed. + let corrected_fee = fee.peek(); + // Deposit fee. + T::OnChargeTransaction::correct_and_deposit_fee( + who, + dispatch_info, + post_info, + corrected_fee, + tip, + Some(fee), + ) + .map(|_| fee_in_asset) + } + } +} diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 1e4afc6a7d..84c05c6a85 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -24,6 +24,7 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +mod impls; mod weights; pub mod xcm_config; @@ -69,11 +70,10 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, EnsureSigned, EnsureSignedBy, }; -use pallet_asset_conversion_tx_payment::AssetConversionAdapter; use pallet_nfts::PalletFeatures; use parachains_common::{ - impls::DealWithFees, message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, - BlockNumber, Hash, Header, Nonce, Signature, + message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, Hash, + Header, Nonce, Signature, }; use sp_runtime::RuntimeDebug; pub use system_parachains_constants::SLOT_DURATION; @@ -254,12 +254,16 @@ impl pallet_vesting::Config for Runtime { parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = system_parachains_constants::kusama::fee::TRANSACTION_BYTE_FEE; + pub StakingPot: AccountId = CollatorSelection::account_id(); } impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = - pallet_transaction_payment::CurrencyAdapter>; + type OnChargeTransaction = impls::tx_payment::FungiblesAdapter< + NativeAndAssets, + KsmLocationV3, + ResolveAssetTo, + >; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; @@ -807,7 +811,7 @@ impl pallet_asset_conversion_tx_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Fungibles = LocalAndForeignAssets; type OnChargeAssetTransaction = - AssetConversionAdapter; + impls::tx_payment::SwapCreditAdapter; } parameter_types! { diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs index 07d682f18a..e0bc895072 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs @@ -72,3 +72,290 @@ pub(crate) mod pool { } } } + +// TODO: move implementations to the polkadot-sdk. +pub mod tx_payment { + use super::*; + use core::marker::PhantomData; + use frame_support::{ + ensure, + pallet_prelude::{InvalidTransaction, TransactionValidityError}, + traits::{ + fungibles::{Balanced as FungiblesBalanced, Inspect as FungiblesInspect}, + tokens::{Fortitude, Precision, Preservation}, + Defensive, OnUnbalanced, SameOrOther, + }, + }; + use pallet_asset_conversion::{Pallet as AssetConversion, SwapCredit}; + use pallet_asset_conversion_tx_payment::OnChargeAssetTransaction; + use pallet_transaction_payment::OnChargeTransaction; + use sp_core::Get; + use sp_runtime::{ + traits::{DispatchInfoOf, PostDispatchInfoOf, Zero}, + Saturating, + }; + + /// Implements [`OnChargeTransaction`] for [`pallet_transaction_payment`], where the asset class + /// used to pay the fee is defined with the `A` type parameter (eg. KSM location) and accessed + /// via the type implementing the [`frame_support::traits::fungibles`] trait. + /// + /// This implementation with the `fungibles` trait is necessary to set up + /// [`pallet_asset_conversion_tx_payment`] with the [`SwapCreditAdapter`] type. For both types, + /// the credit types they handle must be the same, therefore they must be credits of + /// `fungibles`. + pub struct FungiblesAdapter(PhantomData<(F, A, OU)>); + + impl OnChargeTransaction for FungiblesAdapter + where + T: pallet_transaction_payment::Config, + F: fungibles::Balanced, + A: Get, + OU: OnUnbalanced>, + { + type LiquidityInfo = Option>; + type Balance = F::Balance; + + fn withdraw_fee( + who: &::AccountId, + _call: &::RuntimeCall, + _dispatch_info: &DispatchInfoOf<::RuntimeCall>, + fee: Self::Balance, + _tip: Self::Balance, + ) -> Result { + if fee.is_zero() { + return Ok(None) + } + + match F::withdraw( + A::get(), + who, + fee, + Precision::Exact, + Preservation::Preserve, + Fortitude::Polite, + ) { + Ok(imbalance) => Ok(Some(imbalance)), + Err(_) => Err(InvalidTransaction::Payment.into()), + } + } + + fn correct_and_deposit_fee( + who: &::AccountId, + _dispatch_info: &DispatchInfoOf<::RuntimeCall>, + _post_info: &PostDispatchInfoOf<::RuntimeCall>, + corrected_fee: Self::Balance, + _tip: Self::Balance, + already_withdrawn: Self::LiquidityInfo, + ) -> Result<(), TransactionValidityError> { + let Some(paid) = already_withdrawn else { + return Ok(()); + }; + // Make sure the credit is in desired asset id. + ensure!(paid.asset() == A::get(), InvalidTransaction::Payment); + // Calculate how much refund we should return. + let refund_amount = paid.peek().saturating_sub(corrected_fee); + // Refund to the the account that paid the fees if it was not removed by the + // dispatched function. If fails for any reason (eg. ED requirement is not met) no + // refund given. + let refund_debt = + if F::total_balance(A::get(), who).is_zero() || refund_amount.is_zero() { + fungibles::Debt::::zero(A::get()) + } else { + F::deposit(A::get(), who, refund_amount, Precision::BestEffort) + .unwrap_or_else(|_| fungibles::Debt::::zero(A::get())) + }; + // Merge the imbalance caused by paying the fees and refunding parts of it again. + let adjusted_paid: fungibles::Credit = + match paid.offset(refund_debt).defensive_proof("credits should be identical") { + Ok(SameOrOther::Same(credit)) => credit, + // Paid amount is fully refunded. + Ok(SameOrOther::None) => fungibles::Credit::::zero(A::get()), + // Should never fail as at this point the asset id is always valid and the + // refund amount is not greater than paid amount. + _ => return Err(InvalidTransaction::Payment.into()), + }; + // No separation for simplicity. + // In our case the fees and the tips are deposited to the same pot. + // We cannot call [`OnUnbalanced::on_unbalanceds`] since fungibles credit does not + // implement `Imbalanced` trait. + OU::on_unbalanced(adjusted_paid); + Ok(()) + } + } + + type LiquidityInfoOf = + <::OnChargeTransaction as OnChargeTransaction< + T, + >>::LiquidityInfo; + + /// Implements [`OnChargeAssetTransaction`] for [`pallet_asset_conversion_tx_payment`], where + /// the asset class used to pay the fee is defined with the `A` type parameter (eg. DOT + /// location) and accessed via the type implementing the [`frame_support::traits::fungibles`] + /// trait. + pub struct SwapCreditAdapter(PhantomData<(A, S)>); + impl OnChargeAssetTransaction for SwapCreditAdapter + where + A: Get, + S: SwapCredit< + T::AccountId, + Balance = T::Balance, + AssetKind = T::AssetKind, + Credit = fungibles::Credit, + >, + + T: pallet_asset_conversion_tx_payment::Config, + T::Fungibles: + fungibles::Inspect, + T::OnChargeTransaction: + OnChargeTransaction>, + { + type AssetId = T::AssetKind; + type Balance = T::Balance; + type LiquidityInfo = T::Balance; + + fn withdraw_fee( + who: &::AccountId, + _call: &::RuntimeCall, + _dispatch_info: &DispatchInfoOf<::RuntimeCall>, + asset_id: Self::AssetId, + fee: Self::Balance, + _tip: Self::Balance, + ) -> Result<(LiquidityInfoOf, Self::LiquidityInfo, T::Balance), TransactionValidityError> + { + let asset_fee = AssetConversion::::quote_price_tokens_for_exact_tokens( + asset_id.clone(), + A::get(), + fee, + true, + ) + .ok_or(InvalidTransaction::Payment)?; + + let asset_fee_credit = T::Assets::withdraw( + asset_id.clone(), + who, + asset_fee, + Precision::Exact, + Preservation::Preserve, + Fortitude::Polite, + ) + .map_err(|_| TransactionValidityError::from(InvalidTransaction::Payment))?; + + let (fee_credit, change) = match S::swap_tokens_for_exact_tokens( + vec![asset_id, A::get()], + asset_fee_credit, + fee, + ) { + Ok((fee_credit, change)) => (fee_credit, change), + Err((credit_in, _)) => { + // The swap should not error since the price quote was successful. + let _ = T::Assets::resolve(who, credit_in).defensive(); + return Err(InvalidTransaction::Payment.into()) + }, + }; + + // Should be always zero since the exact price was quoted before. + ensure!(change.peek().is_zero(), InvalidTransaction::Payment); + + Ok((Some(fee_credit), fee, asset_fee)) + } + fn correct_and_deposit_fee( + who: &::AccountId, + dispatch_info: &DispatchInfoOf<::RuntimeCall>, + post_info: &PostDispatchInfoOf<::RuntimeCall>, + corrected_fee: Self::Balance, + tip: Self::Balance, + fee_paid: LiquidityInfoOf, + _received_exchanged: Self::LiquidityInfo, + asset_id: Self::AssetId, + initial_asset_consumed: T::Balance, + ) -> Result { + let Some(fee_paid) = fee_paid else { + return Ok(Zero::zero()); + }; + // Try to refund if the fee paid is more than the corrected fee and the account was not + // removed by the dispatched function. + let (fee, fee_in_asset) = if fee_paid.peek() > corrected_fee && + !T::Assets::total_balance(asset_id.clone(), who).is_zero() + { + let refund_amount = fee_paid.peek().saturating_sub(corrected_fee); + // Check if the refund amount can be swapped back into the asset used by `who` for + // fee payment. + let refund_asset_amount = + AssetConversion::::quote_price_exact_tokens_for_tokens( + A::get(), + asset_id.clone(), + refund_amount, + true, + ) + // No refund given if it cannot be swapped back. + .unwrap_or(Zero::zero()); + + // Deposit the refund before the swap to ensure it can be processed. + let debt = match T::Assets::deposit( + asset_id.clone(), + who, + refund_asset_amount, + Precision::BestEffort, + ) { + Ok(debt) => debt, + // No refund given since it cannot be deposited. + Err(_) => fungibles::Debt::::zero(asset_id.clone()), + }; + + if debt.peek().is_zero() { + // No refund given. + (fee_paid, initial_asset_consumed) + } else { + let (refund, fee_paid) = fee_paid.split(refund_amount); + match S::swap_exact_tokens_for_tokens( + vec![A::get(), asset_id], + refund, + Some(refund_asset_amount), + ) { + Ok(refund_asset) => { + match refund_asset.offset(debt) { + Ok(SameOrOther::None) => {}, + // This arm should never be reached, as the amount of `debt` is + // expected to be exactly equal to the amount of `refund_asset` + // credit. + _ => return Err(InvalidTransaction::Payment.into()), + }; + (fee_paid, initial_asset_consumed.saturating_sub(refund_asset_amount)) + }, + // The error should not occur since swap was quoted before. + Err((refund, _)) => { + match T::Assets::settle(who, debt, Preservation::Expendable) { + Ok(dust) => + ensure!(dust.peek().is_zero(), InvalidTransaction::Payment), + // The error should not occur as the `debt` was just withdrawn + // above. + Err(_) => return Err(InvalidTransaction::Payment.into()), + }; + let fee_paid = fee_paid.merge(refund).map_err(|_| { + // The error should never occur since `fee_paid` and `refund` are + // credits of the same asset. + TransactionValidityError::from(InvalidTransaction::Payment) + })?; + (fee_paid, initial_asset_consumed) + }, + } + } + } else { + (fee_paid, initial_asset_consumed) + }; + + // Refund is already processed. + let corrected_fee = fee.peek(); + // Deposit fee. + T::OnChargeTransaction::correct_and_deposit_fee( + who, + dispatch_info, + post_info, + corrected_fee, + tip, + Some(fee), + ) + .map(|_| fee_in_asset) + } + } +} diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index d0bdc2edb1..1c97b9c0ed 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -106,8 +106,8 @@ use frame_system::{ }; use pallet_nfts::PalletFeatures; use parachains_common::{ - impls::DealWithFees, message_queue::*, AccountId, AssetHubPolkadotAuraId as AuraId, - AssetIdForTrustBackedAssets, Balance, BlockNumber, Hash, Header, Nonce, Signature, + message_queue::*, AccountId, AssetHubPolkadotAuraId as AuraId, AssetIdForTrustBackedAssets, + Balance, BlockNumber, Hash, Header, Nonce, Signature, }; use sp_runtime::RuntimeDebug; @@ -272,12 +272,16 @@ impl pallet_vesting::Config for Runtime { parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = system_parachains_constants::polkadot::fee::TRANSACTION_BYTE_FEE; + pub StakingPot: AccountId = CollatorSelection::account_id(); } impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = - pallet_transaction_payment::CurrencyAdapter>; + type OnChargeTransaction = impls::tx_payment::FungiblesAdapter< + NativeAndAssets, + DotLocationV3, + ResolveAssetTo, + >; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; @@ -732,11 +736,8 @@ impl pallet_collator_selection::Config for Runtime { impl pallet_asset_conversion_tx_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Fungibles = LocalAndForeignAssets; - type OnChargeAssetTransaction = pallet_asset_conversion_tx_payment::AssetConversionAdapter< - Balances, - AssetConversion, - DotLocationV3, - >; + type OnChargeAssetTransaction = + impls::tx_payment::SwapCreditAdapter; } parameter_types! { From b0a3effb1a0ed5fca31980fb96dd510d8f68dad0 Mon Sep 17 00:00:00 2001 From: Muharem Date: Mon, 20 May 2024 18:42:15 +0200 Subject: [PATCH 14/15] The Ambassador Program (#291) ### The Ambassador Program on Polkadot Collectives Parachain Closes https://github.com/polkadot-fellows/runtimes/issues/264 Reflects https://polkadot.polkassembly.io/referenda/487 ### On Chain Structure The on-chain program consists of three ranks: - Ambassadors (rank 1); - Senior Ambassadors (rank 2); - Head Ambassadors (rank 3); Each rank has a corresponding Origin (`Ambassador`, `SeniorAmbassador`, `HeadAmbassador`), which represents the collective voice of members of that rank and above. ### Referendum The `AmbassadorReferenda` instance of [referenda pallet](https://docs.rs/pallet-referenda/latest/pallet_referenda/) consists of three tracks, each corresponding to an Origin. A referendum taken on `senior ambassador` track invites all members from rank 2 or above to vote and commands `SeniorAmbassadors` Origin. The referendum proposal can be submitted by any member from first rank or above. ### Membership Management Both `Root` and `FellowshipAdmin` Origins, commanded via public Polkadot referendum, can promote or demote members to and from any rank. Members themselves hold the power to promote or demote via program's referendum pallet instance. Senior members can promote candidates to the first rank, while head members can promote all members up to the second rank. Any member of the program can induct a new member to the collective as a candidate (0 rank). Promotion to the Head Ambassador or demotion from can be made with Polkadot OpenGov. ### Sub-Treasury The program operates its own sub-treasury, managed by OpenGov or Senior and Head Ambassadors. Members can spend up to 1k DOT on Senior Ambassador track and up to 10k DOT on Head Ambassadors track. ### Additional Functionality The `AmbassadorCore` instance of [core fellowship pallet](https://docs.rs/pallet-core-fellowship/latest/pallet_core_fellowship/) decorates the ranked collectives pallet with features like salary determination, activity/passivity registration, and the handling of promotion and demotion periods. Those parameters can be set by OpenGov or Head Ambassadors. Periodic salaries in USDt, payable on Asset Hub, are introduced through the [salary pallet](https://docs.rs/pallet-salary/latest/pallet_salary/). The total monthly budget is set to ( 10k * 21 ) USDt. ### Rules that are not enforced on chain - 21 members at Head Ambassador rank; - candidates wont be removed automatically in 6 month; - collectives with less than 10 HA can onboard new members; Source: https://polkadot.polkassembly.io/referenda/487cccccbegbjkdfhkrgekidfrhvkvilnbcvuitgnrcnkrr --------- Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: joepetrowski --- CHANGELOG.md | 1 + .../asset-hub-polkadot/src/xcm_config.rs | 28 + .../collectives-polkadot/constants/src/lib.rs | 10 +- .../src/ambassador/mod.rs | 358 ++++++++++++ .../src/ambassador/origins.rs | 112 ++++ .../src/ambassador/tracks.rs | 138 +++++ .../src/fellowship/mod.rs | 26 +- .../collectives-polkadot/src/impls.rs | 2 - .../collectives-polkadot/src/lib.rs | 26 + .../collectives-polkadot/src/weights/mod.rs | 15 +- .../pallet_core_fellowship_ambassador_core.rs | 226 ++++++++ ...pallet_core_fellowship_fellowship_core.rs} | 66 +-- ...ranked_collective_ambassador_collective.rs | 200 +++++++ ...anked_collective_fellowship_collective.rs} | 60 +- .../pallet_referenda_ambassador_referenda.rs | 539 ++++++++++++++++++ ... pallet_referenda_fellowship_referenda.rs} | 132 ++--- .../pallet_salary_ambassador_salary.rs | 193 +++++++ ....rs => pallet_salary_fellowship_salary.rs} | 48 +- .../pallet_treasury_ambassador_treasury.rs | 224 ++++++++ ...=> pallet_treasury_fellowship_treasury.rs} | 78 +-- .../collectives-polkadot/src/xcm_config.rs | 19 +- system-parachains/constants/src/polkadot.rs | 2 + 22 files changed, 2283 insertions(+), 220 deletions(-) create mode 100644 system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs create mode 100644 system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs create mode 100644 system-parachains/collectives/collectives-polkadot/src/ambassador/tracks.rs create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs rename system-parachains/collectives/collectives-polkadot/src/weights/{pallet_core_fellowship.rs => pallet_core_fellowship_fellowship_core.rs} (89%) create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_ambassador_collective.rs rename system-parachains/collectives/collectives-polkadot/src/weights/{pallet_ranked_collective.rs => pallet_ranked_collective_fellowship_collective.rs} (87%) create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda_ambassador_referenda.rs rename system-parachains/collectives/collectives-polkadot/src/weights/{pallet_referenda.rs => pallet_referenda_fellowship_referenda.rs} (90%) create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_ambassador_salary.rs rename system-parachains/collectives/collectives-polkadot/src/weights/{pallet_salary.rs => pallet_salary_fellowship_salary.rs} (90%) create mode 100644 system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_ambassador_treasury.rs rename system-parachains/collectives/collectives-polkadot/src/weights/{pallet_treasury.rs => pallet_treasury_fellowship_treasury.rs} (86%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1547495505..8d13fb052b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269)) - Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) - Add `pallet-xcm::transfer_assets_using_type_and_then()` for complex asset transfers ([polkadot-fellows/runtimes#311](https://github.com/polkadot-fellows/runtimes/pull/311)) +- The Ambassador Program ([polkadot-fellows/runtimes#291](https://github.com/polkadot-fellows/runtimes/pull/291)) ### Removed diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs index 9d56a5477b..6fb8e588bb 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs @@ -261,6 +261,32 @@ impl Contains for FellowshipEntities { } } +pub struct AmbassadorEntities; +impl Contains for AmbassadorEntities { + fn contains(location: &Location) -> bool { + matches!( + location.unpack(), + ( + 1, + [ + Parachain(system_parachain::COLLECTIVES_ID), + PalletInstance( + collectives_polkadot_runtime_constants::AMBASSADOR_SALARY_PALLET_INDEX + ) + ] + ) | ( + 1, + [ + Parachain(system_parachain::COLLECTIVES_ID), + PalletInstance( + collectives_polkadot_runtime_constants::AMBASSADOR_TREASURY_PALLET_INDEX + ) + ] + ) + ) + } +} + pub struct ParentOrParentsPlurality; impl Contains for ParentOrParentsPlurality { fn contains(location: &Location) -> bool { @@ -289,6 +315,7 @@ pub type Barrier = TrailingSetTopicAsId< FellowshipEntities, Equals, Equals, + AmbassadorEntities, )>, // Subscriptions for version tracking are OK. AllowSubscriptionsFrom, @@ -314,6 +341,7 @@ pub type WaivedLocations = ( RelayOrOtherSystemParachains, Equals, FellowshipEntities, + AmbassadorEntities, ); /// Cases where a remote origin is accepted as trusted Teleporter for a given asset: diff --git a/system-parachains/collectives/collectives-polkadot/constants/src/lib.rs b/system-parachains/collectives/collectives-polkadot/constants/src/lib.rs index 4fef9073f3..7fe81f8019 100644 --- a/system-parachains/collectives/collectives-polkadot/constants/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/constants/src/lib.rs @@ -16,8 +16,14 @@ #![no_std] -/// Polkadot Collectives Salary pallet instance. +/// Polkadot Fellowship Salary pallet instance. pub const FELLOWSHIP_SALARY_PALLET_INDEX: u8 = 64; -/// Polkadot Collectives Treasury pallet instance. +/// Polkadot Fellowship Treasury pallet instance. pub const FELLOWSHIP_TREASURY_PALLET_INDEX: u8 = 65; + +/// Polkadot Ambassador Salary pallet instance. +pub const AMBASSADOR_SALARY_PALLET_INDEX: u8 = 74; + +/// Polkadot Ambassador Treasury pallet instance. +pub const AMBASSADOR_TREASURY_PALLET_INDEX: u8 = 75; diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs new file mode 100644 index 0000000000..6786e7229c --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs @@ -0,0 +1,358 @@ +// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The Polkadot Ambassador Program. +//! +//! The module defines the following on-chain functionality of the Ambassador Program: +//! +//! - Managed set of program members, where every member has a [rank](ranks) +//! (via [AmbassadorCollective](pallet_ranked_collective)). +//! - Referendum functionality for the program members to propose, vote on, and execute +//! proposals on behalf of the members of a certain [rank](Origin) +//! (via [AmbassadorReferenda](pallet_referenda)). +//! - Promotion and demotion periods, register of members' activity, and rank based salaries +//! (via [AmbassadorCore](pallet_core_fellowship)). +//! - Members' salaries (via [AmbassadorSalary](pallet_salary), requiring a member to be +//! imported or inducted into [AmbassadorCore](pallet_core_fellowship)). +//! - Ambassador Program Sub-Treasury (via [AmbassadorTreasury](pallet_treasury)). + +pub mod origins; +mod tracks; + +pub use origins::pallet_origins as pallet_ambassador_origins; + +use crate::{ + xcm_config::{AssetHubUsdt, FellowshipAdminBodyId}, + *, +}; +use frame_support::{ + pallet_prelude::PalletInfoAccess, + traits::{EitherOf, MapSuccess, TryMapSuccess}, +}; +use frame_system::EnsureRootWithSuccess; +use origins::pallet_origins::{EnsureAmbassadorsFrom, HeadAmbassadors, Origin, SeniorAmbassadors}; +use pallet_ranked_collective::{Rank, Votes}; +use polkadot_runtime_common::impls::{LocatableAssetConverter, VersionedLocationConverter}; +use sp_core::ConstU128; +use sp_runtime::{ + traits::{CheckedReduceBy, Convert, ConvertToValue, IdentityLookup, Replace}, + Permill, +}; +use xcm::prelude::*; +use xcm_builder::{AliasesIntoAccountId32, PayOverXcm}; + +/// The Ambassador Program's member ranks. +pub mod ranks { + use super::Rank; + + #[allow(dead_code)] + pub const CANDIDATE: Rank = 0; + pub const AMBASSADOR: Rank = 1; + pub const SENIOR_AMBASSADOR: Rank = 2; + pub const HEAD_AMBASSADOR: Rank = 3; +} + +impl pallet_ambassador_origins::Config for Runtime {} + +/// Demotion is by any of: +/// - Root can demote arbitrarily; +/// - the FellowshipAdmin voice (i.e. token holder referendum) can demote arbitrarily; +/// - Head Ambassadors voice can demote Senior Ambassador or Ambassador; +/// - Senior Ambassadors voice can demote Ambassador. +pub type DemoteOrigin = EitherOf< + EnsureRootWithSuccess>, + EitherOf< + MapSuccess< + EnsureXcm>, + Replace>, + >, + TryMapSuccess< + EnsureAmbassadorsFrom>, + CheckedReduceBy>, + >, + >, +>; + +/// Promotion and approval (rank-retention) is by any of: +/// - Root can promote arbitrarily. +/// - the FellowshipAdmin voice (i.e. token holder referendum) can promote arbitrarily. +/// - Head Ambassadors voice can promote to Senior Ambassador and Ambassador; +/// - Senior Ambassadors voice can promote to Ambassador. +pub type PromoteOrigin = DemoteOrigin; + +/// Root, FellowshipAdmin or HeadAmbassadors. +pub type OpenGovOrHeadAmbassadors = EitherOfDiverse< + EnsureRoot, + EitherOfDiverse< + HeadAmbassadors, + EnsureXcm>, + >, +>; + +/// Ambassadors' vote weights for referendums. +/// - Each member with an excess rank of 0 gets 1 vote; +/// - ...with an excess rank of 1 gets 5 votes; +/// - ...with an excess rank of 2 gets 10 votes; +/// - ...with an excess rank of 3 gets 15 votes; +pub struct VoteWeight; +impl Convert for VoteWeight { + fn convert(excess: Rank) -> Votes { + if excess == 0 { + 1 + } else { + (excess * 5).into() + } + } +} + +pub type AmbassadorCollectiveInstance = pallet_ranked_collective::Instance2; + +impl pallet_ranked_collective::Config for Runtime { + type WeightInfo = weights::pallet_ranked_collective_ambassador_collective::WeightInfo; + type RuntimeEvent = RuntimeEvent; + // Promotions must be done through the [`crate::AmbassadorCore`] pallet instance. + #[cfg(not(feature = "runtime-benchmarks"))] + type PromoteOrigin = frame_support::traits::NeverEnsureOrigin; + #[cfg(feature = "runtime-benchmarks")] + type PromoteOrigin = EnsureRootWithSuccess>; + type DemoteOrigin = DemoteOrigin; + type Polls = AmbassadorReferenda; + type MinRankOfClass = sp_runtime::traits::Identity; + type VoteWeight = VoteWeight; + type ExchangeOrigin = OpenGovOrHeadAmbassadors; + type MemberSwappedHandler = (crate::AmbassadorCore, crate::AmbassadorSalary); + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetup = (crate::AmbassadorCore, crate::AmbassadorSalary); +} + +parameter_types! { + pub const AlarmInterval: BlockNumber = 1; + pub const SubmissionDeposit: Balance = 0; + pub const UndecidingTimeout: BlockNumber = 7 * DAYS; +} + +pub type AmbassadorReferendaInstance = pallet_referenda::Instance2; + +impl pallet_referenda::Config for Runtime { + type WeightInfo = weights::pallet_referenda_ambassador_referenda::WeightInfo; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type Scheduler = Scheduler; + type Currency = Balances; + // Any member of the Ambassador Program can submit a proposal. + type SubmitOrigin = pallet_ranked_collective::EnsureMember< + Runtime, + AmbassadorCollectiveInstance, + { ranks::AMBASSADOR }, + >; + // Referendum can be canceled by any of: + // - Root; + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote among all Head Ambassadors. + type CancelOrigin = OpenGovOrHeadAmbassadors; + // Referendum can be killed by any of: + // - Root; + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote among all Head Ambassadors. + type KillOrigin = OpenGovOrHeadAmbassadors; + type Slash = ToParentTreasury; + type Votes = Votes; + type Tally = pallet_ranked_collective::TallyOf; + type SubmissionDeposit = SubmissionDeposit; + type MaxQueued = ConstU32<20>; + type UndecidingTimeout = UndecidingTimeout; + type AlarmInterval = AlarmInterval; + type Tracks = tracks::TracksInfo; + type Preimages = Preimage; +} + +pub type AmbassadorCoreInstance = pallet_core_fellowship::Instance2; + +impl pallet_core_fellowship::Config for Runtime { + type WeightInfo = weights::pallet_core_fellowship_ambassador_core::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type Members = pallet_ranked_collective::Pallet; + type Balance = Balance; + // Parameters are set by any of: + // - Root; + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote among all Head Ambassadors. + type ParamsOrigin = OpenGovOrHeadAmbassadors; + // Induction (creating a candidate) is by any of: + // - Root; + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a single member of the Ambassador Program; + type InductOrigin = EitherOfDiverse< + EnsureRoot, + EitherOfDiverse< + EnsureXcm>, + pallet_ranked_collective::EnsureMember< + Runtime, + AmbassadorCollectiveInstance, + { ranks::AMBASSADOR }, + >, + >, + >; + type ApproveOrigin = PromoteOrigin; + type PromoteOrigin = PromoteOrigin; + type EvidenceSize = ConstU32<65536>; +} + +parameter_types! { + // The interior location on AssetHub for the paying account. This is the Ambassador Salary + // pallet instance. This sovereign account will need funding. + pub AmbassadorSalaryLocation: InteriorLocation = + PalletInstance(::index() as u8).into(); +} + +const USDT_UNITS: u128 = 1_000_000; + +/// [`PayOverXcm`] setup to pay the Ambassador salary on the AssetHub in USDt. +pub type AmbassadorSalaryPaymaster = PayOverXcm< + AmbassadorSalaryLocation, + crate::xcm_config::XcmRouter, + crate::PolkadotXcm, + ConstU32<{ 6 * HOURS }>, + AccountId, + (), + ConvertToValue, + AliasesIntoAccountId32<(), AccountId>, +>; + +pub type AmbassadorSalaryInstance = pallet_salary::Instance2; + +impl pallet_salary::Config for Runtime { + type WeightInfo = weights::pallet_salary_ambassador_salary::WeightInfo; + type RuntimeEvent = RuntimeEvent; + + #[cfg(not(feature = "runtime-benchmarks"))] + type Paymaster = AmbassadorSalaryPaymaster; + #[cfg(feature = "runtime-benchmarks")] + type Paymaster = crate::impls::benchmarks::PayWithEnsure< + AmbassadorSalaryPaymaster, + crate::impls::benchmarks::OpenHrmpChannel>, + >; + type Members = pallet_ranked_collective::Pallet; + + #[cfg(not(feature = "runtime-benchmarks"))] + type Salary = pallet_core_fellowship::Pallet; + #[cfg(feature = "runtime-benchmarks")] + type Salary = frame_support::traits::tokens::ConvertRank< + crate::impls::benchmarks::RankToSalary, + >; + // 15 days to register for a salary payment. + type RegistrationPeriod = ConstU32<{ 15 * DAYS }>; + // 15 days to claim the salary payment. + type PayoutPeriod = ConstU32<{ 15 * DAYS }>; + // Total monthly salary budget. + // 10,000 USDT for up to 21 members. + type Budget = ConstU128<{ 10_000 * 21 * USDT_UNITS }>; +} + +parameter_types! { + pub const AmbassadorTreasuryPalletId: PalletId = AMBASSADOR_TREASURY_PALLET_ID; + pub const ProposalBond: Permill = Permill::from_percent(100); + pub const Burn: Permill = Permill::from_percent(0); + pub const MaxBalance: Balance = Balance::MAX; + // The asset's interior location for the paying account. This is the Ambassador Treasury + // pallet instance. + pub AmbassadorTreasuryInteriorLocation: InteriorLocation = + PalletInstance(::index() as u8).into(); +} + +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub const ProposalBondForBenchmark: Permill = Permill::from_percent(5); +} + +/// [`PayOverXcm`] setup to pay the Ambasssador Treasury. +pub type AmbassadorTreasuryPaymaster = PayOverXcm< + AmbassadorTreasuryInteriorLocation, + crate::xcm_config::XcmRouter, + crate::PolkadotXcm, + ConstU32<{ 6 * HOURS }>, + VersionedLocation, + VersionedLocatableAsset, + LocatableAssetConverter, + VersionedLocationConverter, +>; + +pub type AmbassadorTreasuryInstance = pallet_treasury::Instance2; + +impl pallet_treasury::Config for Runtime { + // The creation of proposals via the treasury pallet is deprecated and should not be utilized. + // Instead, public or fellowship referenda should be used to propose and command the treasury + // spend or spend_local dispatchables. The parameters below have been configured accordingly to + // discourage its use. + #[cfg(not(feature = "runtime-benchmarks"))] + type ApproveOrigin = frame_support::traits::NeverEnsureOrigin; + #[cfg(feature = "runtime-benchmarks")] + type ApproveOrigin = EnsureRoot; + type OnSlash = (); + #[cfg(not(feature = "runtime-benchmarks"))] + type ProposalBond = ProposalBond; + #[cfg(feature = "runtime-benchmarks")] + type ProposalBond = ProposalBondForBenchmark; + #[cfg(not(feature = "runtime-benchmarks"))] + type ProposalBondMinimum = MaxBalance; + #[cfg(feature = "runtime-benchmarks")] + type ProposalBondMinimum = ConstU128<{ ExistentialDeposit::get() * 100 }>; + #[cfg(not(feature = "runtime-benchmarks"))] + type ProposalBondMaximum = MaxBalance; + #[cfg(feature = "runtime-benchmarks")] + type ProposalBondMaximum = ConstU128<{ ExistentialDeposit::get() * 500 }>; + // end. + + type WeightInfo = weights::pallet_treasury_ambassador_treasury::WeightInfo; + type RuntimeEvent = RuntimeEvent; + type PalletId = AmbassadorTreasuryPalletId; + type Currency = Balances; + type RejectOrigin = OpenGovOrHeadAmbassadors; + type SpendPeriod = ConstU32<{ 7 * DAYS }>; + type Burn = Burn; + type BurnDestination = (); + type SpendFunds = (); + type MaxApprovals = ConstU32<100>; + type SpendOrigin = EitherOf< + EitherOf< + EnsureRootWithSuccess, + MapSuccess< + EnsureXcm>, + Replace>, + >, + >, + EitherOf< + MapSuccess>>, + MapSuccess>>, + >, + >; + type AssetKind = VersionedLocatableAsset; + type Beneficiary = VersionedLocation; + type BeneficiaryLookup = IdentityLookup; + #[cfg(not(feature = "runtime-benchmarks"))] + type Paymaster = AmbassadorTreasuryPaymaster; + #[cfg(feature = "runtime-benchmarks")] + type Paymaster = crate::impls::benchmarks::PayWithEnsure< + AmbassadorTreasuryPaymaster, + crate::impls::benchmarks::OpenHrmpChannel>, + >; + type BalanceConverter = crate::impls::NativeOnSiblingParachain; + type PayoutPeriod = ConstU32<{ 30 * DAYS }>; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = polkadot_runtime_common::impls::benchmarks::TreasuryArguments< + sp_core::ConstU8<1>, + ConstU32<1000>, + >; +} diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs new file mode 100644 index 0000000000..691fd10f24 --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/origins.rs @@ -0,0 +1,112 @@ +// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The Ambassador Program's origins. + +#[frame_support::pallet] +pub mod pallet_origins { + use crate::ambassador::ranks; + use frame_support::pallet_prelude::*; + use pallet_ranked_collective::Rank; + + #[pallet::pallet] + pub struct Pallet(PhantomData); + + /// The pallet configuration trait. + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[derive(PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug)] + #[pallet::origin] + pub enum Origin { + /// Plurality voice of the [ranks::AMBASSADOR] members or above given via + /// referendum. + Ambassadors, + /// Plurality voice of the [ranks::SENIOR_AMBASSADOR] members or above given via + /// referendum. + SeniorAmbassadors, + /// Plurality voice of the [ranks::HEAD_AMBASSADOR] members given via referendum. + HeadAmbassadors, + } + + impl Origin { + /// Returns the rank that the origin `self` speaks for, or `None` if it doesn't speak for + /// any. + pub fn as_voice(&self) -> Option { + Some(match &self { + Origin::Ambassadors => ranks::AMBASSADOR, + Origin::SeniorAmbassadors => ranks::SENIOR_AMBASSADOR, + Origin::HeadAmbassadors => ranks::HEAD_AMBASSADOR, + }) + } + } + + /// Ensures [`Origin::HeadAmbassadors`] origin. + pub struct HeadAmbassadors; + impl> + From> EnsureOrigin for HeadAmbassadors { + type Success = (); + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::HeadAmbassadors => Ok(()), + r => Err(O::from(r)), + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin::HeadAmbassadors)) + } + } + + /// Ensures [`Origin::SeniorAmbassadors`] origin. + pub struct SeniorAmbassadors; + impl> + From> EnsureOrigin for SeniorAmbassadors { + type Success = (); + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::SeniorAmbassadors => Ok(()), + r => Err(O::from(r)), + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin::SeniorAmbassadors)) + } + } + + /// Ensures that the origin is a plurality voice of the a given rank `R` or above. + /// Success is the corresponding origin rank. + pub struct EnsureAmbassadorsFrom(PhantomData); + impl, O: Into> + From> EnsureOrigin + for EnsureAmbassadorsFrom + { + type Success = Rank; + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match Origin::as_voice(&o) { + Some(r) if r >= R::get() => Ok(r), + _ => Err(O::from(o)), + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + ranks::HEAD_AMBASSADOR + .ge(&R::get()) + .then(|| O::from(Origin::HeadAmbassadors)) + .ok_or(()) + } + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/tracks.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/tracks.rs new file mode 100644 index 0000000000..d2a5a77b2c --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/tracks.rs @@ -0,0 +1,138 @@ +// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The Ambassador Program's referenda voting tracks. + +use super::Origin; +use crate::{Balance, BlockNumber, RuntimeOrigin, DAYS, DOLLARS, HOURS}; +use sp_runtime::Perbill; + +/// Referendum `TrackId` type. +pub type TrackId = u16; + +/// Referendum track IDs. +pub mod constants { + use super::TrackId; + + pub const AMBASSADOR: TrackId = 1; + pub const SENIOR_AMBASSADOR: TrackId = 2; + pub const HEAD_AMBASSADOR: TrackId = 3; +} + +/// The type implementing the [`pallet_referenda::TracksInfo`] trait for referenda pallet. +pub struct TracksInfo; + +/// Information on the voting tracks. +impl pallet_referenda::TracksInfo for TracksInfo { + type Id = TrackId; + + type RuntimeOrigin = ::PalletsOrigin; + + /// Return the array of available tracks and their information. + fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { + static DATA: [(TrackId, pallet_referenda::TrackInfo); 3] = [ + ( + constants::AMBASSADOR, + pallet_referenda::TrackInfo { + name: "ambassador", + max_deciding: 10, + decision_deposit: 5 * DOLLARS, + prepare_period: 24 * HOURS, + decision_period: 7 * DAYS, + confirm_period: 24 * HOURS, + min_enactment_period: HOURS, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::SENIOR_AMBASSADOR, + pallet_referenda::TrackInfo { + name: "senior ambassador", + max_deciding: 10, + decision_deposit: 5 * DOLLARS, + prepare_period: 24 * HOURS, + decision_period: 7 * DAYS, + confirm_period: 24 * HOURS, + min_enactment_period: HOURS, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ( + constants::HEAD_AMBASSADOR, + pallet_referenda::TrackInfo { + name: "head ambassador", + max_deciding: 10, + decision_deposit: 5 * DOLLARS, + prepare_period: 24 * HOURS, + decision_period: 7 * DAYS, + confirm_period: 24 * HOURS, + min_enactment_period: HOURS, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(0), + ceil: Perbill::from_percent(50), + }, + }, + ), + ]; + &DATA[..] + } + + /// Determine the voting track for the given `origin`. + fn track_for(id: &Self::RuntimeOrigin) -> Result { + #[cfg(feature = "runtime-benchmarks")] + { + // For benchmarks, we enable a root origin. + // It is important that this is not available in production! + let root: Self::RuntimeOrigin = frame_system::RawOrigin::Root.into(); + if &root == id { + return Ok(constants::HEAD_AMBASSADOR) + } + } + + match Origin::try_from(id.clone()) { + Ok(Origin::Ambassadors) => Ok(constants::AMBASSADOR), + Ok(Origin::SeniorAmbassadors) => Ok(constants::SENIOR_AMBASSADOR), + Ok(Origin::HeadAmbassadors) => Ok(constants::HEAD_AMBASSADOR), + _ => Err(()), + } + } +} + +// implements [`frame_support::traits::Get`] for [`TracksInfo`] +pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); diff --git a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs index 8a702b9c23..127afb2b66 100644 --- a/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/fellowship/mod.rs @@ -21,7 +21,7 @@ mod tracks; use crate::{ impls::ToParentTreasury, weights, - xcm_config::{LocationToAccountId, TreasurerBodyId}, + xcm_config::{AssetHubUsdt, LocationToAccountId, TreasurerBodyId}, AccountId, AssetRate, Balance, Balances, FellowshipReferenda, GovernanceLocation, ParachainInfo, PolkadotTreasuryAccount, Preimage, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, DAYS, FELLOWSHIP_TREASURY_PALLET_ID, @@ -43,13 +43,11 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use polkadot_runtime_common::impls::{ LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter, }; -use polkadot_runtime_constants::{ - currency::GRAND, system_parachain, time::HOURS, xcm::body::FELLOWSHIP_ADMIN_INDEX, -}; +use polkadot_runtime_constants::{currency::GRAND, time::HOURS, xcm::body::FELLOWSHIP_ADMIN_INDEX}; use sp_arithmetic::Permill; use sp_core::{ConstU128, ConstU32}; use sp_runtime::traits::{ConstU16, ConvertToValue, IdentityLookup, Replace, TakeFirst}; -use xcm_builder::{AliasesIntoAccountId32, LocatableAssetId, PayOverXcm}; +use xcm_builder::{AliasesIntoAccountId32, PayOverXcm}; #[cfg(feature = "runtime-benchmarks")] use crate::{ @@ -81,7 +79,7 @@ impl pallet_fellowship_origins::Config for Runtime {} pub type FellowshipReferendaInstance = pallet_referenda::Instance1; impl pallet_referenda::Config for Runtime { - type WeightInfo = weights::pallet_referenda::WeightInfo; + type WeightInfo = weights::pallet_referenda_fellowship_referenda::WeightInfo; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Scheduler = Scheduler; @@ -116,7 +114,7 @@ impl pallet_referenda::Config for Runtime { pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; impl pallet_ranked_collective::Config for Runtime { - type WeightInfo = weights::pallet_ranked_collective::WeightInfo; + type WeightInfo = weights::pallet_ranked_collective_fellowship_collective::WeightInfo; type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] @@ -156,7 +154,7 @@ impl pallet_ranked_collective::Config for Runtime pub type FellowshipCoreInstance = pallet_core_fellowship::Instance1; impl pallet_core_fellowship::Config for Runtime { - type WeightInfo = weights::pallet_core_fellowship::WeightInfo; + type WeightInfo = weights::pallet_core_fellowship_fellowship_core::WeightInfo; type RuntimeEvent = RuntimeEvent; type Members = pallet_ranked_collective::Pallet; type Balance = Balance; @@ -214,12 +212,6 @@ pub type FellowshipSalaryInstance = pallet_salary::Instance1; use xcm::prelude::*; parameter_types! { - pub AssetHub: Location = (Parent, Parachain(system_parachain::ASSET_HUB_ID)).into(); - pub AssetHubUsdtId: AssetId = (PalletInstance(50), GeneralIndex(1984)).into(); - pub UsdtAsset: LocatableAssetId = LocatableAssetId { - location: AssetHub::get(), - asset_id: AssetHubUsdtId::get(), - }; // The interior location on AssetHub for the paying account. This is the Fellowship Salary // pallet instance. This sovereign account will need funding. pub Interior: InteriorLocation = PalletInstance(::index() as u8).into(); @@ -235,12 +227,12 @@ pub type FellowshipSalaryPaymaster = PayOverXcm< ConstU32<{ 6 * HOURS }>, AccountId, (), - ConvertToValue, + ConvertToValue, AliasesIntoAccountId32<(), AccountId>, >; impl pallet_salary::Config for Runtime { - type WeightInfo = weights::pallet_salary::WeightInfo; + type WeightInfo = weights::pallet_salary_fellowship_salary::WeightInfo; type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] @@ -317,7 +309,7 @@ impl pallet_treasury::Config for Runtime { type ProposalBondMaximum = ConstU128<{ ExistentialDeposit::get() * 500 }>; // end. - type WeightInfo = weights::pallet_treasury::WeightInfo; + type WeightInfo = weights::pallet_treasury_fellowship_treasury::WeightInfo; type RuntimeEvent = RuntimeEvent; type PalletId = FellowshipTreasuryPalletId; type Currency = Balances; diff --git a/system-parachains/collectives/collectives-polkadot/src/impls.rs b/system-parachains/collectives/collectives-polkadot/src/impls.rs index 77215cbc26..d3daea252c 100644 --- a/system-parachains/collectives/collectives-polkadot/src/impls.rs +++ b/system-parachains/collectives/collectives-polkadot/src/impls.rs @@ -212,14 +212,12 @@ where #[cfg(feature = "runtime-benchmarks")] pub mod benchmarks { use super::*; - use crate::ParachainSystem; use cumulus_primitives_core::{ChannelStatus, GetChannelInfo}; use frame_support::traits::{ fungible, tokens::{Pay, PaymentStatus}, }; use pallet_ranked_collective::Rank; - use parachains_common::{AccountId, Balance}; use sp_runtime::traits::Convert; /// Rank to salary conversion helper type. diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index 4dccfe6c52..3707492df5 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -36,11 +36,13 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +pub mod ambassador; pub mod impls; mod weights; pub mod xcm_config; // Fellowship configurations. pub mod fellowship; +pub use ambassador::pallet_ambassador_origins; use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; @@ -295,6 +297,8 @@ pub enum ProxyType { Alliance, /// Fellowship proxy. Allows calls related to the Fellowship. Fellowship, + /// Ambassador proxy. Allows calls related to the Ambassador Program. + Ambassador, } impl Default for ProxyType { fn default() -> Self { @@ -332,6 +336,15 @@ impl InstanceFilter for ProxyType { RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } ), + ProxyType::Ambassador => matches!( + c, + RuntimeCall::AmbassadorCollective { .. } | + RuntimeCall::AmbassadorReferenda { .. } | + RuntimeCall::AmbassadorCore { .. } | + RuntimeCall::AmbassadorSalary { .. } | + RuntimeCall::Utility { .. } | + RuntimeCall::Multisig { .. } + ), } } fn is_superset(&self, o: &Self) -> bool { @@ -680,6 +693,14 @@ construct_runtime!( FellowshipSalary: pallet_salary:: = 64, // pub type FellowshipTreasuryInstance = pallet_treasury::Instance1; FellowshipTreasury: pallet_treasury:: = 65, + + // Ambassador Program. + AmbassadorCollective: pallet_ranked_collective:: = 70, + AmbassadorReferenda: pallet_referenda:: = 71, + AmbassadorOrigins: pallet_ambassador_origins = 72, + AmbassadorCore: pallet_core_fellowship:: = 73, + AmbassadorSalary: pallet_salary:: = 74, + AmbassadorTreasury: pallet_treasury:: = 75, } ); @@ -755,6 +776,11 @@ mod benches { [pallet_salary, FellowshipSalary] [pallet_treasury, FellowshipTreasury] [pallet_asset_rate, AssetRate] + [pallet_referenda, AmbassadorReferenda] + [pallet_ranked_collective, AmbassadorCollective] + [pallet_core_fellowship, AmbassadorCore] + [pallet_salary, AmbassadorSalary] + [pallet_treasury, AmbassadorTreasury] ); } diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs b/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs index 15957facc6..30c6e7cdb0 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/mod.rs @@ -24,18 +24,23 @@ pub mod pallet_asset_rate; pub mod pallet_balances; pub mod pallet_collator_selection; pub mod pallet_collective; -pub mod pallet_core_fellowship; +pub mod pallet_core_fellowship_ambassador_core; +pub mod pallet_core_fellowship_fellowship_core; pub mod pallet_message_queue; pub mod pallet_multisig; pub mod pallet_preimage; pub mod pallet_proxy; -pub mod pallet_ranked_collective; -pub mod pallet_referenda; -pub mod pallet_salary; +pub mod pallet_ranked_collective_ambassador_collective; +pub mod pallet_ranked_collective_fellowship_collective; +pub mod pallet_referenda_ambassador_referenda; +pub mod pallet_referenda_fellowship_referenda; +pub mod pallet_salary_ambassador_salary; +pub mod pallet_salary_fellowship_salary; pub mod pallet_scheduler; pub mod pallet_session; pub mod pallet_timestamp; -pub mod pallet_treasury; +pub mod pallet_treasury_ambassador_treasury; +pub mod pallet_treasury_fellowship_treasury; pub mod pallet_utility; pub mod pallet_xcm; pub mod paritydb_weights; diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs new file mode 100644 index 0000000000..394f712e9b --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_ambassador_core.rs @@ -0,0 +1,226 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//! Autogenerated weights for `pallet_core_fellowship` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot +// benchmark +// pallet +// --chain=./collectives-polkadot-chain-spec.json +// --steps=10 +// --repeat=2 +// --pallet=pallet_core_fellowship +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./collectives-polkadot-weights/ +// --header=./file_header.txt + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_core_fellowship`. +pub struct WeightInfo(PhantomData); +impl pallet_core_fellowship::WeightInfo for WeightInfo { + /// Storage: `AmbassadorCore::Params` (r:0 w:1) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + fn set_params() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Params` (r:1 w:0) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:1 w:1) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn bump_offboard() -> Weight { + // Proof Size summary in bytes: + // Measured: `66398` + // Estimated: `69046` + // Minimum execution time: 74_000_000 picoseconds. + Weight::from_parts(79_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Params` (r:1 w:0) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:1 w:1) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn bump_demote() -> Weight { + // Proof Size summary in bytes: + // Measured: `66508` + // Estimated: `69046` + // Minimum execution time: 72_000_000 picoseconds. + Weight::from_parts(78_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + fn set_active() -> Weight { + // Proof Size summary in bytes: + // Measured: `360` + // Estimated: `3514` + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:0 w:1) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn induct() -> Weight { + // Proof Size summary in bytes: + // Measured: `118` + // Estimated: `3514` + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Params` (r:1 w:0) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:0 w:1) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn promote() -> Weight { + // Proof Size summary in bytes: + // Measured: `65989` + // Estimated: `69046` + // Minimum execution time: 68_000_000 picoseconds. + Weight::from_parts(89_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:0 w:1) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + fn offboard() -> Weight { + // Proof Size summary in bytes: + // Measured: `265` + // Estimated: `3514` + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + fn import() -> Weight { + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `3514` + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + fn approve() -> Weight { + // Proof Size summary in bytes: + // Measured: `65967` + // Estimated: `69046` + // Minimum execution time: 56_000_000 picoseconds. + Weight::from_parts(59_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorCore::Member` (r:1 w:0) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + fn submit_evidence() -> Weight { + // Proof Size summary in bytes: + // Measured: `151` + // Estimated: `69046` + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(37_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs similarity index 89% rename from system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs rename to system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs index 81a2d4459f..d2f15c8553 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_core_fellowship_fellowship_core.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_core_fellowship` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `cob`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -26,8 +26,8 @@ // benchmark // pallet // --chain=./collectives-polkadot-chain-spec.json -// --steps=50 -// --repeat=20 +// --steps=10 +// --repeat=2 // --pallet=pallet_core_fellowship // --extrinsic=* // --wasm-execution=compiled @@ -52,8 +52,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_497_000 picoseconds. - Weight::from_parts(5_823_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(8_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -73,10 +73,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn bump_offboard() -> Weight { // Proof Size summary in bytes: - // Measured: `66498` + // Measured: `66531` // Estimated: `69046` - // Minimum execution time: 120_831_000 picoseconds. - Weight::from_parts(121_969_000, 0) + // Minimum execution time: 84_000_000 picoseconds. + Weight::from_parts(101_000_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -97,10 +97,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn bump_demote() -> Weight { // Proof Size summary in bytes: - // Measured: `66608` + // Measured: `66641` // Estimated: `69046` - // Minimum execution time: 123_304_000 picoseconds. - Weight::from_parts(125_323_000, 0) + // Minimum execution time: 82_000_000 picoseconds. + Weight::from_parts(90_000_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -111,10 +111,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn set_active() -> Weight { // Proof Size summary in bytes: - // Measured: `460` + // Measured: `493` // Estimated: `3514` - // Minimum execution time: 16_098_000 picoseconds. - Weight::from_parts(16_738_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -131,10 +131,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn induct() -> Weight { // Proof Size summary in bytes: - // Measured: `218` + // Measured: `251` // Estimated: `3514` - // Minimum execution time: 23_660_000 picoseconds. - Weight::from_parts(24_110_000, 0) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(5)) @@ -155,10 +155,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn promote() -> Weight { // Proof Size summary in bytes: - // Measured: `66089` + // Measured: `66122` // Estimated: `69046` - // Minimum execution time: 113_579_000 picoseconds. - Weight::from_parts(116_223_000, 0) + // Minimum execution time: 74_000_000 picoseconds. + Weight::from_parts(86_000_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(6)) @@ -171,10 +171,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) fn offboard() -> Weight { // Proof Size summary in bytes: - // Measured: `365` + // Measured: `398` // Estimated: `3514` - // Minimum execution time: 16_387_000 picoseconds. - Weight::from_parts(16_823_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -185,10 +185,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) fn import() -> Weight { // Proof Size summary in bytes: - // Measured: `385` + // Measured: `418` // Estimated: `3514` - // Minimum execution time: 14_649_000 picoseconds. - Weight::from_parts(15_200_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -201,10 +201,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) fn approve() -> Weight { // Proof Size summary in bytes: - // Measured: `66067` + // Measured: `66100` // Estimated: `69046` - // Minimum execution time: 100_743_000 picoseconds. - Weight::from_parts(102_625_000, 0) + // Minimum execution time: 67_000_000 picoseconds. + Weight::from_parts(72_000_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -215,10 +215,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) fn submit_evidence() -> Weight { // Proof Size summary in bytes: - // Measured: `151` + // Measured: `184` // Estimated: `69046` - // Minimum execution time: 87_604_000 picoseconds. - Weight::from_parts(90_535_000, 0) + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(42_000_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_ambassador_collective.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_ambassador_collective.rs new file mode 100644 index 0000000000..7049fa1937 --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_ambassador_collective.rs @@ -0,0 +1,200 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//! Autogenerated weights for `pallet_ranked_collective` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot +// benchmark +// pallet +// --chain=./collectives-polkadot-chain-spec.json +// --steps=10 +// --repeat=2 +// --pallet=pallet_ranked_collective +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./collectives-polkadot-weights/ +// --header=./file_header.txt + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_ranked_collective`. +pub struct WeightInfo(PhantomData); +impl pallet_ranked_collective::WeightInfo for WeightInfo { + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:0 w:1) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn add_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) + .saturating_add(Weight::from_parts(0, 3507)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:11 w:11) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:11 w:22) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:11 w:22) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + fn remove_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `518 + r * (280 ±0)` + // Estimated: `3519 + r * (2529 ±0)` + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(27_873_376, 0) + .saturating_add(Weight::from_parts(0, 3519)) + // Standard Error: 180_005 + .saturating_add(Weight::from_parts(11_918_831, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((5_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2529).saturating_mul(r.into())) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:0 w:1) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + fn promote_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `214 + r * (17 ±0)` + // Estimated: `3507` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(16_643_939, 0) + .saturating_add(Weight::from_parts(0, 3507)) + // Standard Error: 41_685 + .saturating_add(Weight::from_parts(196_969, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:1 w:2) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:1 w:2) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. + fn demote_member(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `532 + r * (72 ±0)` + // Estimated: `3519` + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(26_418_831, 0) + .saturating_add(Weight::from_parts(0, 3519)) + // Standard Error: 75_415 + .saturating_add(Weight::from_parts(441_558, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Voting` (r:1 w:1) + /// Proof: `AmbassadorCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `566` + // Estimated: `317568` + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(34_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::VotingCleanup` (r:1 w:0) + /// Proof: `AmbassadorCollective::VotingCleanup` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Voting` (r:100 w:100) + /// Proof: `AmbassadorCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// The range of component `n` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. + fn cleanup_poll(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `400 + n * (50 ±0)` + // Estimated: `4365 + n * (2540 ±0)` + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_226_811, 0) + .saturating_add(Weight::from_parts(0, 4365)) + // Standard Error: 9_209 + .saturating_add(Weight::from_parts(1_061_959, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 2540).saturating_mul(n.into())) + } + /// Storage: `AmbassadorCollective::Members` (r:2 w:2) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:2 w:2) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:2 w:4) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Member` (r:2 w:2) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:0) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorSalary::Claimant` (r:2 w:2) + /// Proof: `AmbassadorSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:2) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + fn exchange_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `702` + // Estimated: `69046` + // Minimum execution time: 59_000_000 picoseconds. + Weight::from_parts(60_000_000, 0) + .saturating_add(Weight::from_parts(0, 69046)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(14)) + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_fellowship_collective.rs similarity index 87% rename from system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs rename to system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_fellowship_collective.rs index a4321b3e37..db58bfca44 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_ranked_collective_fellowship_collective.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_ranked_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `cob`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -26,8 +26,8 @@ // benchmark // pallet // --chain=./collectives-polkadot-chain-spec.json -// --steps=50 -// --repeat=20 +// --steps=10 +// --repeat=2 // --pallet=pallet_ranked_collective // --extrinsic=* // --wasm-execution=compiled @@ -58,8 +58,8 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `142` // Estimated: `3507` - // Minimum execution time: 13_190_000 picoseconds. - Weight::from_parts(13_790_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 3507)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -73,15 +73,16 @@ impl pallet_ranked_collective::WeightInfo for WeightInf /// Storage: `FellowshipCollective::IndexToId` (r:11 w:22) /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. fn remove_member(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `617 + r * (281 ±0)` + // Measured: `618 + r * (280 ±0)` // Estimated: `3519 + r * (2529 ±0)` - // Minimum execution time: 26_977_000 picoseconds. - Weight::from_parts(28_717_611, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(27_635_281, 0) .saturating_add(Weight::from_parts(0, 3519)) - // Standard Error: 21_778 - .saturating_add(Weight::from_parts(14_508_466, 0).saturating_mul(r.into())) + // Standard Error: 214_930 + .saturating_add(Weight::from_parts(12_264_069, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -97,15 +98,16 @@ impl pallet_ranked_collective::WeightInfo for WeightInf /// Storage: `FellowshipCollective::IdToIndex` (r:0 w:1) /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. fn promote_member(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `314 + r * (17 ±0)` // Estimated: `3507` - // Minimum execution time: 16_945_000 picoseconds. - Weight::from_parts(17_660_620, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_652_597, 0) .saturating_add(Weight::from_parts(0, 3507)) - // Standard Error: 4_070 - .saturating_add(Weight::from_parts(313_017, 0).saturating_mul(r.into())) + // Standard Error: 164_609 + .saturating_add(Weight::from_parts(379_870, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -118,15 +120,16 @@ impl pallet_ranked_collective::WeightInfo for WeightInf /// Storage: `FellowshipCollective::IndexToId` (r:1 w:2) /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 10]`. + /// The range of component `r` is `[0, 10]`. fn demote_member(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `632 + r * (72 ±0)` // Estimated: `3519` - // Minimum execution time: 27_051_000 picoseconds. - Weight::from_parts(29_513_951, 0) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(27_978_354, 0) .saturating_add(Weight::from_parts(0, 3519)) - // Standard Error: 16_734 - .saturating_add(Weight::from_parts(624_950, 0).saturating_mul(r.into())) + // Standard Error: 167_700 + .saturating_add(Weight::from_parts(417_748, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -142,8 +145,8 @@ impl pallet_ranked_collective::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `666` // Estimated: `317568` - // Minimum execution time: 37_295_000 picoseconds. - Weight::from_parts(38_251_000, 0) + // Minimum execution time: 34_000_000 picoseconds. + Weight::from_parts(38_000_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -155,15 +158,16 @@ impl pallet_ranked_collective::WeightInfo for WeightInf /// Storage: `FellowshipCollective::Voting` (r:100 w:100) /// Proof: `FellowshipCollective::Voting` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 100]`. + /// The range of component `n` is `[0, 100]`. fn cleanup_poll(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `500 + n * (50 ±0)` // Estimated: `4365 + n * (2540 ±0)` - // Minimum execution time: 13_665_000 picoseconds. - Weight::from_parts(15_866_716, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(15_156_728, 0) .saturating_add(Weight::from_parts(0, 4365)) - // Standard Error: 2_259 - .saturating_add(Weight::from_parts(1_181_733, 0).saturating_mul(n.into())) + // Standard Error: 22_082 + .saturating_add(Weight::from_parts(1_056_315, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -185,10 +189,10 @@ impl pallet_ranked_collective::WeightInfo for WeightInf /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn exchange_member() -> Weight { // Proof Size summary in bytes: - // Measured: `697` + // Measured: `730` // Estimated: `69046` - // Minimum execution time: 65_830_000 picoseconds. - Weight::from_parts(67_151_000, 0) + // Minimum execution time: 58_000_000 picoseconds. + Weight::from_parts(61_000_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(14)) diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda_ambassador_referenda.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda_ambassador_referenda.rs new file mode 100644 index 0000000000..3a9b8bb0f5 --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda_ambassador_referenda.rs @@ -0,0 +1,539 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//! Autogenerated weights for `pallet_referenda` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot +// benchmark +// pallet +// --chain=./collectives-polkadot-chain-spec.json +// --steps=10 +// --repeat=2 +// --pallet=pallet_referenda +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./collectives-polkadot-weights/ +// --header=./file_header.txt + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_referenda`. +pub struct WeightInfo(PhantomData); +impl pallet_referenda::WeightInfo for WeightInfo { + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::ReferendumCount` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:0 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + fn submit() -> Weight { + // Proof Size summary in bytes: + // Measured: `255` + // Estimated: `159279` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn place_decision_deposit_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `366` + // Estimated: `317568` + // Minimum execution time: 37_000_000 picoseconds. + Weight::from_parts(38_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:0) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn place_decision_deposit_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `1165` + // Estimated: `159279` + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(57_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:0) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn place_decision_deposit_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `1173` + // Estimated: `159279` + // Minimum execution time: 53_000_000 picoseconds. + Weight::from_parts(56_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:1) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn place_decision_deposit_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `604` + // Estimated: `317568` + // Minimum execution time: 65_000_000 picoseconds. + Weight::from_parts(81_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:1) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn place_decision_deposit_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `567` + // Estimated: `317568` + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(47_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + fn refund_decision_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `317` + // Estimated: `4365` + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(29_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + fn refund_submission_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `167` + // Estimated: `4365` + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn cancel() -> Weight { + // Proof Size summary in bytes: + // Measured: `311` + // Estimated: `317568` + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(31_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AmbassadorReferenda::MetadataOf` (r:1 w:0) + /// Proof: `AmbassadorReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn kill() -> Weight { + // Proof Size summary in bytes: + // Measured: `592` + // Estimated: `317568` + // Minimum execution time: 105_000_000 picoseconds. + Weight::from_parts(112_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:0) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:1) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + fn one_fewer_deciding_queue_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `140` + // Estimated: `3636` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 3636)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn one_fewer_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `1328` + // Estimated: `159279` + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(60_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn one_fewer_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `1314` + // Estimated: `159279` + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(49_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + fn nudge_referendum_requeued_insertion() -> Weight { + // Proof Size summary in bytes: + // Measured: `935` + // Estimated: `4365` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + fn nudge_referendum_requeued_slide() -> Weight { + // Proof Size summary in bytes: + // Measured: `935` + // Estimated: `4365` + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:0) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + fn nudge_referendum_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `951` + // Estimated: `4365` + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(32_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:0) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::TrackQueue` (r:1 w:1) + /// Proof: `AmbassadorReferenda::TrackQueue` (`max_values`: None, `max_size`: Some(171), added: 2646, mode: `MaxEncodedLen`) + fn nudge_referendum_not_queued() -> Weight { + // Proof Size summary in bytes: + // Measured: `959` + // Estimated: `4365` + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(26_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_no_deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `263` + // Estimated: `159279` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_preparing() -> Weight { + // Proof Size summary in bytes: + // Measured: `311` + // Estimated: `159279` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + fn nudge_referendum_timed_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `208` + // Estimated: `4365` + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:1) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_deciding_failing() -> Weight { + // Proof Size summary in bytes: + // Measured: `512` + // Estimated: `159279` + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::DecidingCount` (r:1 w:1) + /// Proof: `AmbassadorReferenda::DecidingCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_deciding_passing() -> Weight { + // Proof Size summary in bytes: + // Measured: `549` + // Estimated: `159279` + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(49_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_begin_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `602` + // Estimated: `159279` + // Minimum execution time: 43_000_000 picoseconds. + Weight::from_parts(52_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_end_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `585` + // Estimated: `159279` + // Minimum execution time: 42_000_000 picoseconds. + Weight::from_parts(51_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_continue_not_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `602` + // Estimated: `159279` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(42_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_continue_confirming() -> Weight { + // Proof Size summary in bytes: + // Measured: `606` + // Estimated: `159279` + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(39_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:2 w:2) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + fn nudge_referendum_approved() -> Weight { + // Proof Size summary in bytes: + // Measured: `606` + // Estimated: `317568` + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(53_000_000, 0) + .saturating_add(Weight::from_parts(0, 317568)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:1) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:0) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`) + fn nudge_referendum_rejected() -> Weight { + // Proof Size summary in bytes: + // Measured: `602` + // Estimated: `159279` + // Minimum execution time: 43_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) + .saturating_add(Weight::from_parts(0, 159279)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:0) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::RequestStatusFor` (r:1 w:0) + /// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::MetadataOf` (r:0 w:1) + /// Proof: `AmbassadorReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn set_some_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `419` + // Estimated: `4365` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorReferenda::ReferendumInfoFor` (r:1 w:0) + /// Proof: `AmbassadorReferenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(900), added: 3375, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorReferenda::MetadataOf` (r:1 w:1) + /// Proof: `AmbassadorReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + fn clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `4365` + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) + .saturating_add(Weight::from_parts(0, 4365)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda_fellowship_referenda.rs similarity index 90% rename from system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda.rs rename to system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda_fellowship_referenda.rs index faf8cba41c..941b7ab003 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_referenda_fellowship_referenda.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_referenda` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `cob`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -26,8 +26,8 @@ // benchmark // pallet // --chain=./collectives-polkadot-chain-spec.json -// --steps=50 -// --repeat=20 +// --steps=10 +// --repeat=2 // --pallet=pallet_referenda // --extrinsic=* // --wasm-execution=compiled @@ -58,8 +58,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `355` // Estimated: `159279` - // Minimum execution time: 22_322_000 picoseconds. - Weight::from_parts(22_875_000, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(24_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -72,8 +72,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `366` // Estimated: `317568` - // Minimum execution time: 40_189_000 picoseconds. - Weight::from_parts(41_638_000, 0) + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(43_000_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -90,8 +90,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2004` // Estimated: `159279` - // Minimum execution time: 93_853_000 picoseconds. - Weight::from_parts(99_976_000, 0) + // Minimum execution time: 60_000_000 picoseconds. + Weight::from_parts(64_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -108,8 +108,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2045` // Estimated: `159279` - // Minimum execution time: 94_325_000 picoseconds. - Weight::from_parts(100_254_000, 0) + // Minimum execution time: 64_000_000 picoseconds. + Weight::from_parts(74_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -126,8 +126,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `802` // Estimated: `317568` - // Minimum execution time: 176_462_000 picoseconds. - Weight::from_parts(191_308_000, 0) + // Minimum execution time: 99_000_000 picoseconds. + Weight::from_parts(110_000_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -144,8 +144,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `701` // Estimated: `317568` - // Minimum execution time: 51_414_000 picoseconds. - Weight::from_parts(53_021_000, 0) + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(49_000_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -156,8 +156,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `317` // Estimated: `4365` - // Minimum execution time: 25_825_000 picoseconds. - Weight::from_parts(26_513_000, 0) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -168,8 +168,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `167` // Estimated: `4365` - // Minimum execution time: 12_529_000 picoseconds. - Weight::from_parts(13_002_000, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -182,8 +182,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `311` // Estimated: `317568` - // Minimum execution time: 28_373_000 picoseconds. - Weight::from_parts(29_256_000, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -212,10 +212,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `FellowshipReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) fn kill() -> Weight { // Proof Size summary in bytes: - // Measured: `517` + // Measured: `554` // Estimated: `317568` - // Minimum execution time: 122_033_000 picoseconds. - Weight::from_parts(126_286_000, 0) + // Minimum execution time: 108_000_000 picoseconds. + Weight::from_parts(118_000_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(6)) @@ -228,8 +228,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `140` // Estimated: `4277` - // Minimum execution time: 9_802_000 picoseconds. - Weight::from_parts(10_311_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(Weight::from_parts(0, 4277)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -246,8 +246,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2418` // Estimated: `159279` - // Minimum execution time: 84_907_000 picoseconds. - Weight::from_parts(89_312_000, 0) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(58_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -264,8 +264,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2418` // Estimated: `159279` - // Minimum execution time: 85_170_000 picoseconds. - Weight::from_parts(94_580_000, 0) + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(67_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -278,8 +278,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1807` // Estimated: `4365` - // Minimum execution time: 44_895_000 picoseconds. - Weight::from_parts(47_702_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(31_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -292,8 +292,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1774` // Estimated: `4365` - // Minimum execution time: 45_011_000 picoseconds. - Weight::from_parts(48_514_000, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(31_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -308,8 +308,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1790` // Estimated: `4365` - // Minimum execution time: 52_265_000 picoseconds. - Weight::from_parts(55_163_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(34_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -324,8 +324,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1831` // Estimated: `4365` - // Minimum execution time: 49_477_000 picoseconds. - Weight::from_parts(54_951_000, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -338,8 +338,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263` // Estimated: `159279` - // Minimum execution time: 19_102_000 picoseconds. - Weight::from_parts(19_759_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -352,8 +352,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `311` // Estimated: `159279` - // Minimum execution time: 19_380_000 picoseconds. - Weight::from_parts(20_382_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -364,8 +364,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `208` // Estimated: `4365` - // Minimum execution time: 13_183_000 picoseconds. - Weight::from_parts(13_523_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -382,8 +382,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `646` // Estimated: `159279` - // Minimum execution time: 29_548_000 picoseconds. - Weight::from_parts(30_619_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -400,8 +400,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `747` // Estimated: `159279` - // Minimum execution time: 76_414_000 picoseconds. - Weight::from_parts(82_670_000, 0) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(57_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -416,8 +416,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `800` // Estimated: `159279` - // Minimum execution time: 127_975_000 picoseconds. - Weight::from_parts(147_642_000, 0) + // Minimum execution time: 69_000_000 picoseconds. + Weight::from_parts(79_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -432,8 +432,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `783` // Estimated: `159279` - // Minimum execution time: 140_238_000 picoseconds. - Weight::from_parts(148_965_000, 0) + // Minimum execution time: 65_000_000 picoseconds. + Weight::from_parts(81_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -448,8 +448,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `800` // Estimated: `159279` - // Minimum execution time: 137_665_000 picoseconds. - Weight::from_parts(154_780_000, 0) + // Minimum execution time: 60_000_000 picoseconds. + Weight::from_parts(90_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -464,8 +464,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `804` // Estimated: `159279` - // Minimum execution time: 71_830_000 picoseconds. - Weight::from_parts(76_493_000, 0) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(51_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -482,8 +482,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `804` // Estimated: `317568` - // Minimum execution time: 156_738_000 picoseconds. - Weight::from_parts(164_981_000, 0) + // Minimum execution time: 72_000_000 picoseconds. + Weight::from_parts(83_000_000, 0) .saturating_add(Weight::from_parts(0, 317568)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -498,8 +498,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `800` // Estimated: `159279` - // Minimum execution time: 137_691_000 picoseconds. - Weight::from_parts(149_609_000, 0) + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(75_000_000, 0) .saturating_add(Weight::from_parts(0, 159279)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -514,10 +514,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `FellowshipReferenda::MetadataOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) fn set_some_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `386` + // Measured: `419` // Estimated: `4365` - // Minimum execution time: 19_371_000 picoseconds. - Weight::from_parts(19_819_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -530,8 +530,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `4365` - // Minimum execution time: 15_620_000 picoseconds. - Weight::from_parts(16_334_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 4365)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_ambassador_salary.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_ambassador_salary.rs new file mode 100644 index 0000000000..4419916fd7 --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_ambassador_salary.rs @@ -0,0 +1,193 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//! Autogenerated weights for `pallet_salary` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot +// benchmark +// pallet +// --chain=./collectives-polkadot-chain-spec.json +// --steps=10 +// --repeat=2 +// --pallet=pallet_salary +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./collectives-polkadot-weights/ +// --header=./file_header.txt + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_salary`. +pub struct WeightInfo(PhantomData); +impl pallet_salary::WeightInfo for WeightInfo { + /// Storage: `AmbassadorSalary::Status` (r:1 w:1) + /// Proof: `AmbassadorSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + fn init() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1541` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(7_000_000, 0) + .saturating_add(Weight::from_parts(0, 1541)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorSalary::Status` (r:1 w:1) + /// Proof: `AmbassadorSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + fn bump() -> Weight { + // Proof Size summary in bytes: + // Measured: `191` + // Estimated: `1541` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 1541)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorSalary::Status` (r:1 w:0) + /// Proof: `AmbassadorSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorSalary::Claimant` (r:1 w:1) + /// Proof: `AmbassadorSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + fn induct() -> Weight { + // Proof Size summary in bytes: + // Measured: `400` + // Estimated: `3551` + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) + .saturating_add(Weight::from_parts(0, 3551)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorSalary::Status` (r:1 w:1) + /// Proof: `AmbassadorSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorSalary::Claimant` (r:1 w:1) + /// Proof: `AmbassadorSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + fn register() -> Weight { + // Proof Size summary in bytes: + // Measured: `467` + // Estimated: `3551` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) + .saturating_add(Weight::from_parts(0, 3551)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorSalary::Status` (r:1 w:1) + /// Proof: `AmbassadorSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorSalary::Claimant` (r:1 w:1) + /// Proof: `AmbassadorSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `845` + // Estimated: `4310` + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(50_000_000, 0) + .saturating_add(Weight::from_parts(0, 4310)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `AmbassadorSalary::Status` (r:1 w:1) + /// Proof: `AmbassadorSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorSalary::Claimant` (r:1 w:1) + /// Proof: `AmbassadorSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout_other() -> Weight { + // Proof Size summary in bytes: + // Measured: `845` + // Estimated: `4310` + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(50_000_000, 0) + .saturating_add(Weight::from_parts(0, 4310)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `AmbassadorSalary::Status` (r:1 w:1) + /// Proof: `AmbassadorSalary::Status` (`max_values`: Some(1), `max_size`: Some(56), added: 551, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorSalary::Claimant` (r:1 w:1) + /// Proof: `AmbassadorSalary::Claimant` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn check_payment() -> Weight { + // Proof Size summary in bytes: + // Measured: `445` + // Estimated: `3910` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) + .saturating_add(Weight::from_parts(0, 3910)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_fellowship_salary.rs similarity index 90% rename from system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary.rs rename to system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_fellowship_salary.rs index b6f4f277f7..b625997f22 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_salary_fellowship_salary.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_salary` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `cob`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -26,8 +26,8 @@ // benchmark // pallet // --chain=./collectives-polkadot-chain-spec.json -// --steps=50 -// --repeat=20 +// --steps=10 +// --repeat=2 // --pallet=pallet_salary // --extrinsic=* // --wasm-execution=compiled @@ -52,8 +52,8 @@ impl pallet_salary::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `142` // Estimated: `1541` - // Minimum execution time: 6_778_000 picoseconds. - Weight::from_parts(7_097_000, 0) + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(Weight::from_parts(0, 1541)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -64,8 +64,8 @@ impl pallet_salary::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `224` // Estimated: `1541` - // Minimum execution time: 8_996_000 picoseconds. - Weight::from_parts(9_474_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 1541)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -80,8 +80,8 @@ impl pallet_salary::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `395` // Estimated: `3551` - // Minimum execution time: 15_550_000 picoseconds. - Weight::from_parts(16_010_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -96,8 +96,8 @@ impl pallet_salary::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `462` // Estimated: `3551` - // Minimum execution time: 18_448_000 picoseconds. - Weight::from_parts(18_861_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -130,11 +130,11 @@ impl pallet_salary::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `703` - // Estimated: `4168` - // Minimum execution time: 55_581_000 picoseconds. - Weight::from_parts(57_182_000, 0) - .saturating_add(Weight::from_parts(0, 4168)) + // Measured: `740` + // Estimated: `4205` + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(53_000_000, 0) + .saturating_add(Weight::from_parts(0, 4205)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -166,11 +166,11 @@ impl pallet_salary::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn payout_other() -> Weight { // Proof Size summary in bytes: - // Measured: `703` - // Estimated: `4168` - // Minimum execution time: 56_177_000 picoseconds. - Weight::from_parts(57_601_000, 0) - .saturating_add(Weight::from_parts(0, 4168)) + // Measured: `740` + // Estimated: `4205` + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(51_000_000, 0) + .saturating_add(Weight::from_parts(0, 4205)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -184,8 +184,8 @@ impl pallet_salary::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3943` - // Minimum execution time: 20_223_000 picoseconds. - Weight::from_parts(20_911_000, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 3943)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_ambassador_treasury.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_ambassador_treasury.rs new file mode 100644 index 0000000000..f3b72d9b69 --- /dev/null +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_ambassador_treasury.rs @@ -0,0 +1,224 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//! Autogenerated weights for `pallet_treasury` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `cob`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 + +// Executed Command: +// ./target/production/polkadot +// benchmark +// pallet +// --chain=./collectives-polkadot-chain-spec.json +// --steps=10 +// --repeat=2 +// --pallet=pallet_treasury +// --extrinsic=* +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./collectives-polkadot-weights/ +// --header=./file_header.txt + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_treasury`. +pub struct WeightInfo(PhantomData); +impl pallet_treasury::WeightInfo for WeightInfo { + /// Storage: `AmbassadorTreasury::ProposalCount` (r:1 w:1) + /// Proof: `AmbassadorTreasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Approvals` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Proposals` (r:0 w:1) + /// Proof: `AmbassadorTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + fn spend_local() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `1887` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 1887)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `AmbassadorTreasury::ProposalCount` (r:1 w:1) + /// Proof: `AmbassadorTreasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Proposals` (r:0 w:1) + /// Proof: `AmbassadorTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + fn propose_spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `143` + // Estimated: `1489` + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(25_000_000, 0) + .saturating_add(Weight::from_parts(0, 1489)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorTreasury::Proposals` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn reject_proposal() -> Weight { + // Proof Size summary in bytes: + // Measured: `301` + // Estimated: `3593` + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorTreasury::Proposals` (r:1 w:0) + /// Proof: `AmbassadorTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Approvals` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// The range of component `p` is `[0, 99]`. + /// The range of component `p` is `[0, 99]`. + fn approve_proposal(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `504 + p * (7 ±0)` + // Estimated: `3573` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(10_109_090, 0) + .saturating_add(Weight::from_parts(0, 3573)) + // Standard Error: 11_497 + .saturating_add(Weight::from_parts(22_038, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorTreasury::Approvals` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + fn remove_approval() -> Weight { + // Proof Size summary in bytes: + // Measured: `127` + // Estimated: `1887` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) + .saturating_add(Weight::from_parts(0, 1887)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `System::Account` (r:199 w:199) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Deactivated` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Balances::InactiveIssuance` (r:1 w:1) + /// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Approvals` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Proposals` (r:99 w:99) + /// Proof: `AmbassadorTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// The range of component `p` is `[0, 99]`. + /// The range of component `p` is `[0, 99]`. + fn on_initialize_proposals(p: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `340 + p * (253 ±0)` + // Estimated: `3593 + p * (5206 ±0)` + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(25_909_090, 0) + .saturating_add(Weight::from_parts(0, 3593)) + // Standard Error: 266_825 + .saturating_add(Weight::from_parts(28_770_523, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) + .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into())) + } + /// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0) + /// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(1238), added: 3713, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::SpendCount` (r:1 w:1) + /// Proof: `AmbassadorTreasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorTreasury::Spends` (r:0 w:1) + /// Proof: `AmbassadorTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `118` + // Estimated: `4703` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) + .saturating_add(Weight::from_parts(0, 4703)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorTreasury::Spends` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `595` + // Estimated: `5318` + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(44_000_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `AmbassadorTreasury::Spends` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn check_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `349` + // Estimated: `5318` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `AmbassadorTreasury::Spends` (r:1 w:1) + /// Proof: `AmbassadorTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn void_spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `179` + // Estimated: `5318` + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_fellowship_treasury.rs similarity index 86% rename from system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury.rs rename to system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_fellowship_treasury.rs index 4a73e70097..4e61bc6767 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_treasury_fellowship_treasury.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_treasury` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-04-28, STEPS: `10`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `cob`, CPU: `` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./collectives-polkadot-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -26,8 +26,8 @@ // benchmark // pallet // --chain=./collectives-polkadot-chain-spec.json -// --steps=50 -// --repeat=20 +// --steps=10 +// --repeat=2 // --pallet=pallet_treasury // --extrinsic=* // --wasm-execution=compiled @@ -54,10 +54,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `FellowshipTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) fn spend_local() -> Weight { // Proof Size summary in bytes: - // Measured: `6` + // Measured: `42` // Estimated: `1887` - // Minimum execution time: 9_404_000 picoseconds. - Weight::from_parts(9_806_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -68,10 +68,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `FellowshipTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) fn propose_spend() -> Weight { // Proof Size summary in bytes: - // Measured: `107` + // Measured: `143` // Estimated: `1489` - // Minimum execution time: 20_507_000 picoseconds. - Weight::from_parts(20_975_000, 0) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(38_000_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -82,10 +82,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn reject_proposal() -> Weight { // Proof Size summary in bytes: - // Measured: `265` + // Measured: `301` // Estimated: `3593` - // Minimum execution time: 23_196_000 picoseconds. - Weight::from_parts(23_955_000, 0) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -95,15 +95,16 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Storage: `FellowshipTreasury::Approvals` (r:1 w:1) /// Proof: `FellowshipTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 99]`. + /// The range of component `p` is `[0, 99]`. fn approve_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `433 + p * (8 ±0)` + // Measured: `504 + p * (7 ±0)` // Estimated: `3573` - // Minimum execution time: 6_515_000 picoseconds. - Weight::from_parts(9_685_396, 0) + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(9_854_545, 0) .saturating_add(Weight::from_parts(0, 3573)) - // Standard Error: 1_398 - .saturating_add(Weight::from_parts(89_345, 0).saturating_mul(p.into())) + // Standard Error: 9_893 + .saturating_add(Weight::from_parts(29_201, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -111,10 +112,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `FellowshipTreasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) fn remove_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `90` + // Measured: `127` // Estimated: `1887` - // Minimum execution time: 4_996_000 picoseconds. - Weight::from_parts(5_157_000, 0) + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -130,15 +131,16 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Storage: `FellowshipTreasury::Proposals` (r:99 w:99) /// Proof: `FellowshipTreasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 99]`. + /// The range of component `p` is `[0, 99]`. fn on_initialize_proposals(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `269 + p * (253 ±0)` + // Measured: `290 + p * (253 ±0)` // Estimated: `3593 + p * (5206 ±0)` - // Minimum execution time: 19_053_000 picoseconds. - Weight::from_parts(13_219_334, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(31_663_636, 0) .saturating_add(Weight::from_parts(0, 3593)) - // Standard Error: 20_090 - .saturating_add(Weight::from_parts(33_311_475, 0).saturating_mul(p.into())) + // Standard Error: 92_522 + .saturating_add(Weight::from_parts(28_487_603, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -153,10 +155,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `FellowshipTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) fn spend() -> Weight { // Proof Size summary in bytes: - // Measured: `82` + // Measured: `118` // Estimated: `4703` - // Minimum execution time: 17_162_000 picoseconds. - Weight::from_parts(17_903_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 4703)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -185,10 +187,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `522` + // Measured: `595` // Estimated: `5318` - // Minimum execution time: 52_750_000 picoseconds. - Weight::from_parts(54_363_000, 0) + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(48_000_000, 0) .saturating_add(Weight::from_parts(0, 5318)) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(6)) @@ -199,10 +201,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn check_status() -> Weight { // Proof Size summary in bytes: - // Measured: `313` + // Measured: `349` // Estimated: `5318` - // Minimum execution time: 23_322_000 picoseconds. - Weight::from_parts(24_375_000, 0) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 5318)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -211,10 +213,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { /// Proof: `FellowshipTreasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) fn void_spend() -> Weight { // Proof Size summary in bytes: - // Measured: `143` + // Measured: `179` // Estimated: `5318` - // Minimum execution time: 11_788_000 picoseconds. - Weight::from_parts(12_125_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 5318)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs index f61112defa..12a408daa5 100644 --- a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs +++ b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs @@ -32,6 +32,9 @@ use parachains_common::{ }, }; use polkadot_parachain_primitives::primitives::Sibling; +use polkadot_runtime_constants::{ + system_parachain::ASSET_HUB_ID, xcm::body::FELLOWSHIP_ADMIN_INDEX, +}; use sp_runtime::traits::AccountIdConversion; use system_parachains_constants::TREASURY_PALLET_ID; use xcm::latest::prelude::*; @@ -40,11 +43,11 @@ use xcm_builder::{ AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, DescribeFamily, DescribeTerminus, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter, HashedDescription, IsConcrete, - OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, - UsingComponents, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, - XcmFeeToAccount, + LocatableAssetId, OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic, + XcmFeeManagerFromComponents, XcmFeeToAccount, }; use xcm_executor::{traits::ConvertLocation, XcmExecutor}; @@ -65,6 +68,12 @@ parameter_types! { pub RelayTreasuryPalletAccount: AccountId = LocationToAccountId::convert_location(&RelayTreasuryLocation::get()) .unwrap_or(TreasuryAccount::get()); + pub const FellowshipAdminBodyId: BodyId = BodyId::Index(FELLOWSHIP_ADMIN_INDEX); + pub AssetHub: Location = (Parent, Parachain(ASSET_HUB_ID)).into(); + pub AssetHubUsdt: LocatableAssetId = LocatableAssetId { + location: AssetHub::get(), + asset_id: (PalletInstance(50), GeneralIndex(1984)).into(), + }; } /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used diff --git a/system-parachains/constants/src/polkadot.rs b/system-parachains/constants/src/polkadot.rs index 028784270c..e8e71c265b 100644 --- a/system-parachains/constants/src/polkadot.rs +++ b/system-parachains/constants/src/polkadot.rs @@ -33,6 +33,8 @@ pub mod account { pub const IDENTITY_PALLET_ID: PalletId = PalletId(*b"py/ident"); /// Fellowship treasury pallet ID pub const FELLOWSHIP_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/feltr"); + /// Ambassador treasury pallet ID + pub const AMBASSADOR_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/ambtr"); } /// Consensus-related. From 3ccb13d4466ba9494632bcc59b15d7a313b8d6ff Mon Sep 17 00:00:00 2001 From: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Date: Mon, 20 May 2024 19:59:29 +0200 Subject: [PATCH 15/15] Trigger Release v1.2.4 (#317) Triggers release v1.2.4 Waiting on one more PR (Ambassador Program). @EgorPopelyaev can you check `transaction_version`? --- CHANGELOG.md | 2 +- relay/kusama/src/lib.rs | 2 +- relay/polkadot/src/lib.rs | 2 +- system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs | 4 ++-- system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs | 2 +- system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs | 2 +- system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs | 2 +- system-parachains/collectives/collectives-polkadot/src/lib.rs | 2 +- system-parachains/coretime/coretime-kusama/src/lib.rs | 2 +- system-parachains/encointer/src/lib.rs | 2 +- system-parachains/gluttons/glutton-kusama/src/lib.rs | 2 +- system-parachains/people/people-kusama/src/lib.rs | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d13fb052b..7de9faf665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [1.2.4] 20.05.2024 ### Changed diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index e9e5370ca3..bdbe026674 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -161,7 +161,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kusama"), impl_name: create_runtime_str!("parity-kusama"), authoring_version: 2, - spec_version: 1_002_001, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 25, diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 0a34ccc385..387727b54f 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -148,7 +148,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("polkadot"), impl_name: create_runtime_str!("parity-polkadot"), authoring_version: 0, - spec_version: 1_002_000, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 25, diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 84c05c6a85..1db5db6900 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemine"), impl_name: create_runtime_str!("statemine"), authoring_version: 1, - spec_version: 1_002_000, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 14, @@ -128,7 +128,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemine"), impl_name: create_runtime_str!("statemine"), authoring_version: 1, - spec_version: 1_002_000, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 14, diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 1c97b9c0ed..e8d5ebeadf 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -146,7 +146,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemint"), impl_name: create_runtime_str!("statemint"), authoring_version: 1, - spec_version: 1_002_000, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 14, diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 371739ebb7..87edaa1da5 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -164,7 +164,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bridge-hub-kusama"), impl_name: create_runtime_str!("bridge-hub-kusama"), authoring_version: 1, - spec_version: 1_002_002, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 4, diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 046e66e3d3..7f116fb6a5 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -177,7 +177,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bridge-hub-polkadot"), impl_name: create_runtime_str!("bridge-hub-polkadot"), authoring_version: 1, - spec_version: 1_002_002, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index 3707492df5..1f4b4104d0 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -115,7 +115,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("collectives"), impl_name: create_runtime_str!("collectives"), authoring_version: 1, - spec_version: 1_002_000, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 6, diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index a0871ce399..2236d41a0f 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -132,7 +132,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("coretime-kusama"), impl_name: create_runtime_str!("coretime-kusama"), authoring_version: 1, - spec_version: 1_002_003, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0, diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index fd4b534e62..a5aee56894 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -122,7 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("encointer-parachain"), impl_name: create_runtime_str!("encointer-parachain"), authoring_version: 1, - spec_version: 1_002_000, + spec_version: 1_002_004, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/system-parachains/gluttons/glutton-kusama/src/lib.rs b/system-parachains/gluttons/glutton-kusama/src/lib.rs index 040ff6ea0a..5baa7ec3ad 100644 --- a/system-parachains/gluttons/glutton-kusama/src/lib.rs +++ b/system-parachains/gluttons/glutton-kusama/src/lib.rs @@ -89,7 +89,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("glutton"), impl_name: create_runtime_str!("glutton"), authoring_version: 1, - spec_version: 1_002_000, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index 420f8e099f..45bb9568d3 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -129,7 +129,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("people-kusama"), impl_name: create_runtime_str!("people-kusama"), authoring_version: 1, - spec_version: 1_002_001, + spec_version: 1_002_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0,