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

cumulus-client-consensus-relay-chain

The relay-chain provided consensus algorithm

18 breaking releases

new 0.21.0 Jan 29, 2025
0.18.0 Oct 1, 2024
0.17.0 Jul 19, 2024
0.10.0 Mar 19, 2024
0.0.0 Nov 14, 2022

#352 in Magic Beans

Download history 62/week @ 2024-10-10 92/week @ 2024-10-17 16/week @ 2024-10-24 57/week @ 2024-10-31 84/week @ 2024-11-07 67/week @ 2024-11-14 92/week @ 2024-11-21 78/week @ 2024-11-28 98/week @ 2024-12-05 125/week @ 2024-12-12 63/week @ 2024-12-19 36/week @ 2024-12-26 49/week @ 2025-01-02 183/week @ 2025-01-09 121/week @ 2025-01-16 212/week @ 2025-01-23

574 downloads per month
Used in 5 crates (4 directly)

GPL-3.0-or-later…

62KB
280 lines

Release

Polkadot SDK Stable 2412


lib.rs:

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

~99–140MB
~2.5M SLoC