Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,24 @@ where
max_pov_percentage,
} = params;

// Wait for the Aura runtime API to become available.
// During warp sync, the runtime is not yet ready.
loop {
let best_hash = para_client.usage_info().chain.best_hash;
if para_client
.runtime_api()
.has_api::<dyn AuraApi<Block, P::Public>>(best_hash)
.unwrap_or(false)
{
break;
}
tracing::info!(
target: LOG_TARGET,
"Aura runtime API not yet available. Waiting..."
);
tokio::time::sleep(Duration::from_secs(2)).await;
}
Comment thread
clangenb marked this conversation as resolved.
Outdated

let mut slot_timer = SlotTimer::<_, _, P>::new_with_offset(
para_client.clone(),
slot_offset,
Expand Down Expand Up @@ -201,8 +219,9 @@ where
loop {
// We wait here until the next slot arrives.
if slot_timer.wait_until_next_slot().await.is_err() {
tracing::error!(target: LOG_TARGET, "Unable to wait for next slot.");
return;
tracing::warn!(target: LOG_TARGET, "Unable to wait for next slot, retrying...");
tokio::time::sleep(Duration::from_secs(1)).await;
continue;
};

let Ok(relay_best_hash) = relay_client.best_block_hash().await else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ where
let slot_duration = match crate::slot_duration(&*self.client) {
Ok(d) => d,
Err(error) => {
tracing::error!(target: LOG_TARGET, %error, "Failed to fetch slot duration from runtime.");
tracing::warn!(target: LOG_TARGET, %error, "Failed to fetch slot duration from runtime.");
return Err(());
},
};
Expand Down
Loading