Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 69cc7f2

Browse files
authored
Fix ClaimQueue case of nothing scheduled on session boundary (paritytech#4065)
Same issue but about av-cores was fixed in paritytech#1403 Signed-off-by: Andrei Sandu <[email protected]>
1 parent 643aa2b commit 69cc7f2

File tree

1 file changed

+13
-1
lines changed
  • polkadot/runtime/parachains/src/runtime_api_impl

1 file changed

+13
-1
lines changed

polkadot/runtime/parachains/src/runtime_api_impl/vstaging.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,22 @@
1818
1919
use crate::scheduler;
2020
use primitives::{CoreIndex, Id as ParaId};
21-
use sp_std::collections::{btree_map::BTreeMap, vec_deque::VecDeque};
21+
use sp_runtime::traits::One;
22+
use sp_std::{
23+
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
24+
vec::Vec,
25+
};
2226

2327
/// Returns the claimqueue from the scheduler
2428
pub fn claim_queue<T: scheduler::Config>() -> BTreeMap<CoreIndex, VecDeque<ParaId>> {
29+
let now = <frame_system::Pallet<T>>::block_number() + One::one();
30+
31+
// This explicit update is only strictly required for session boundaries:
32+
//
33+
// At the end of a session we clear the claim queues: Without this update call, nothing would be
34+
// scheduled to the client.
35+
<scheduler::Pallet<T>>::free_cores_and_fill_claimqueue(Vec::new(), now);
36+
2537
scheduler::ClaimQueue::<T>::get()
2638
.into_iter()
2739
.map(|(core_index, entries)| {

0 commit comments

Comments
 (0)