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

polkadot-node-collation-generation

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

11 major breaking releases

11.0.0 Apr 10, 2024
10.0.0 Mar 19, 2024
9.0.0 Feb 27, 2024
8.0.0 Feb 13, 2024
0.0.0 Nov 21, 2022

#49 in Magic Beans

Download history 155/week @ 2024-01-02 181/week @ 2024-01-09 106/week @ 2024-01-16 180/week @ 2024-01-23 107/week @ 2024-01-30 350/week @ 2024-02-06 331/week @ 2024-02-13 558/week @ 2024-02-20 974/week @ 2024-02-27 401/week @ 2024-03-05 451/week @ 2024-03-12 947/week @ 2024-03-19 769/week @ 2024-03-26 739/week @ 2024-04-02 800/week @ 2024-04-09 433/week @ 2024-04-16

2,982 downloads per month
Used in 10 crates (2 directly)

GPL-3.0-only

68KB
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

~71–115MB
~2M SLoC