mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 05:11:02 +00:00
paras: unblock offboarding when pvf-check concludes (#6032)
* Unblock offboarding for upgrading paras * ".git/.scripts/fmt.sh" 1 Co-authored-by: command-bot <>
This commit is contained in:
@@ -1570,15 +1570,21 @@ impl<T: Config> Pallet<T> {
|
||||
///
|
||||
/// No-op if para is not registered at all.
|
||||
pub(crate) fn schedule_para_cleanup(id: ParaId) -> DispatchResult {
|
||||
// Disallow offboarding in case there is an upcoming upgrade.
|
||||
// Disallow offboarding in case there is a PVF pre-checking in progress.
|
||||
//
|
||||
// This is not a fundamential limitation but rather simplification: it allows us to get
|
||||
// away without introducing additional logic for pruning and, more importantly, enacting
|
||||
// ongoing PVF pre-checking votes. It also removes some nasty edge cases.
|
||||
//
|
||||
// However, an upcoming upgrade on its own imposes no restrictions. An upgrade is enacted
|
||||
// with a new para head, so if a para never progresses we still should be able to offboard it.
|
||||
//
|
||||
// This implicitly assumes that the given para exists, i.e. it's lifecycle != None.
|
||||
if FutureCodeHash::<T>::contains_key(&id) {
|
||||
return Err(Error::<T>::CannotOffboard.into())
|
||||
if let Some(future_code_hash) = FutureCodeHash::<T>::get(&id) {
|
||||
let active_prechecking = PvfActiveVoteList::<T>::get();
|
||||
if active_prechecking.contains(&future_code_hash) {
|
||||
return Err(Error::<T>::CannotOffboard.into())
|
||||
}
|
||||
}
|
||||
|
||||
let lifecycle = ParaLifecycles::<T>::get(&id);
|
||||
|
||||
Reference in New Issue
Block a user