Skip to content

Commit

Permalink
Only mess with coretime if we are registering an actual parachain. (p…
Browse files Browse the repository at this point in the history
…aritytech#6554)

Co-authored-by: Robert <[email protected]>
Co-authored-by: ordian <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent 7c5224c commit 08ec8cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions polkadot/runtime/common/src/paras_sudo_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub use pallet::*;
use polkadot_primitives::Id as ParaId;
use polkadot_runtime_parachains::{
configuration, dmp, hrmp,
paras::{self, AssignCoretime, ParaGenesisArgs},
paras::{self, AssignCoretime, ParaGenesisArgs, ParaKind},
ParaLifecycle,
};

Expand Down Expand Up @@ -80,10 +80,15 @@ pub mod pallet {
genesis: ParaGenesisArgs,
) -> DispatchResult {
ensure_root(origin)?;

let assign_coretime = genesis.para_kind == ParaKind::Parachain;

polkadot_runtime_parachains::schedule_para_initialize::<T>(id, genesis)
.map_err(|_| Error::<T>::ParaAlreadyExists)?;

T::AssignCoretime::assign_coretime(id)?;
if assign_coretime {
T::AssignCoretime::assign_coretime(id)?;
}

Ok(())
}
Expand Down

0 comments on commit 08ec8cd

Please sign in to comment.