diff --git a/Cargo.lock b/Cargo.lock index 4d28b9ad95d5..24ab379b69cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18574,18 +18574,18 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.9.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" dependencies = [ "cc", ] diff --git a/polkadot/runtime/parachains/src/assigner_coretime/mod.rs b/polkadot/runtime/parachains/src/assigner_coretime/mod.rs index 9ed007919b81..7ee76600b42c 100644 --- a/polkadot/runtime/parachains/src/assigner_coretime/mod.rs +++ b/polkadot/runtime/parachains/src/assigner_coretime/mod.rs @@ -28,7 +28,7 @@ mod mock_helpers; mod tests; use crate::{ - assigner_on_demand, configuration, + configuration, on_demand, paras::AssignCoretime, scheduler::common::{Assignment, AssignmentProvider}, ParaId, @@ -201,10 +201,7 @@ pub mod pallet { pub struct Pallet(_); #[pallet::config] - pub trait Config: - frame_system::Config + configuration::Config + assigner_on_demand::Config - { - } + pub trait Config: frame_system::Config + configuration::Config + on_demand::Config {} /// Scheduled assignment sets. /// @@ -281,8 +278,7 @@ impl AssignmentProvider> for Pallet { match a_type { CoreAssignment::Idle => None, - CoreAssignment::Pool => - assigner_on_demand::Pallet::::pop_assignment_for_core(core_idx), + CoreAssignment::Pool => on_demand::Pallet::::pop_assignment_for_core(core_idx), CoreAssignment::Task(para_id) => Some(Assignment::Bulk((*para_id).into())), } }) @@ -291,7 +287,7 @@ impl AssignmentProvider> for Pallet { fn report_processed(assignment: Assignment) { match assignment { Assignment::Pool { para_id, core_index } => - assigner_on_demand::Pallet::::report_processed(para_id, core_index), + on_demand::Pallet::::report_processed(para_id, core_index), Assignment::Bulk(_) => {}, } } @@ -304,7 +300,7 @@ impl AssignmentProvider> for Pallet { fn push_back_assignment(assignment: Assignment) { match assignment { Assignment::Pool { para_id, core_index } => - assigner_on_demand::Pallet::::push_back_assignment(para_id, core_index), + on_demand::Pallet::::push_back_assignment(para_id, core_index), Assignment::Bulk(_) => { // Session changes are rough. We just drop assignments that did not make it on a // session boundary. This seems sensible as bulk is region based. Meaning, even if diff --git a/polkadot/runtime/parachains/src/assigner_coretime/tests.rs b/polkadot/runtime/parachains/src/assigner_coretime/tests.rs index 9b0cbcb2d7d6..e7994b8ef820 100644 --- a/polkadot/runtime/parachains/src/assigner_coretime/tests.rs +++ b/polkadot/runtime/parachains/src/assigner_coretime/tests.rs @@ -20,8 +20,8 @@ use crate::{ assigner_coretime::{mock_helpers::GenesisConfigBuilder, pallet::Error, Schedule}, initializer::SessionChangeNotification, mock::{ - new_test_ext, Balances, CoretimeAssigner, OnDemandAssigner, Paras, ParasShared, - RuntimeOrigin, Scheduler, System, Test, + new_test_ext, Balances, CoretimeAssigner, OnDemand, Paras, ParasShared, RuntimeOrigin, + Scheduler, System, Test, }, paras::{ParaGenesisArgs, ParaKind}, scheduler::common::Assignment, @@ -75,7 +75,7 @@ fn run_to_block( Scheduler::initializer_initialize(b + 1); // Update the spot traffic and revenue on every block. - OnDemandAssigner::on_initialize(b + 1); + OnDemand::on_initialize(b + 1); // In the real runtime this is expected to be called by the `InclusionInherent` pallet. Scheduler::free_cores_and_fill_claim_queue(BTreeMap::new(), b + 1); @@ -527,11 +527,7 @@ fn pop_assignment_for_core_works() { schedule_blank_para(para_id, ParaKind::Parathread); Balances::make_free_balance_be(&alice, amt); run_to_block(1, |n| if n == 1 { Some(Default::default()) } else { None }); - assert_ok!(OnDemandAssigner::place_order_allow_death( - RuntimeOrigin::signed(alice), - amt, - para_id - )); + assert_ok!(OnDemand::place_order_allow_death(RuntimeOrigin::signed(alice), amt, para_id)); // Case 1: Assignment idle assert_ok!(CoretimeAssigner::assign_core( diff --git a/polkadot/runtime/parachains/src/coretime/benchmarking.rs b/polkadot/runtime/parachains/src/coretime/benchmarking.rs index 028250e188ee..6d593f1954ff 100644 --- a/polkadot/runtime/parachains/src/coretime/benchmarking.rs +++ b/polkadot/runtime/parachains/src/coretime/benchmarking.rs @@ -31,20 +31,20 @@ mod benchmarks { #[benchmark] fn request_revenue_at() { let root_origin = ::RuntimeOrigin::root(); - let mhr = ::MaxHistoricalRevenue::get(); + let mhr = ::MaxHistoricalRevenue::get(); frame_system::Pallet::::set_block_number((mhr + 2).into()); - let minimum_balance = ::Currency::minimum_balance(); + let minimum_balance = ::Currency::minimum_balance(); let rev: BoundedVec< - <::Currency as frame_support::traits::Currency< + <::Currency as frame_support::traits::Currency< T::AccountId, >>::Balance, T::MaxHistoricalRevenue, > = BoundedVec::try_from((1..=mhr).map(|v| minimum_balance * v.into()).collect::>()) .unwrap(); - assigner_on_demand::Revenue::::put(rev); + on_demand::Revenue::::put(rev); - ::Currency::make_free_balance_be( - &>::account_id(), + ::Currency::make_free_balance_be( + &>::account_id(), minimum_balance * (mhr * (mhr + 1)).into(), ); diff --git a/polkadot/runtime/parachains/src/coretime/mod.rs b/polkadot/runtime/parachains/src/coretime/mod.rs index 1c38b3989232..fbd8935f1990 100644 --- a/polkadot/runtime/parachains/src/coretime/mod.rs +++ b/polkadot/runtime/parachains/src/coretime/mod.rs @@ -48,8 +48,8 @@ use xcm_executor::traits::TransactAsset; use crate::{ assigner_coretime::{self, PartsOf57600}, - assigner_on_demand, initializer::{OnNewSession, SessionChangeNotification}, + on_demand, origin::{ensure_parachain, Origin}, }; @@ -116,6 +116,7 @@ enum CoretimeCalls { #[frame_support::pallet] pub mod pallet { + use crate::configuration; use sp_runtime::traits::TryConvert; use xcm::v4::InteriorLocation; @@ -128,9 +129,7 @@ pub mod pallet { pub struct Pallet(_); #[pallet::config] - pub trait Config: - frame_system::Config + assigner_coretime::Config + assigner_on_demand::Config - { + pub trait Config: frame_system::Config + assigner_coretime::Config + on_demand::Config { type RuntimeOrigin: From<::RuntimeOrigin> + Into::RuntimeOrigin>>; type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -308,7 +307,7 @@ impl Pallet { // When cannot be in the future. ensure!(until_bnf <= now, Error::::RequestedFutureRevenue); - let amount = >::claim_revenue_until(until_bnf); + let amount = >::claim_revenue_until(until_bnf); log::debug!(target: LOG_TARGET, "Revenue info requested: {:?}", amount); let raw_revenue: Balance = amount.try_into().map_err(|_| { @@ -365,14 +364,15 @@ fn do_notify_revenue(when: BlockNumber, raw_revenue: Balance) -> Resu if raw_revenue > 0 { let on_demand_pot = - T::AccountToLocation::try_convert(&>::account_id()) - .map_err(|err| { + T::AccountToLocation::try_convert(&>::account_id()).map_err( + |err| { log::error!( target: LOG_TARGET, "Failed to convert on-demand pot account to XCM location: {err:?}", ); XcmError::InvalidLocation - })?; + }, + )?; let withdrawn = T::AssetTransactor::withdraw_asset(&asset, &on_demand_pot, None)?; diff --git a/polkadot/runtime/parachains/src/lib.rs b/polkadot/runtime/parachains/src/lib.rs index f2995d770e71..f1162e1cc215 100644 --- a/polkadot/runtime/parachains/src/lib.rs +++ b/polkadot/runtime/parachains/src/lib.rs @@ -24,7 +24,6 @@ #![cfg_attr(not(feature = "std"), no_std)] pub mod assigner_coretime; -pub mod assigner_on_demand; pub mod assigner_parachains; pub mod configuration; pub mod coretime; @@ -34,6 +33,7 @@ pub mod hrmp; pub mod inclusion; pub mod initializer; pub mod metrics; +pub mod on_demand; pub mod origin; pub mod paras; pub mod paras_inherent; diff --git a/polkadot/runtime/parachains/src/mock.rs b/polkadot/runtime/parachains/src/mock.rs index 45576668f6d6..fbe9ebf809b3 100644 --- a/polkadot/runtime/parachains/src/mock.rs +++ b/polkadot/runtime/parachains/src/mock.rs @@ -17,10 +17,9 @@ //! Mocks for all the traits. use crate::{ - assigner_coretime, assigner_on_demand, assigner_parachains, configuration, coretime, disputes, - dmp, hrmp, + assigner_coretime, assigner_parachains, configuration, coretime, disputes, dmp, hrmp, inclusion::{self, AggregateMessageOrigin, UmpQueueId}, - initializer, origin, paras, + initializer, on_demand, origin, paras, paras::ParaKind, paras_inherent, scheduler, scheduler::common::AssignmentProvider, @@ -78,7 +77,7 @@ frame_support::construct_runtime!( Scheduler: scheduler, MockAssigner: mock_assigner, ParachainsAssigner: assigner_parachains, - OnDemandAssigner: assigner_on_demand, + OnDemand: on_demand, CoretimeAssigner: assigner_coretime, Coretime: coretime, Initializer: initializer, @@ -401,11 +400,11 @@ parameter_types! { pub const OnDemandPalletId: PalletId = PalletId(*b"py/ondmd"); } -impl assigner_on_demand::Config for Test { +impl on_demand::Config for Test { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type TrafficDefaultValue = OnDemandTrafficDefaultValue; - type WeightInfo = crate::assigner_on_demand::TestWeightInfo; + type WeightInfo = crate::on_demand::TestWeightInfo; type MaxHistoricalRevenue = MaxHistoricalRevenue; type PalletId = OnDemandPalletId; } @@ -540,7 +539,7 @@ pub mod mock_assigner { // We don't care about core affinity in the test assigner fn report_processed(_assignment: Assignment) {} - // The results of this are tested in assigner_on_demand tests. No need to represent it + // The results of this are tested in on_demand tests. No need to represent it // in the mock assigner. fn push_back_assignment(_assignment: Assignment) {} diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/benchmarking.rs b/polkadot/runtime/parachains/src/on_demand/benchmarking.rs similarity index 97% rename from polkadot/runtime/parachains/src/assigner_on_demand/benchmarking.rs rename to polkadot/runtime/parachains/src/on_demand/benchmarking.rs index b0ebfe77a966..d494a77a5c4d 100644 --- a/polkadot/runtime/parachains/src/assigner_on_demand/benchmarking.rs +++ b/polkadot/runtime/parachains/src/on_demand/benchmarking.rs @@ -94,7 +94,7 @@ mod benchmarks { impl_benchmark_test_suite!( Pallet, crate::mock::new_test_ext( - crate::assigner_on_demand::mock_helpers::GenesisConfigBuilder::default().build() + crate::on_demand::mock_helpers::GenesisConfigBuilder::default().build() ), crate::mock::Test ); diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/migration.rs b/polkadot/runtime/parachains/src/on_demand/migration.rs similarity index 94% rename from polkadot/runtime/parachains/src/assigner_on_demand/migration.rs rename to polkadot/runtime/parachains/src/on_demand/migration.rs index 03f63d7333b6..6cc25b20afb8 100644 --- a/polkadot/runtime/parachains/src/assigner_on_demand/migration.rs +++ b/polkadot/runtime/parachains/src/on_demand/migration.rs @@ -47,7 +47,7 @@ mod v0 { mod v1 { use super::*; - use crate::assigner_on_demand::LOG_TARGET; + use crate::on_demand::LOG_TARGET; /// Migration to V1 pub struct UncheckedMigrateToV1(core::marker::PhantomData); @@ -142,7 +142,7 @@ pub type MigrateV0ToV1 = VersionedMigration< #[cfg(test)] mod tests { use super::{v0, v1, UncheckedOnRuntimeUpgrade, Weight}; - use crate::mock::{new_test_ext, MockGenesisConfig, OnDemandAssigner, Test}; + use crate::mock::{new_test_ext, MockGenesisConfig, OnDemand, Test}; use polkadot_primitives::Id as ParaId; #[test] @@ -159,7 +159,7 @@ mod tests { let old_queue = v0::OnDemandQueue::::get(); assert_eq!(old_queue.len(), 5); // New queue has 0 orders - assert_eq!(OnDemandAssigner::get_queue_status().size(), 0); + assert_eq!(OnDemand::get_queue_status().size(), 0); // For tests, db weight is zero. assert_eq!( @@ -168,10 +168,10 @@ mod tests { ); // New queue has 5 orders - assert_eq!(OnDemandAssigner::get_queue_status().size(), 5); + assert_eq!(OnDemand::get_queue_status().size(), 5); // Compare each entry from the old queue with the entry in the new queue. - old_queue.iter().zip(OnDemandAssigner::get_free_entries().iter()).for_each( + old_queue.iter().zip(OnDemand::get_free_entries().iter()).for_each( |(old_enq, new_enq)| { assert_eq!(old_enq.para_id, new_enq.para_id); }, diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/mock_helpers.rs b/polkadot/runtime/parachains/src/on_demand/mock_helpers.rs similarity index 100% rename from polkadot/runtime/parachains/src/assigner_on_demand/mock_helpers.rs rename to polkadot/runtime/parachains/src/on_demand/mock_helpers.rs diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/mod.rs b/polkadot/runtime/parachains/src/on_demand/mod.rs similarity index 99% rename from polkadot/runtime/parachains/src/assigner_on_demand/mod.rs rename to polkadot/runtime/parachains/src/on_demand/mod.rs index f045e957a690..dc046c194fd0 100644 --- a/polkadot/runtime/parachains/src/assigner_on_demand/mod.rs +++ b/polkadot/runtime/parachains/src/on_demand/mod.rs @@ -66,7 +66,7 @@ use types::{ SpotTrafficCalculationErr, }; -const LOG_TARGET: &str = "runtime::parachains::assigner-on-demand"; +const LOG_TARGET: &str = "runtime::parachains::on-demand"; pub use pallet::*; diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/tests.rs b/polkadot/runtime/parachains/src/on_demand/tests.rs similarity index 72% rename from polkadot/runtime/parachains/src/assigner_on_demand/tests.rs rename to polkadot/runtime/parachains/src/on_demand/tests.rs index 0bad4346cfd9..974295411810 100644 --- a/polkadot/runtime/parachains/src/assigner_on_demand/tests.rs +++ b/polkadot/runtime/parachains/src/on_demand/tests.rs @@ -17,17 +17,17 @@ use super::*; use crate::{ - assigner_on_demand::{ + initializer::SessionChangeNotification, + mock::{ + new_test_ext, Balances, OnDemand, Paras, ParasShared, RuntimeOrigin, Scheduler, System, + Test, + }, + on_demand::{ self, mock_helpers::GenesisConfigBuilder, types::{QueueIndex, ReverseQueueIndex}, Error, }, - initializer::SessionChangeNotification, - mock::{ - new_test_ext, Balances, OnDemandAssigner, Paras, ParasShared, RuntimeOrigin, Scheduler, - System, Test, - }, paras::{ParaGenesisArgs, ParaKind}, }; use alloc::collections::btree_map::BTreeMap; @@ -83,7 +83,7 @@ fn run_to_block( Scheduler::initializer_initialize(b + 1); // Update the spot traffic and revenue on every block. - OnDemandAssigner::on_initialize(b + 1); + OnDemand::on_initialize(b + 1); // In the real runtime this is expected to be called by the `InclusionInherent` pallet. Scheduler::free_cores_and_fill_claim_queue(BTreeMap::new(), b + 1); @@ -99,7 +99,7 @@ fn place_order_run_to_blocknumber(para_id: ParaId, blocknumber: Option::SpotPriceHigherThanMaxAmount, ); // Does not work with insufficient balance assert_noop!( - OnDemandAssigner::place_order_allow_death(RuntimeOrigin::signed(alice), amt, para_id), + OnDemand::place_order_allow_death(RuntimeOrigin::signed(alice), amt, para_id), BalancesError::::InsufficientBalance ); // Works Balances::make_free_balance_be(&alice, amt); run_to_block(101, |n| if n == 101 { Some(Default::default()) } else { None }); - assert_ok!(OnDemandAssigner::place_order_allow_death( - RuntimeOrigin::signed(alice), - amt, - para_id - )); + assert_ok!(OnDemand::place_order_allow_death(RuntimeOrigin::signed(alice), amt, para_id)); }); } @@ -336,11 +325,7 @@ fn place_order_keep_alive_keeps_alive() { assert!(Paras::is_parathread(para_id)); assert_noop!( - OnDemandAssigner::place_order_keep_alive( - RuntimeOrigin::signed(alice), - max_amt, - para_id - ), + OnDemand::place_order_keep_alive(RuntimeOrigin::signed(alice), max_amt, para_id), BalancesError::::InsufficientBalance ); }); @@ -357,7 +342,7 @@ fn pop_assignment_for_core_works() { run_to_block(11, |n| if n == 11 { Some(Default::default()) } else { None }); // Pop should return none with empty queue - assert_eq!(OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)), None); + assert_eq!(OnDemand::pop_assignment_for_core(CoreIndex(0)), None); // Add enough assignments to the order queue. for _ in 0..2 { @@ -367,19 +352,19 @@ fn pop_assignment_for_core_works() { // Popped assignments should be for the correct paras and cores assert_eq!( - OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)).map(|a| a.para_id()), + OnDemand::pop_assignment_for_core(CoreIndex(0)).map(|a| a.para_id()), Some(para_a) ); assert_eq!( - OnDemandAssigner::pop_assignment_for_core(CoreIndex(1)).map(|a| a.para_id()), + OnDemand::pop_assignment_for_core(CoreIndex(1)).map(|a| a.para_id()), Some(para_b) ); assert_eq!( - OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)).map(|a| a.para_id()), + OnDemand::pop_assignment_for_core(CoreIndex(0)).map(|a| a.para_id()), Some(para_a) ); assert_eq!( - OnDemandAssigner::pop_assignment_for_core(CoreIndex(1)).map(|a| a.para_id()), + OnDemand::pop_assignment_for_core(CoreIndex(1)).map(|a| a.para_id()), Some(para_b) ); }); @@ -400,30 +385,21 @@ fn push_back_assignment_works() { place_order_run_to_101(para_b); // Pop order a - assert_eq!( - OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)).unwrap().para_id(), - para_a - ); + assert_eq!(OnDemand::pop_assignment_for_core(CoreIndex(0)).unwrap().para_id(), para_a); // Para a should have affinity for core 0 - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().count, 1); - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().core_index, CoreIndex(0)); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().count, 1); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().core_index, CoreIndex(0)); // Push back order a - OnDemandAssigner::push_back_assignment(para_a, CoreIndex(0)); + OnDemand::push_back_assignment(para_a, CoreIndex(0)); // Para a should have no affinity - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).is_none(), true); + assert_eq!(OnDemand::get_affinity_map(para_a).is_none(), true); // Queue should contain orders a, b. A in front of b. - assert_eq!( - OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)).unwrap().para_id(), - para_a - ); - assert_eq!( - OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)).unwrap().para_id(), - para_b - ); + assert_eq!(OnDemand::pop_assignment_for_core(CoreIndex(0)).unwrap().para_id(), para_a); + assert_eq!(OnDemand::pop_assignment_for_core(CoreIndex(0)).unwrap().para_id(), para_b); }); } @@ -439,8 +415,8 @@ fn affinity_prohibits_parallel_scheduling() { run_to_block(11, |n| if n == 11 { Some(Default::default()) } else { None }); // There should be no affinity before starting. - assert!(OnDemandAssigner::get_affinity_map(para_a).is_none()); - assert!(OnDemandAssigner::get_affinity_map(para_b).is_none()); + assert!(OnDemand::get_affinity_map(para_a).is_none()); + assert!(OnDemand::get_affinity_map(para_b).is_none()); // Add 2 assignments for para_a for every para_b. place_order_run_to_101(para_a); @@ -449,22 +425,22 @@ fn affinity_prohibits_parallel_scheduling() { // Approximate having 1 core. for _ in 0..3 { - assert!(OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)).is_some()); + assert!(OnDemand::pop_assignment_for_core(CoreIndex(0)).is_some()); } - assert!(OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)).is_none()); + assert!(OnDemand::pop_assignment_for_core(CoreIndex(0)).is_none()); // Affinity on one core is meaningless. - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().count, 2); - assert_eq!(OnDemandAssigner::get_affinity_map(para_b).unwrap().count, 1); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().count, 2); + assert_eq!(OnDemand::get_affinity_map(para_b).unwrap().count, 1); assert_eq!( - OnDemandAssigner::get_affinity_map(para_a).unwrap().core_index, - OnDemandAssigner::get_affinity_map(para_b).unwrap().core_index, + OnDemand::get_affinity_map(para_a).unwrap().core_index, + OnDemand::get_affinity_map(para_b).unwrap().core_index, ); // Clear affinity - OnDemandAssigner::report_processed(para_a, 0.into()); - OnDemandAssigner::report_processed(para_a, 0.into()); - OnDemandAssigner::report_processed(para_b, 0.into()); + OnDemand::report_processed(para_a, 0.into()); + OnDemand::report_processed(para_a, 0.into()); + OnDemand::report_processed(para_b, 0.into()); // Add 2 assignments for para_a for every para_b. place_order_run_to_101(para_a); @@ -473,25 +449,25 @@ fn affinity_prohibits_parallel_scheduling() { // Approximate having 3 cores. CoreIndex 2 should be unable to obtain an assignment for _ in 0..3 { - OnDemandAssigner::pop_assignment_for_core(CoreIndex(0)); - OnDemandAssigner::pop_assignment_for_core(CoreIndex(1)); - assert!(OnDemandAssigner::pop_assignment_for_core(CoreIndex(2)).is_none()); + OnDemand::pop_assignment_for_core(CoreIndex(0)); + OnDemand::pop_assignment_for_core(CoreIndex(1)); + assert!(OnDemand::pop_assignment_for_core(CoreIndex(2)).is_none()); } // Affinity should be the same as before, but on different cores. - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().count, 2); - assert_eq!(OnDemandAssigner::get_affinity_map(para_b).unwrap().count, 1); - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().core_index, CoreIndex(0)); - assert_eq!(OnDemandAssigner::get_affinity_map(para_b).unwrap().core_index, CoreIndex(1)); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().count, 2); + assert_eq!(OnDemand::get_affinity_map(para_b).unwrap().count, 1); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().core_index, CoreIndex(0)); + assert_eq!(OnDemand::get_affinity_map(para_b).unwrap().core_index, CoreIndex(1)); // Clear affinity - OnDemandAssigner::report_processed(para_a, CoreIndex(0)); - OnDemandAssigner::report_processed(para_a, CoreIndex(0)); - OnDemandAssigner::report_processed(para_b, CoreIndex(1)); + OnDemand::report_processed(para_a, CoreIndex(0)); + OnDemand::report_processed(para_a, CoreIndex(0)); + OnDemand::report_processed(para_b, CoreIndex(1)); // There should be no affinity after clearing. - assert!(OnDemandAssigner::get_affinity_map(para_a).is_none()); - assert!(OnDemandAssigner::get_affinity_map(para_b).is_none()); + assert!(OnDemand::get_affinity_map(para_a).is_none()); + assert!(OnDemand::get_affinity_map(para_b).is_none()); }); } @@ -505,7 +481,7 @@ fn affinity_changes_work() { run_to_block(11, |n| if n == 11 { Some(Default::default()) } else { None }); // There should be no affinity before starting. - assert!(OnDemandAssigner::get_affinity_map(para_a).is_none()); + assert!(OnDemand::get_affinity_map(para_a).is_none()); // Add enough assignments to the order queue. for _ in 0..10 { @@ -513,46 +489,46 @@ fn affinity_changes_work() { } // There should be no affinity before the scheduler pops. - assert!(OnDemandAssigner::get_affinity_map(para_a).is_none()); + assert!(OnDemand::get_affinity_map(para_a).is_none()); - OnDemandAssigner::pop_assignment_for_core(core_index); + OnDemand::pop_assignment_for_core(core_index); // Affinity count is 1 after popping. - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().count, 1); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().count, 1); - OnDemandAssigner::report_processed(para_a, 0.into()); - OnDemandAssigner::pop_assignment_for_core(core_index); + OnDemand::report_processed(para_a, 0.into()); + OnDemand::pop_assignment_for_core(core_index); // Affinity count is 1 after popping with a previous para. - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().count, 1); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().count, 1); for _ in 0..3 { - OnDemandAssigner::pop_assignment_for_core(core_index); + OnDemand::pop_assignment_for_core(core_index); } // Affinity count is 4 after popping 3 times without a previous para. - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().count, 4); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().count, 4); for _ in 0..5 { - OnDemandAssigner::report_processed(para_a, 0.into()); - assert!(OnDemandAssigner::pop_assignment_for_core(core_index).is_some()); + OnDemand::report_processed(para_a, 0.into()); + assert!(OnDemand::pop_assignment_for_core(core_index).is_some()); } // Affinity count should still be 4 but queue should be empty. - assert!(OnDemandAssigner::pop_assignment_for_core(core_index).is_none()); - assert_eq!(OnDemandAssigner::get_affinity_map(para_a).unwrap().count, 4); + assert!(OnDemand::pop_assignment_for_core(core_index).is_none()); + assert_eq!(OnDemand::get_affinity_map(para_a).unwrap().count, 4); // Pop 4 times and get to exactly 0 (None) affinity. for _ in 0..4 { - OnDemandAssigner::report_processed(para_a, 0.into()); - assert!(OnDemandAssigner::pop_assignment_for_core(core_index).is_none()); + OnDemand::report_processed(para_a, 0.into()); + assert!(OnDemand::pop_assignment_for_core(core_index).is_none()); } - assert!(OnDemandAssigner::get_affinity_map(para_a).is_none()); + assert!(OnDemand::get_affinity_map(para_a).is_none()); // Decreasing affinity beyond 0 should still be None. - OnDemandAssigner::report_processed(para_a, 0.into()); - assert!(OnDemandAssigner::pop_assignment_for_core(core_index).is_none()); - assert!(OnDemandAssigner::get_affinity_map(para_a).is_none()); + OnDemand::report_processed(para_a, 0.into()); + assert!(OnDemand::pop_assignment_for_core(core_index).is_none()); + assert!(OnDemand::get_affinity_map(para_a).is_none()); }); } @@ -577,28 +553,25 @@ fn new_affinity_for_a_core_must_come_from_free_entries() { }); // There are 4 entries in free_entries. - let start_free_entries = OnDemandAssigner::get_free_entries().len(); + let start_free_entries = OnDemand::get_free_entries().len(); assert_eq!(start_free_entries, 4); // Pop assignments on all cores. core_indices.iter().enumerate().for_each(|(n, core_index)| { // There is no affinity on the core prior to popping. - assert!(OnDemandAssigner::get_affinity_entries(*core_index).is_empty()); + assert!(OnDemand::get_affinity_entries(*core_index).is_empty()); // There's always an order to be popped for each core. - let free_entries = OnDemandAssigner::get_free_entries(); + let free_entries = OnDemand::get_free_entries(); let next_order = free_entries.peek(); // There is no affinity on the paraid prior to popping. - assert!(OnDemandAssigner::get_affinity_map(next_order.unwrap().para_id).is_none()); + assert!(OnDemand::get_affinity_map(next_order.unwrap().para_id).is_none()); - match OnDemandAssigner::pop_assignment_for_core(*core_index) { + match OnDemand::pop_assignment_for_core(*core_index) { Some(assignment) => { // The popped assignment came from free entries. - assert_eq!( - start_free_entries - 1 - n, - OnDemandAssigner::get_free_entries().len() - ); + assert_eq!(start_free_entries - 1 - n, OnDemand::get_free_entries().len()); // The popped assignment has the same para id as the next order. assert_eq!(assignment.para_id(), next_order.unwrap().para_id); }, @@ -607,11 +580,11 @@ fn new_affinity_for_a_core_must_come_from_free_entries() { }); // All entries have been removed from free_entries. - assert!(OnDemandAssigner::get_free_entries().is_empty()); + assert!(OnDemand::get_free_entries().is_empty()); // All chains have an affinity count of 1. parachains.iter().for_each(|chain| { - assert_eq!(OnDemandAssigner::get_affinity_map(*chain).unwrap().count, 1); + assert_eq!(OnDemand::get_affinity_map(*chain).unwrap().count, 1); }); }); } @@ -691,7 +664,7 @@ fn queue_status_size_fn_works() { schedule_blank_para(*chain, ParaKind::Parathread); }); - assert_eq!(OnDemandAssigner::get_queue_status().size(), 0); + assert_eq!(OnDemand::get_queue_status().size(), 0); run_to_block(11, |n| if n == 11 { Some(Default::default()) } else { None }); @@ -703,27 +676,27 @@ fn queue_status_size_fn_works() { }); // 6 orders in free entries - assert_eq!(OnDemandAssigner::get_free_entries().len(), 6); + assert_eq!(OnDemand::get_free_entries().len(), 6); // 6 orders via queue status size assert_eq!( - OnDemandAssigner::get_free_entries().len(), - OnDemandAssigner::get_queue_status().size() as usize + OnDemand::get_free_entries().len(), + OnDemand::get_queue_status().size() as usize ); core_indices.iter().for_each(|core_index| { - OnDemandAssigner::pop_assignment_for_core(*core_index); + OnDemand::pop_assignment_for_core(*core_index); }); // There should be 2 orders in the scheduler's claimqueue, // 2 in assorted AffinityMaps and 2 in free. // ParaId 111 - assert_eq!(OnDemandAssigner::get_affinity_entries(core_indices[0]).len(), 1); + assert_eq!(OnDemand::get_affinity_entries(core_indices[0]).len(), 1); // ParaId 222 - assert_eq!(OnDemandAssigner::get_affinity_entries(core_indices[1]).len(), 1); + assert_eq!(OnDemand::get_affinity_entries(core_indices[1]).len(), 1); // Free entries are from ParaId 333 - assert_eq!(OnDemandAssigner::get_free_entries().len(), 2); + assert_eq!(OnDemand::get_free_entries().len(), 2); // For a total size of 4. - assert_eq!(OnDemandAssigner::get_queue_status().size(), 4) + assert_eq!(OnDemand::get_queue_status().size(), 4) }); } @@ -734,25 +707,30 @@ fn revenue_information_fetching_works() { schedule_blank_para(para_a, ParaKind::Parathread); // Mock assigner sets max revenue history to 10. run_to_block(10, |n| if n == 10 { Some(Default::default()) } else { None }); - let revenue = OnDemandAssigner::claim_revenue_until(10); + let revenue = OnDemand::claim_revenue_until(10); // No revenue should be recorded. assert_eq!(revenue, 0); // Place one order place_order_run_to_blocknumber(para_a, Some(11)); - let revenue = OnDemandAssigner::get_revenue(); - let claim = OnDemandAssigner::claim_revenue_until(11); + let revenue = OnDemand::get_revenue(); + let amt = OnDemand::claim_revenue_until(11); // Revenue until the current block is still zero as "until" is non-inclusive - assert_eq!(claim, 0); + assert_eq!(amt, 0); - run_to_block(12, |n| if n == 12 { Some(Default::default()) } else { None }); - let claim = OnDemandAssigner::claim_revenue_until(12); + let amt = OnDemand::claim_revenue_until(12); // Revenue for a single order should be recorded and shouldn't have been pruned by the // previous call - assert_eq!(claim, revenue[0]); + assert_eq!(amt, revenue[0]); + + run_to_block(12, |n| if n == 12 { Some(Default::default()) } else { None }); + let revenue = OnDemand::claim_revenue_until(13); + + // No revenue should be recorded. + assert_eq!(revenue, 0); // Place many orders place_order(para_a); @@ -762,9 +740,9 @@ fn revenue_information_fetching_works() { place_order(para_a); - run_to_block(15, |n| if n == 14 { Some(Default::default()) } else { None }); + run_to_block(14, |n| if n == 14 { Some(Default::default()) } else { None }); - let revenue = OnDemandAssigner::claim_revenue_until(15); + let revenue = OnDemand::claim_revenue_until(15); // All 3 orders should be accounted for. assert_eq!(revenue, 30_000); @@ -772,13 +750,13 @@ fn revenue_information_fetching_works() { // Place one order place_order_run_to_blocknumber(para_a, Some(16)); - let revenue = OnDemandAssigner::claim_revenue_until(15); + let revenue = OnDemand::claim_revenue_until(15); // Order is not in range of the revenue_until call assert_eq!(revenue, 0); - run_to_block(21, |n| if n == 20 { Some(Default::default()) } else { None }); - let revenue = OnDemandAssigner::claim_revenue_until(21); + run_to_block(20, |n| if n == 20 { Some(Default::default()) } else { None }); + let revenue = OnDemand::claim_revenue_until(21); assert_eq!(revenue, 10_000); // Make sure overdue revenue is accumulated @@ -786,8 +764,7 @@ fn revenue_information_fetching_works() { run_to_block(i, |n| if n % 10 == 0 { Some(Default::default()) } else { None }); place_order(para_a); } - run_to_block(36, |_| None); - let revenue = OnDemandAssigner::claim_revenue_until(36); + let revenue = OnDemand::claim_revenue_until(36); assert_eq!(revenue, 150_000); }); } @@ -796,7 +773,7 @@ fn revenue_information_fetching_works() { fn pot_account_is_immortal() { new_test_ext(GenesisConfigBuilder::default().build()).execute_with(|| { let para_a = ParaId::from(111); - let pot = OnDemandAssigner::account_id(); + let pot = OnDemand::account_id(); assert!(!System::account_exists(&pot)); schedule_blank_para(para_a, ParaKind::Parathread); // Mock assigner sets max revenue history to 10. @@ -807,7 +784,7 @@ fn pot_account_is_immortal() { assert!(purchase_revenue > 0); run_to_block(15, |_| None); - let _imb = ::Currency::withdraw( + let _imb = ::Currency::withdraw( &pot, purchase_revenue, WithdrawReasons::FEE, @@ -824,7 +801,7 @@ fn pot_account_is_immortal() { assert!(purchase_revenue > 0); run_to_block(25, |_| None); - let _imb = ::Currency::withdraw( + let _imb = ::Currency::withdraw( &pot, purchase_revenue, WithdrawReasons::FEE, diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/types.rs b/polkadot/runtime/parachains/src/on_demand/types.rs similarity index 99% rename from polkadot/runtime/parachains/src/assigner_on_demand/types.rs rename to polkadot/runtime/parachains/src/on_demand/types.rs index 96367b971fed..c87e7abaf860 100644 --- a/polkadot/runtime/parachains/src/assigner_on_demand/types.rs +++ b/polkadot/runtime/parachains/src/on_demand/types.rs @@ -116,7 +116,7 @@ impl QueueStatusType { pub fn consume_index(&mut self, removed_index: QueueIndex) { if removed_index != self.smallest_index { self.freed_indices.push(removed_index.reverse()); - return; + return } let mut index = self.smallest_index.0.overflowing_add(1).0; // Even more to advance? diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 5adffbd7422f..1c81801075f8 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -53,14 +53,14 @@ use polkadot_runtime_common::{ BlockHashCount, BlockLength, SlowAdjustingFeeUpdate, }; use polkadot_runtime_parachains::{ - assigner_coretime as parachains_assigner_coretime, - assigner_on_demand as parachains_assigner_on_demand, configuration as parachains_configuration, + assigner_coretime as parachains_assigner_coretime, configuration as parachains_configuration, configuration::ActiveConfigHrmpChannelSizeAndCapacityRatio, coretime, disputes as parachains_disputes, disputes::slashing as parachains_slashing, dmp as parachains_dmp, hrmp as parachains_hrmp, inclusion as parachains_inclusion, inclusion::{AggregateMessageOrigin, UmpQueueId}, - initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras, + initializer as parachains_initializer, on_demand as parachains_on_demand, + origin as parachains_origin, paras as parachains_paras, paras_inherent as parachains_paras_inherent, runtime_api_impl::{ v10 as parachains_runtime_api_impl, vstaging as vstaging_parachains_runtime_api_impl, @@ -1096,11 +1096,11 @@ parameter_types! { pub const OnDemandPalletId: PalletId = PalletId(*b"py/ondmd"); } -impl parachains_assigner_on_demand::Config for Runtime { +impl parachains_on_demand::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type TrafficDefaultValue = OnDemandTrafficDefaultValue; - type WeightInfo = weights::runtime_parachains_assigner_on_demand::WeightInfo; + type WeightInfo = weights::runtime_parachains_on_demand::WeightInfo; type MaxHistoricalRevenue = MaxHistoricalRevenue; type PalletId = OnDemandPalletId; } @@ -1485,7 +1485,7 @@ construct_runtime! { ParasDisputes: parachains_disputes = 62, ParasSlashing: parachains_slashing = 63, MessageQueue: pallet_message_queue = 64, - OnDemandAssignmentProvider: parachains_assigner_on_demand = 66, + OnDemandAssignmentProvider: parachains_on_demand = 66, CoretimeAssignmentProvider: parachains_assigner_coretime = 68, // Parachain Onboarding Pallets. Start indices at 70 to leave room. @@ -1666,7 +1666,7 @@ pub mod migrations { // This needs to come after the `parachains_configuration` above as we are reading the configuration. coretime::migration::MigrateToCoretime, parachains_configuration::migration::v12::MigrateToV12, - parachains_assigner_on_demand::migration::MigrateV0ToV1, + parachains_on_demand::migration::MigrateV0ToV1, // permanent pallet_xcm::migration::MigrateToLatestXcmVersion, diff --git a/polkadot/runtime/rococo/src/weights/mod.rs b/polkadot/runtime/rococo/src/weights/mod.rs index 3c6845dfb43e..cd6e5bbc6932 100644 --- a/polkadot/runtime/rococo/src/weights/mod.rs +++ b/polkadot/runtime/rococo/src/weights/mod.rs @@ -49,13 +49,13 @@ pub mod runtime_common_crowdloan; pub mod runtime_common_identity_migrator; pub mod runtime_common_paras_registrar; pub mod runtime_common_slots; -pub mod runtime_parachains_assigner_on_demand; pub mod runtime_parachains_configuration; pub mod runtime_parachains_coretime; pub mod runtime_parachains_disputes; pub mod runtime_parachains_hrmp; pub mod runtime_parachains_inclusion; pub mod runtime_parachains_initializer; +pub mod runtime_parachains_on_demand; pub mod runtime_parachains_paras; pub mod runtime_parachains_paras_inherent; pub mod xcm; diff --git a/polkadot/runtime/rococo/src/weights/runtime_parachains_assigner_on_demand.rs b/polkadot/runtime/rococo/src/weights/runtime_parachains_on_demand.rs similarity index 93% rename from polkadot/runtime/rococo/src/weights/runtime_parachains_assigner_on_demand.rs rename to polkadot/runtime/rococo/src/weights/runtime_parachains_on_demand.rs index abcc1893c29b..0c36eeaf7d45 100644 --- a/polkadot/runtime/rococo/src/weights/runtime_parachains_assigner_on_demand.rs +++ b/polkadot/runtime/rococo/src/weights/runtime_parachains_on_demand.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_parachains::assigner_on_demand` +//! Autogenerated weights for `runtime_parachains::on_demand` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -32,7 +32,7 @@ // --wasm-execution=compiled // --heap-pages=4096 // --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json -// --pallet=runtime_parachains::assigner_on_demand +// --pallet=runtime_parachains::on_demand // --chain=rococo-dev // --header=./polkadot/file_header.txt // --output=./polkadot/runtime/rococo/src/weights/ @@ -45,9 +45,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_parachains::assigner_on_demand`. +/// Weight functions for `runtime_parachains::on_demand`. pub struct WeightInfo(PhantomData); -impl polkadot_runtime_parachains::assigner_on_demand::WeightInfo for WeightInfo { +impl polkadot_runtime_parachains::on_demand::WeightInfo for WeightInfo { /// Storage: `OnDemandAssignmentProvider::QueueStatus` (r:1 w:1) /// Proof: `OnDemandAssignmentProvider::QueueStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index f0b16e731d9e..abe63737447a 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -68,14 +68,14 @@ use polkadot_runtime_common::{ U256ToBalance, }; use polkadot_runtime_parachains::{ - assigner_coretime as parachains_assigner_coretime, - assigner_on_demand as parachains_assigner_on_demand, configuration as parachains_configuration, + assigner_coretime as parachains_assigner_coretime, configuration as parachains_configuration, configuration::ActiveConfigHrmpChannelSizeAndCapacityRatio, coretime, disputes as parachains_disputes, disputes::slashing as parachains_slashing, dmp as parachains_dmp, hrmp as parachains_hrmp, inclusion as parachains_inclusion, inclusion::{AggregateMessageOrigin, UmpQueueId}, - initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras, + initializer as parachains_initializer, on_demand as parachains_on_demand, + origin as parachains_origin, paras as parachains_paras, paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points, runtime_api_impl::{ v10 as parachains_runtime_api_impl, vstaging as vstaging_parachains_runtime_api_impl, @@ -1229,11 +1229,11 @@ parameter_types! { pub const OnDemandPalletId: PalletId = PalletId(*b"py/ondmd"); } -impl parachains_assigner_on_demand::Config for Runtime { +impl parachains_on_demand::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type TrafficDefaultValue = OnDemandTrafficDefaultValue; - type WeightInfo = weights::runtime_parachains_assigner_on_demand::WeightInfo; + type WeightInfo = weights::runtime_parachains_on_demand::WeightInfo; type MaxHistoricalRevenue = MaxHistoricalRevenue; type PalletId = OnDemandPalletId; } @@ -1585,7 +1585,7 @@ mod runtime { #[runtime::pallet_index(54)] pub type ParasSlashing = parachains_slashing; #[runtime::pallet_index(56)] - pub type OnDemandAssignmentProvider = parachains_assigner_on_demand; + pub type OnDemandAssignmentProvider = parachains_on_demand; #[runtime::pallet_index(57)] pub type CoretimeAssignmentProvider = parachains_assigner_coretime; @@ -1743,7 +1743,7 @@ mod benches { [polkadot_runtime_parachains::initializer, Initializer] [polkadot_runtime_parachains::paras, Paras] [polkadot_runtime_parachains::paras_inherent, ParaInherent] - [polkadot_runtime_parachains::assigner_on_demand, OnDemandAssignmentProvider] + [polkadot_runtime_parachains::on_demand, OnDemandAssignmentProvider] [polkadot_runtime_parachains::coretime, Coretime] // Substrate [pallet_bags_list, VoterList] diff --git a/polkadot/runtime/westend/src/weights/mod.rs b/polkadot/runtime/westend/src/weights/mod.rs index f6a9008d7187..130735644e0a 100644 --- a/polkadot/runtime/westend/src/weights/mod.rs +++ b/polkadot/runtime/westend/src/weights/mod.rs @@ -48,7 +48,6 @@ pub mod runtime_common_crowdloan; pub mod runtime_common_identity_migrator; pub mod runtime_common_paras_registrar; pub mod runtime_common_slots; -pub mod runtime_parachains_assigner_on_demand; pub mod runtime_parachains_configuration; pub mod runtime_parachains_coretime; pub mod runtime_parachains_disputes; @@ -56,6 +55,7 @@ pub mod runtime_parachains_disputes_slashing; pub mod runtime_parachains_hrmp; pub mod runtime_parachains_inclusion; pub mod runtime_parachains_initializer; +pub mod runtime_parachains_on_demand; pub mod runtime_parachains_paras; pub mod runtime_parachains_paras_inherent; pub mod xcm; diff --git a/polkadot/runtime/westend/src/weights/runtime_parachains_assigner_on_demand.rs b/polkadot/runtime/westend/src/weights/runtime_parachains_on_demand.rs similarity index 93% rename from polkadot/runtime/westend/src/weights/runtime_parachains_assigner_on_demand.rs rename to polkadot/runtime/westend/src/weights/runtime_parachains_on_demand.rs index 1bd9fa31b81b..fc7efa6edfcf 100644 --- a/polkadot/runtime/westend/src/weights/runtime_parachains_assigner_on_demand.rs +++ b/polkadot/runtime/westend/src/weights/runtime_parachains_on_demand.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_parachains::assigner_on_demand` +//! Autogenerated weights for `runtime_parachains::on_demand` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -32,7 +32,7 @@ // --wasm-execution=compiled // --heap-pages=4096 // --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json -// --pallet=runtime_parachains::assigner_on_demand +// --pallet=runtime_parachains::on_demand // --chain=westend-dev // --header=./polkadot/file_header.txt // --output=./polkadot/runtime/westend/src/weights/ @@ -45,9 +45,9 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -/// Weight functions for `runtime_parachains::assigner_on_demand`. +/// Weight functions for `runtime_parachains::on_demand`. pub struct WeightInfo(PhantomData); -impl polkadot_runtime_parachains::assigner_on_demand::WeightInfo for WeightInfo { +impl polkadot_runtime_parachains::on_demand::WeightInfo for WeightInfo { /// Storage: `OnDemandAssignmentProvider::QueueStatus` (r:1 w:1) /// Proof: `OnDemandAssignmentProvider::QueueStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) diff --git a/prdoc/pr_4706.prdoc b/prdoc/pr_4706.prdoc new file mode 100644 index 000000000000..ab235768b10d --- /dev/null +++ b/prdoc/pr_4706.prdoc @@ -0,0 +1,17 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: "Rename `assigner_on_demand` pallet to `on_demand`" + +doc: + - audience: Runtime Dev + description: | + Renames `assigner_on_demand` pallet to `on_demand` + +crates: +- name: polkadot-runtime-parachains + bump: major +- name: rococo-runtime + bump: patch +- name: westend-runtime + bump: patch \ No newline at end of file