referrerpolicy=no-referrer-when-downgrade

Function spawn_parachain_consensus_tasks

Source
pub fn spawn_parachain_consensus_tasks<P, R, Block, B, S>(
    para_id: Id,
    parachain: Arc<P>,
    relay_chain: R,
    announce_block: Arc<dyn Fn(Block::Hash, Option<Vec<u8>>) + Send + Sync>,
    recovery_chan_tx: Option<Sender<RecoveryRequest<Block>>>,
    spawn_handle: S,
)
where Block: BlockT, P: Finalizer<Block, B> + UsageProvider<Block> + Send + Sync + BlockBackend<Block> + BlockchainEvents<Block> + 'static, for<'a> &'a P: BlockImport<Block>, R: RelayChainInterface + Clone + 'static, S: SpawnEssentialNamed + 'static, B: Backend<Block> + 'static,
Expand description

Spawns the essential finalization tasks for parachain consensus.

This function creates and spawns two critical background tasks:

  1. A finalized head stream worker that monitors relay chain finality and extracts included headers
  2. The main parachain consensus task that handles finalization and best block updates