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

polkadot-node-collation-generation

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

13 major breaking releases

13.0.0 May 24, 2024
12.0.0 May 1, 2024
11.0.0 Apr 10, 2024
10.0.0 Mar 19, 2024
0.0.0 Nov 21, 2022

#268 in Magic Beans

Download history 329/week @ 2024-02-14 723/week @ 2024-02-21 867/week @ 2024-02-28 333/week @ 2024-03-06 583/week @ 2024-03-13 876/week @ 2024-03-20 946/week @ 2024-03-27 538/week @ 2024-04-03 767/week @ 2024-04-10 560/week @ 2024-04-17 469/week @ 2024-04-24 683/week @ 2024-05-01 456/week @ 2024-05-08 837/week @ 2024-05-15 777/week @ 2024-05-22 742/week @ 2024-05-29

2,934 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