Refactory of next_slot method (#13155)

Refactory of `next_slot` method

* Prevents slot worker exit if inherent data provider creation fails
* Failure is not possible anymore
* Fix potential failure after warp-sync where block headers of not already downloaded blocks are used by the inherent data provider
This commit is contained in:
Davide Galassi
2023-01-17 16:55:11 +01:00
committed by GitHub
parent cbcde28546
commit 09ddb37315
2 changed files with 34 additions and 33 deletions
+1 -7
View File
@@ -524,13 +524,7 @@ pub async fn start_slot_worker<B, C, W, SO, CIDP, Proof>(
let mut slots = Slots::new(slot_duration.as_duration(), create_inherent_data_providers, client);
loop {
let slot_info = match slots.next_slot().await {
Ok(r) => r,
Err(e) => {
warn!(target: LOG_TARGET, "Error while polling for next slot: {}", e);
return
},
};
let slot_info = slots.next_slot().await;
if sync_oracle.is_major_syncing() {
debug!(target: LOG_TARGET, "Skipping proposal slot due to sync.");