Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 10 additions & 3 deletions cumulus/polkadot-omni-node/lib/src/nodes/aura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,16 @@ where
max_pov_percentage: node_extra_args.max_pov_percentage,
};

// We have a separate function only to be able to use `docify::export` on this piece of
// code.
Self::launch_slot_based_collator(params);
let wait_client = client.clone();
let fut = async move {
wait_for_aura::<Block, RuntimeApi, AuraId>(wait_client).await;
// We have a separate function only to be able to use `docify::export` on this
// piece of code.
Self::launch_slot_based_collator(params);
};
task_manager
.spawn_essential_handle()
.spawn("slot-based-collator-init", None, fut);

Ok(())
}
Expand Down
23 changes: 23 additions & 0 deletions prdoc/pr_11381.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
title: Fix slot-based collator panic during warp sync (#11072)
doc:
- audience: Node Dev
description: |-
When a parachain collator starts with `--authoring=slot-based` and performs warp sync, the `slot-based-block-builder` essential task immediately calls `slot_duration()` which requires `AuraApi_slot_duration`. During warp sync the runtime isn't ready, so this fails and the task returns, shutting down the node.

The lookahead collator avoids this by calling `wait_for_aura()` before starting. This PR adds an equivalent guard to the slot-based collator.

### Manual test
Before the fix the collator panicked after the relay chain warp sync with AuraApi_slot_duration not available, which does not occur anymore now.
```
./target/release/polkadot-parachain \
--chain asset-hub-polkadot \
--sync warp \
--authoring=slot-based \
--tmp -- --sync warp
```
Closes #11072.
crates:
- name: cumulus-client-consensus-aura
bump: patch
- name: polkadot-omni-node-lib
bump: patch
Loading