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 and Krayt78 committed Dec 18, 2024
1 parent 24c9cf1 commit 5164741
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 5164741

Please sign in to comment.