Skip to content

Commit

Permalink
Don't drop leases with holes.
Browse files Browse the repository at this point in the history
  • Loading branch information
eskimor committed Jul 26, 2024
1 parent 867b9ba commit 2a46b56
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1857,21 +1857,6 @@ pub mod migrations {
if lease.is_empty() {
return None
}
// Lease not yet started/or having holes, refund (coretime can't handle this):
if lease.iter().any(Option::is_none) {
if let Err(err) = slots::Pallet::<Runtime>::clear_all_leases(
frame_system::RawOrigin::Root.into(),
para,
) {
log::error!(
target: "runtime",
"Clearing lease for para: {:?} failed, with error: {:?}",
para,
err
);
};
return None
}
let (index, _) =
<slots::Pallet<Runtime> as Leaser<BlockNumber>>::lease_period_index(now)?;
Some(index.saturating_add(lease.len() as u32).saturating_mul(LeasePeriod::get()))
Expand Down

0 comments on commit 2a46b56

Please sign in to comment.