Skip to content

Commit 0661204

Browse files
committed
llms
1 parent bf6dfa0 commit 0661204

File tree

7 files changed

+161
-187
lines changed

7 files changed

+161
-187
lines changed

.ai/categories/parachains.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8414,8 +8414,8 @@ This architectural evolution promises to enhance Polkadot's scalability and flex
84148414

84158415
Page Title: Parachain Consensus
84168416

8417-
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-overview.md
8418-
- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/overview/
8417+
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus.md
8418+
- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/
84198419
- Summary: Understand how the blocks authored by parachain collators are secured by the relay chain validators and how the parachain transactions achieve finality.
84208420

84218421
# Parachain Consensus

.ai/categories/polkadot-protocol.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4956,8 +4956,8 @@ This architectural evolution promises to enhance Polkadot's scalability and flex
49564956

49574957
Page Title: Parachain Consensus
49584958

4959-
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-overview.md
4960-
- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/overview/
4959+
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus.md
4960+
- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/
49614961
- Summary: Understand how the blocks authored by parachain collators are secured by the relay chain validators and how the parachain transactions achieve finality.
49624962

49634963
# Parachain Consensus

.ai/pages/reference-parachains-consensus-overview.md

Lines changed: 0 additions & 149 deletions
This file was deleted.
Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,149 @@
11
---
2+
title: Parachain Consensus
3+
description: Understand how the blocks authored by parachain collators are secured by the relay chain validators and how the parachain transactions achieve finality.
4+
categories: Polkadot Protocol, Parachains
25
url: https://docs.polkadot.com/reference/parachains/consensus/
36
---
47

5-
TODO
8+
# Parachain Consensus
9+
10+
## Introduction
11+
12+
Parachains are independent blockchains built with the Polkadot SDK, designed to leverage Polkadot’s relay chain for shared security and transaction finality. These specialized chains operate as part of Polkadot’s execution sharding model, where each parachain manages its own state and transactions while relying on the relay chain for validation and consensus.
13+
14+
At the core of parachain functionality are collators, specialized nodes that sequence transactions into blocks and maintain the parachain’s state. Collators optimize Polkadot’s architecture by offloading state management from the relay chain, allowing relay chain validators to focus solely on validating parachain blocks.
15+
16+
This guide explores how parachain consensus works, including the roles of collators and validators, and the steps involved in securing parachain blocks within Polkadot’s scalable and decentralized framework.
17+
18+
## The Role of Collators
19+
20+
Collators are responsible for sequencing end-user transactions into blocks and maintaining the current state of their respective parachains. Their role is akin to Ethereum’s sequencers but optimized for Polkadot's architecture.
21+
22+
Key responsibilities include:
23+
24+
- **Transaction sequencing**: Organizing transactions into [Proof of Validity (PoV)](https://wiki.polkadot.com/general/glossary/#proof-of-validity){target=\_blank} blocks.
25+
- **State management**: Maintaining parachain states without burdening the relay chain validators.
26+
- **Consensus participation**: Sending PoV blocks to relay chain validators for approval.
27+
28+
## Consensus and Validation
29+
30+
Parachain consensus operates in tandem with the relay chain, leveraging [Nominated Proof of Stake (NPoS)](/reference/glossary/#nominated-proof-of-stake-npos){target=\_blank} for shared security. The process ensures parachain transactions achieve finality through the following steps:
31+
32+
1. **Packaging transactions**: Collators bundle transactions into PoV blocks (parablocks).
33+
2. **Submission to validator**: Parablocks are submitted to a randomly selected subset of relay chain validators, known as paravalidators.
34+
3. **Validation of PoV Blocks**: Paravalidators use the parachain’s state transition function (already available on the relay chain) to verify transaction validity.
35+
4. **Backing and inclusion**: If a sufficient number of positive validations are received, the parablock is backed and included via a para-header on the relay chain.
36+
37+
The following sections describe the actions taking place during each stage of the process.
38+
39+
### Path of a Parachain Block
40+
41+
Polkadot achieves scalability through execution sharding, where each parachain operates as an independent shard with its own blockchain and state. Shared security for all parachains is provided by the relay chain, powered by Nominated Proof of Stake (NPoS). This framework allows parachains to focus on transaction processing and state management, while the relay chain ensures validation and finality.
42+
43+
The journey of parachain transactions to reach consensus and finality can be described as follows:
44+
45+
- Collators and parablocks:
46+
47+
- Collators, specialized nodes on parachains, package transactions into Proof of Validity (PoV) blocks, also called parablocks.
48+
- These parablocks are sent to a subset of relay chain validators, known as paravalidators, for validation.
49+
- The parachain's state transition function (Wasm blob) is not re-sent, as it is already stored on the relay chain.
50+
51+
```mermaid
52+
flowchart TB
53+
%% Subgraph: Parachain
54+
subgraph Parachain
55+
direction LR
56+
Txs[Network Transactions]
57+
Collator[Collator Node]
58+
ParaBlock[ParaBlock + PoV]
59+
Txs -->|Package Transactions| Collator
60+
Collator -->|Create| ParaBlock
61+
end
62+
63+
subgraph Relay["Relay Chain"]
64+
ParaValidator
65+
end
66+
67+
%% Main Flow
68+
Parachain -->|Submit To| Relay
69+
```
70+
71+
- Validation by paravalidators:
72+
73+
- Paravalidators are groups of approximately five relay chain validators, randomly assigned to parachains and shuffled every minute.
74+
- Each paravalidator downloads the parachain's Wasm blob and validates the parablock by ensuring all transactions comply with the parachain’s state transition rules.
75+
- Paravalidators sign positive or negative validation statements based on the block’s validity.
76+
77+
- Backing and approval:
78+
79+
- If a parablock receives sufficient positive validation statements, it is backed and included on the relay chain as a para-header.
80+
- An additional approval process resolves disputes. If a parablock contains invalid transactions, additional validators are tasked with verification.
81+
- Validators who back invalid parablocks are penalized through slashing, creating strong incentives for honest behavior.
82+
83+
```mermaid
84+
flowchart
85+
subgraph RelayChain["Relay Chain"]
86+
direction TB
87+
subgraph InitialValidation["Initial Validation"]
88+
direction LR
89+
PValidators[ParaValidators]
90+
Backing[Backing<br>Process]
91+
Header[Submit Para-header<br>on Relay Chain]
92+
end
93+
subgraph Secondary["Secondary Validation"]
94+
Approval[Approval<br>Process]
95+
Dispute[Dispute<br>Resolution]
96+
Slashing[Slashing<br>Mechanism]
97+
end
98+
99+
end
100+
101+
102+
%% Validation Process
103+
PValidators -->|Download<br>Wasm<br>Validate Block| Backing
104+
Backing -->|If Valid<br>Signatures| Header
105+
InitialValidation -->|Additional<br>Verification| Secondary
106+
107+
%% Dispute Flow
108+
Approval -->|If Invalid<br>Detected| Dispute
109+
Dispute -->|Penalize<br>Dishonest<br>Validators| Slashing
110+
```
111+
112+
It is important to understand that relay chain blocks do not store full parachain blocks (parablocks). Instead, they include para-headers, which serve as summaries of the backed parablocks. The complete parablock remains within the parachain network, maintaining its autonomy while relying on the relay chain for validation and finality.
113+
114+
115+
## Where to Go Next
116+
117+
Explore more about Parachain consensus through these resources:
118+
119+
<div class="grid cards" markdown>
120+
121+
- <span class="badge learn">Learn</span> __Elastic Scaling__
122+
123+
---
124+
125+
Learn more about how Elastic Scaling boosts parachain performance.
126+
127+
[:octicons-arrow-right-24: Elastic Scaling](/reference/parachains/consensus/elastic-scaling/){target=\_blank}
128+
129+
- <span class="badge learn">Learn</span> __Asynchronous Backing__
130+
131+
---
132+
133+
Read about pipelining parachain block production via Async Backing.
134+
135+
[:octicons-arrow-right-24: Asynchronous Backing](/reference/parachains/consensus/async-backing/){target=\_blank}
136+
137+
138+
139+
- <span class="badge external">Learn</span> __Parachain Wiki__
140+
141+
---
142+
143+
Explore more on Parachains in the Wiki.
144+
145+
[:octicons-arrow-right-24: Parachains](https://wiki.polkadot.com/learn/learn-parachains/){target=\_blank}
146+
147+
148+
149+
</div>

.ai/site-index.json

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4322,15 +4322,15 @@
43224322
"token_estimator": "heuristic-v1"
43234323
},
43244324
{
4325-
"id": "reference-parachains-consensus-overview",
4325+
"id": "reference-parachains-consensus",
43264326
"title": "Parachain Consensus",
4327-
"slug": "reference-parachains-consensus-overview",
4327+
"slug": "reference-parachains-consensus",
43284328
"categories": [
43294329
"Polkadot Protocol",
43304330
"Parachains"
43314331
],
4332-
"raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-overview.md",
4333-
"html_url": "https://docs.polkadot.com/reference/parachains/consensus/overview/",
4332+
"raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus.md",
4333+
"html_url": "https://docs.polkadot.com/reference/parachains/consensus/",
43344334
"preview": "Parachains are independent blockchains built with the Polkadot SDK, designed to leverage Polkadot’s relay chain for shared security and transaction finality. These specialized chains operate as part of Polkadot’s execution sharding model, where each parachain manages its own state and transactions while relying on the relay chain for validation and consensus.",
43354335
"outline": [
43364336
{
@@ -4368,26 +4368,6 @@
43684368
"hash": "sha256:58e87829668cd9e3e034d94fcaf48b090970093f6d5a6136630e5d268a8846c8",
43694369
"token_estimator": "heuristic-v1"
43704370
},
4371-
{
4372-
"id": "reference-parachains-consensus",
4373-
"title": "reference-parachains-consensus",
4374-
"slug": "reference-parachains-consensus",
4375-
"categories": [
4376-
"Uncategorized"
4377-
],
4378-
"raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus.md",
4379-
"html_url": "https://docs.polkadot.com/reference/parachains/consensus/",
4380-
"preview": "TODO",
4381-
"outline": [],
4382-
"stats": {
4383-
"chars": 5,
4384-
"words": 1,
4385-
"headings": 0,
4386-
"estimated_token_count_total": 0
4387-
},
4388-
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
4389-
"token_estimator": "heuristic-v1"
4390-
},
43914371
{
43924372
"id": "reference-parachains-cryptography",
43934373
"title": "Cryptography",

0 commit comments

Comments
 (0)