domain_client_consensus_relay_chain/
lib.rs

1// Copyright 2021 Parity Technologies (UK) Ltd.
2// This file is part of Cumulus.
3
4// Cumulus is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Cumulus is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Cumulus.  If not, see <http://www.gnu.org/licenses/>.
16
17//! The relay-chain provided consensus algorithm for parachains.
18//!
19//! This is the simplest consensus algorithm you can use when developing a parachain. It is a
20//! permission-less consensus algorithm that doesn't require any staking or similar to join as a
21//! collator. In this algorithm the consensus is provided by the relay-chain. This works in the
22//! following way.
23//!
24//! 1. Each node that sees itself as a collator is free to build a parachain candidate.
25//!
26//! 2. This parachain candidate is send to the parachain validators that are part of the relay chain.
27//!
28//! 3. The parachain validators validate at most X different parachain candidates, where X is the
29//!    total number of parachain validators.
30//!
31//! 4. The parachain candidate that is backed by the most validators is chosen by the relay-chain
32//!    block producer to be added as backed candidate on chain.
33//!
34//! 5. After the parachain candidate got backed and included, all collators start at 1.
35
36mod import_queue;
37
38pub use import_queue::Verifier;