Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only mess with coretime if we are registering an actual parachain. #6554

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)?;
eskimor marked this conversation as resolved.
Show resolved Hide resolved
if assign_coretime {
T::AssignCoretime::assign_coretime(id)?;
}

Ok(())
}
Expand Down
Loading