From cd43b0a8de686bf96a9a3d00864d684be348e176 Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Fri, 2 Feb 2024 13:45:13 +0200 Subject: [PATCH 1/3] Fix `test_migrate_to_v11` in `HostConfig` migrations --- .../parachains/src/configuration/migration/v11.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/polkadot/runtime/parachains/src/configuration/migration/v11.rs b/polkadot/runtime/parachains/src/configuration/migration/v11.rs index f4db9196b1a0..a69061ac1381 100644 --- a/polkadot/runtime/parachains/src/configuration/migration/v11.rs +++ b/polkadot/runtime/parachains/src/configuration/migration/v11.rs @@ -253,7 +253,7 @@ mod tests { new_test_ext(Default::default()).execute_with(|| { // Implant the v10 version in the state. - v10::ActiveConfig::::set(Some(v10)); + v10::ActiveConfig::::set(Some(v10.clone())); v10::PendingConfigs::::set(Some(pending_configs)); migrate_to_v11::(); @@ -264,7 +264,7 @@ mod tests { let mut configs_to_check = v11::PendingConfigs::::get().unwrap(); configs_to_check.push((0, v11.clone())); - for (_, v10) in configs_to_check { + for (_, v11) in configs_to_check { #[rustfmt::skip] { assert_eq!(v10.max_code_size , v11.max_code_size); @@ -286,7 +286,7 @@ mod tests { assert_eq!(v10.hrmp_max_parachain_inbound_channels , v11.hrmp_max_parachain_inbound_channels); assert_eq!(v10.hrmp_channel_max_message_size , v11.hrmp_channel_max_message_size); assert_eq!(v10.code_retention_period , v11.code_retention_period); - assert_eq!(v10.coretime_cores , v11.coretime_cores); + assert_eq!(v10.on_demand_cores , v11.coretime_cores); assert_eq!(v10.on_demand_retries , v11.on_demand_retries); assert_eq!(v10.group_rotation_frequency , v11.group_rotation_frequency); assert_eq!(v10.paras_availability_period , v11.paras_availability_period); @@ -303,8 +303,8 @@ mod tests { assert_eq!(v10.minimum_validation_upgrade_delay , v11.minimum_validation_upgrade_delay); assert_eq!(v10.async_backing_params.allowed_ancestry_len, v11.async_backing_params.allowed_ancestry_len); assert_eq!(v10.async_backing_params.max_candidate_depth , v11.async_backing_params.max_candidate_depth); - assert_eq!(v10.executor_params , v11.executor_params); - assert_eq!(v10.minimum_backing_votes , v11.minimum_backing_votes); + assert_eq!(v10.executor_params , v11.executor_params); + assert_eq!(v10.minimum_backing_votes , v11.minimum_backing_votes); }; // ; makes this a statement. `rustfmt::skip` cannot be put on an expression. } }); From b9023b98b535532f5cf65b551e94e34908654642 Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Fri, 2 Feb 2024 13:45:29 +0200 Subject: [PATCH 2/3] Fix an outdated comment --- polkadot/runtime/parachains/src/scheduler.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/polkadot/runtime/parachains/src/scheduler.rs b/polkadot/runtime/parachains/src/scheduler.rs index a666f5689089..673e23322905 100644 --- a/polkadot/runtime/parachains/src/scheduler.rs +++ b/polkadot/runtime/parachains/src/scheduler.rs @@ -145,9 +145,7 @@ pub mod pallet { pub(crate) type SessionStartBlock = StorageValue<_, BlockNumberFor, ValueQuery>; /// One entry for each availability core. The `VecDeque` represents the assignments to be - /// scheduled on that core. `None` is used to signal to not schedule the next para of the core - /// as there is one currently being scheduled. Not using `None` here would overwrite the - /// `CoreState` in the runtime API. The value contained here will not be valid after the end of + /// scheduled on that core. The value contained here will not be valid after the end of /// a block. Runtime APIs should be used to determine scheduled cores/ for the upcoming block. #[pallet::storage] #[pallet::getter(fn claimqueue)] From e3cbcfa99d58d2b56462324d1a701c2ab898fdf0 Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Fri, 2 Feb 2024 13:55:27 +0200 Subject: [PATCH 3/3] Fix some typos --- polkadot/runtime/parachains/src/configuration/tests.rs | 6 +++--- polkadot/runtime/parachains/src/coretime/migration.rs | 2 +- polkadot/runtime/parachains/src/scheduler.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/polkadot/runtime/parachains/src/configuration/tests.rs b/polkadot/runtime/parachains/src/configuration/tests.rs index c915eb12a0ca..f1570017dd7b 100644 --- a/polkadot/runtime/parachains/src/configuration/tests.rs +++ b/polkadot/runtime/parachains/src/configuration/tests.rs @@ -38,7 +38,7 @@ fn default_is_consistent() { fn scheduled_session_is_two_sessions_from_now() { new_test_ext(Default::default()).execute_with(|| { // The logic here is really tested only with scheduled_session = 2. It should work - // with other values, but that should receive a more rigorious testing. + // with other values, but that should receive a more rigorous testing. on_new_session(1); assert_eq!(Configuration::scheduled_session(), 3); }); @@ -136,7 +136,7 @@ fn pending_next_session_but_we_upgrade_once_more() { // update. assert_ok!(Configuration::set_validation_upgrade_cooldown(RuntimeOrigin::root(), 99)); - // This should result in yet another configiguration change scheduled. + // This should result in yet another configuration change scheduled. assert_eq!(Configuration::config(), initial_config); assert_eq!( PendingConfigs::::get(), @@ -179,7 +179,7 @@ fn scheduled_session_config_update_while_next_session_pending() { assert_ok!(Configuration::set_validation_upgrade_cooldown(RuntimeOrigin::root(), 99)); assert_ok!(Configuration::set_code_retention_period(RuntimeOrigin::root(), 98)); - // This should result in yet another configiguration change scheduled. + // This should result in yet another configuration change scheduled. assert_eq!(Configuration::config(), initial_config); assert_eq!( PendingConfigs::::get(), diff --git a/polkadot/runtime/parachains/src/coretime/migration.rs b/polkadot/runtime/parachains/src/coretime/migration.rs index e64d3fbd6a9e..9bc0a20ef5b4 100644 --- a/polkadot/runtime/parachains/src/coretime/migration.rs +++ b/polkadot/runtime/parachains/src/coretime/migration.rs @@ -74,7 +74,7 @@ mod v_coretime { loop { match sp_io::storage::next_key(&next_key) { - // StorageVersion is initialized before, so we need to ingore it. + // StorageVersion is initialized before, so we need to ignore it. Some(key) if &key == &storage_version_key => { next_key = key; }, diff --git a/polkadot/runtime/parachains/src/scheduler.rs b/polkadot/runtime/parachains/src/scheduler.rs index 673e23322905..3dbb050fb4e5 100644 --- a/polkadot/runtime/parachains/src/scheduler.rs +++ b/polkadot/runtime/parachains/src/scheduler.rs @@ -114,7 +114,7 @@ pub mod pallet { Paras(ParasEntry), } - /// Conveninece type alias for `CoreOccupied`. + /// Convenience type alias for `CoreOccupied`. pub type CoreOccupiedType = CoreOccupied>; impl CoreOccupied {