#consensus-algorithm #chain #parachain #relay #block #collator #relay-chain

cumulus-client-consensus-relay-chain

The relay-chain provided consensus algorithm (polkadot v1.12.0)

12 breaking releases

new 0.13.0 May 24, 2024
0.11.0 Apr 10, 2024
0.10.0 Mar 19, 2024
0.6.0 Dec 13, 2023
0.0.0 Nov 14, 2022

#2453 in Magic Beans

Download history 9/week @ 2024-02-05 29/week @ 2024-02-12 157/week @ 2024-02-19 222/week @ 2024-02-26 5/week @ 2024-03-04 26/week @ 2024-03-11 200/week @ 2024-03-18 40/week @ 2024-03-25 23/week @ 2024-04-01 164/week @ 2024-04-08 13/week @ 2024-04-15 40/week @ 2024-04-22 207/week @ 2024-04-29 113/week @ 2024-05-06 50/week @ 2024-05-13 255/week @ 2024-05-20

628 downloads per month
Used in polkadot-parachain-bin

GPL-3.0-or-later…

18KB
280 lines

The relay-chain provided consensus algorithm for parachains.

This is the simplest consensus algorithm you can use when developing a parachain. It is a permission-less consensus algorithm that doesn't require any staking or similar to join as a collator. In this algorithm the consensus is provided by the relay-chain. This works in the following way.

  1. Each node that sees itself as a collator is free to build a parachain candidate.

  2. This parachain candidate is send to the parachain validators that are part of the relay chain.

  3. The parachain validators validate at most X different parachain candidates, where X is the total number of parachain validators.

  4. The parachain candidate that is backed by the most validators is chosen by the relay-chain block producer to be added as backed candidate on chain.

  5. After the parachain candidate got backed and included, all collators start at 1.

Dependencies

~94–135MB
~2.5M SLoC