#collation #subsystem #generation #polkadot #candidate #validation #receipt

polkadot-node-collation-generation

Collator-side subsystem that handles incoming candidate submissions from the parachain. (polkadot v1.11.0)

12 major breaking releases

12.0.0 May 1, 2024
11.0.0 Apr 10, 2024
10.0.0 Mar 19, 2024
9.0.0 Feb 27, 2024
0.0.0 Nov 21, 2022

#152 in Magic Beans

Download history 138/week @ 2024-01-25 171/week @ 2024-02-01 352/week @ 2024-02-08 354/week @ 2024-02-15 852/week @ 2024-02-22 724/week @ 2024-02-29 333/week @ 2024-03-07 650/week @ 2024-03-14 863/week @ 2024-03-21 931/week @ 2024-03-28 810/week @ 2024-04-04 514/week @ 2024-04-11 517/week @ 2024-04-18 567/week @ 2024-04-25 597/week @ 2024-05-02 442/week @ 2024-05-09

2,241 downloads per month
Used in 11 crates (2 directly)

GPL-3.0-only

71KB
1.5K SLoC

The collation generation subsystem is the interface between polkadot and the collators.

Protocol

On every ActiveLeavesUpdate:

  • If there is no collation generation config, ignore.
  • Otherwise, for each activated head in the update:
    • Determine if the para is scheduled on any core by fetching the availability_cores Runtime API.
    • Use the Runtime API subsystem to fetch the full validation data.
    • Invoke the collator, and use its outputs to produce a CandidateReceipt, signed with the configuration's key.
    • Dispatch a CollatorProtocolMessage::DistributeCollation(receipt, pov).

Dependencies

~92–135MB
~2.5M SLoC