referrerpolicy=no-referrer-when-downgrade
cumulus_client_consensus_aura::collators

Module slot_based

Source
Expand description

§Architecture Overview

The block building mechanism operates through two coordinated tasks:

  1. Block Builder Task: Orchestrates the timing and execution of parachain block production
  2. Collator Task: Processes built blocks into collations for relay chain submission

§Block Builder Task Details

The block builder task manages block production timing and execution through an iterative process:

  1. Awaits the next production signal from the internal timer
  2. Retrieves the current best relay chain block and identifies a valid parent block (see find_potential_parents for parent selection criteria)
  3. Validates that:
    • The parachain has an assigned core on the relay chain
    • No block has been previously built on the target core
  4. Executes block building and import operations
  5. Transmits the completed block to the collator task

§Block Production Timing

When a block is produced is determined by the following parameters:

  • Parachain slot duration
  • Number of assigned parachain cores
  • Parachain runtime configuration

§Timing Examples

The following table demonstrates various timing configurations and their effects. The “AURA Slot” column shows which author is responsible for the block.

Slot Duration (ms)CoresProduction Attempts (ms)AURA Slot
200030, 2000, 4000, 60000, 1, 2, 3
600010, 6000, 12000, 180000, 1, 2, 3
600030, 2000, 4000, 60000, 0, 0, 1
1200010, 6000, 12000, 180000, 0, 1, 1
1200030, 2000, 4000, 60000, 0, 0, 0

§Collator Task Details

The collator task receives built blocks from the block builder task and performs two primary functions:

  1. Block compression
  2. Submission to the collation-generation subsystem

Structs§

Functions§

  • Run aura-based block building and collation task.