Skip to content

Commit 30e9e3d

Browse files
split "async backing" into "async backing" & "inclusion pipeline" sections
- improved timeline graphs of inclusion pipeline
1 parent 8a1b7e3 commit 30e9e3d

File tree

3 files changed

+180
-80
lines changed

3 files changed

+180
-80
lines changed

llms.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
This directory lists URLs for raw Markdown pages that complement the rendered pages on the documentation site. Use these Markdown files to retain semantic context when prompting models while avoiding passing HTML elements.
77

88
## Metadata
9-
- Documentation pages: 270
9+
- Documentation pages: 271
1010
- Categories: 12
1111

1212
## Docs
@@ -190,6 +190,7 @@ Docs: Polkadot Protocol
190190
- [Chain Data](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-chain-data.md): Learn how to expose and utilize chain data for blockchain applications. Discover runtime metadata, RPC APIs, and tools for efficient development.
191191
- [Asynchronous Backing](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-async-backing.md): Understand how asynchronous backing pipelines parachain block production, the protocol changes it introduces on the Relay Chain, and how parachains participate safely and efficiently.
192192
- [Elastic Scaling](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-elastic-scaling.md): Learn how elastic scaling in Polkadot boosts parachain throughput, reduces latency, and supports dynamic, cost-efficient resource allocation.
193+
- [Inclusion Pipeline](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-inclusion-pipeline.md): TODO!
193194
- [Cryptography](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-cryptography.md): A concise guide to cryptography in blockchain, covering hash functions, encryption types, digital signatures, and elliptic curve applications.
194195
- [Data Encoding](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-data-encoding.md): SCALE codec enables fast, efficient data encoding, ideal for resource-constrained environments like Wasm, supporting custom types and compact encoding.
195196
- [Interoperability](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-interoperability.md): Explore the importance of interoperability in the Polkadot ecosystem, covering XCM, bridges, and cross-chain communication.

reference/parachains/consensus/async-backing.md

Lines changed: 142 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,76 +4,115 @@ description: Understand how asynchronous backing pipelines parachain block produ
44
categories: Polkadot Protocol
55
---
66

7-
# Asynchronous Backing
7+
<!-- Parachain blocks secured by the Polkadot relay chain are processed through a mulit-step pipeline called the [Inclusion Pipeline](/reference/parachains/consensus/inclusion-pipeline). -->
88

9-
## Introduction
9+
Asynchronous backing (often shortened to ***Async Backing***) is a parachain [configuration](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L43) set by on-chain governance. It allows collators and validators to build *some* number of blocks ahead of the relay chain during the **generation** and **backing** steps of the [Inclusion Pipeline](/reference/parachains/consensus/inclusion-pipeline).
1010

11-
Parachain blocks secured by the Polkadot relay chain are processed through a mulit-step pipeline called the [Inclusion Pipeline](#inclusion-pipeline).
11+
Async Backing improves throughput of the overall Polkadot Network by using coretime more efficiently, and enables the parallel processing needed for rollups to further scale throughput via [Elastic Scaling](/reference/parachains/consensus/elastic-scaling){target=\_blank}.
1212

13-
Asynchronous backing (often shortened to **_Async Backing_**) decouples the steps of this pipeline which enables parallel processing. Specifically, it allows for the generation and backing steps to kick off for a given parablock *before its parent block completes the pipeline*.
14-
15-
The introduction of this technique improves throughput of the Polkadot network and lays the foundation for many blocks of the same parachain to be processed in parallel via [Elastic Scaling](/reference/parachains/consensus/elastic-scaling){target=\_blank}.
13+
## Configurations
14+
The following configurations can be set by onchain governance, dictating how many blocks ahead of the relay chain a given parachain's collators can run:
1615

17-
## How Async Backing Works
16+
* [`max_candidate_depth`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L49): the number of parachain blocks a collator can produce that are not yet included in the relay chain.
17+
* [`allowed_ancestry_len`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L54): the oldest relay chain parent a parachain block can be built on top of.
1818

19-
Before diving into *asynchronous* backing, it is helpful to first review each component of the pipeline.
19+
## Synchronous VS. Asynchronous Processing
2020

21-
### Inclusion Pipeline
21+
In the synchronous scenario, both the collators and validators draw context from the Relay Parent of the prior parablock, which lives on the relay chain. This makes the Backing and Generation steps tightly coupled to the prior parablock completing the inclusion pipeline. As a result, one parablock can be processed every other relay blocks, and only `0.5` seconds are assigned for execution.
2222

23+
<div className="merm-16x9">
2324
```mermaid
24-
%%{init: {"flowchart": {"nodeSpacing": 40, "rankSpacing": 60}}}%%
25-
flowchart LR
26-
%% Keep the pipeline on one row (container is hidden)
27-
subgraph Row[" "]
28-
direction LR
29-
G["Generation"] --> B["Backing"] --> I["Inclusion"]
30-
end
31-
style Row fill:none,stroke:none
32-
33-
%% Context: plain text (no box) pointing to both G and B
34-
C["Context"]:::nobox
35-
C -.-> G
36-
C -.-> B
37-
38-
classDef nobox fill:none,stroke:none,color:inherit;
39-
```
40-
**Context**: Context of state is provided as input in order for collators and validators to build a parablock during the generation and backing stages, respectively. This context is provided by two sources:
25+
---
26+
displayMode: compact
27+
config:
28+
themeCSS: "
29+
#item1 { fill: #450693; stroke: #450693; } \n
30+
#item2 { fill: #8C00FF; stroke: #8C00FF; } \n
31+
#item3 { fill: #FFC400; stroke: #FFC400; } \n
32+
#r { fill: #eb4172; stroke: none; } \n
33+
#p1padTop { display: none; } \n
4134
42-
* **Relay Parent**: The relay chain block which a given parablock is anchored to. Note that the relay parent of a parablock and the relay block including that parablock are always different. This context source lives on the relay chain.
35+
/* Hide ALL task labels (inside or outside), across breakpoints */
36+
text.taskText,
37+
text.taskTextOutside,
38+
[class*='taskText'] tspan { display: none !important; } \n
4339
44-
* **Unincluded Segments**: Chains of candidate parablocks that have yet to be included in the relay chain, i.e. they can contain parablocks at any stage pre-inclusion. The core functionality that asynchronous backing brings is the ability to build on these unincluded segments of block ancestors rather than building only on ancestors included in the relay chain state. This context source lives on the collators.
40+
/* Keep outside labels + section titles styled */
41+
.taskTextOutside, .sectionTitle { fill: #000 !important; color: #000 !important; font-weight: 700; } \n
4542
46-
**Generation**: Collators *execute* their blockchain's core functionality to generate a new block, producing a [candidate receipt](), which is passed to validators selected for backing.
4743
48-
**Backing**: A subset of active validators verify if the parablock follows the state transition rules of the parachain and sign *Proof of Validity* (PoV) statements that can have a positive or negative outcome. With enough positive statements, the block is backed and included in the relay chain, but is still pending approval.
44+
svg { width: 100% !important; height: auto !important; aspect-ratio: 21 / 9; } \n
4945
50-
**Inclusion**: Validators gossip [erasure code chunks]() and put the parablock through the final [approval process]() before a parablock is considered *included* in the relay chain.
46+
"
47+
themeVariables:
48+
sectionBkgColor: '#fff'
49+
gantt:
50+
numberSectionStyles: 1
51+
barHeight: 70
52+
gridLineStartPadding: 100
53+
---
54+
gantt
55+
dateFormat YYYY
56+
axisFormat %y
57+
tickInterval '10year'
5158
52-
### Sync VS. Async
59+
R1 : r, 1905, 1907
60+
R2 : r, 1911, 1913
61+
R3 : r, 1917, 1919
62+
R4 : r, 1923, 1925
63+
64+
SPACING : p1padTop, 1905, 1907
65+
SPACING : p1padTop, 1911, 1913
66+
SPACING : p1padTop, 1917, 1919
67+
SPACING : p1padTop, 1923, 1925
5368
54-
In the synchronous scenario, both the collators and validators draw context from the Relay Parent of the prior parablock, which lives on the relay chain. This makes the Backing and Generation steps tightly coupled to the prior parablock completing the inclusion pipeline. As a result, one parablock can be processed every other relay blocks.
69+
section P1
70+
X : item1, 1900, 1901
71+
Backing : item2, 1901, 1906
72+
Inclusion : item3, 1906, 1912
73+
74+
section P2
75+
X : item1, 1912, 1913
76+
Backing : item2, 1913, 1918
77+
Inclusion : item3, 1918, 1924
78+
```
79+
</div>
80+
81+
In the asynchronous scenario, where both the collators and validators have access to [Unincluded Segments](/reference/parachains/consensus/inclusion-pipeline) as an additional context source, the Backing and Generation steps are no longer coupled to the prior block completing the full inclusion pipeline. Instead, the prior parablock only needs to complete the generation step and be added to the Unincluded Segments before the next parablock can begin the Backing and Generation steps.
82+
83+
This results in one parablock being processed *every* relay block, and allows for more time to execute during the Generation step (0.5s --> 2s).
5584

5685
```mermaid
5786
---
5887
displayMode: compact
5988
config:
6089
themeCSS: "
61-
#item1 { fill: #4f2eb7; stroke: #000; } \n
62-
#item2 { fill: #ffc62a; stroke: #000; } \n
63-
#item3 { fill: #4faff9; stroke: #000; } \n
64-
#r { fill: #eb4172; stroke: #000; } \n
65-
#p1padTop { fill:none;stroke:none;opacity:0; } \n
66-
text.taskText[id^=p1padTop] { fill: none !important; color: #000 !important; } \n
67-
68-
69-
/* Default inside task text: white */ \n
70-
.taskText { fill: #fff !important; color: #fff !important; font-weight: 700; font-size: 18px; } \n
71-
72-
/* Outside labels and section titles: black */ \n
73-
.taskTextOutside, .sectionTitle { fill: #000 !important; color: #000 !important; font-weight: 700; font-size: 18px; } \n
74-
75-
/* Inside text for #r items: black */ \n
76-
text.taskText[id^=r] { fill: #fff !important; color: #000 !important; } \n
90+
#item1 { fill: #450693; stroke: #450693; } \n
91+
#item2 { fill: #8C00FF; stroke: #8C00FF; } \n
92+
#item3 { fill: #FFC400; stroke: #FFC400; } \n
93+
#r { fill: #eb4172; stroke:none; font-size: 20px; } \n
94+
svg text { font-size: 20px !important; } \n
95+
svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
96+
97+
/* Hide ALL task labels by default */
98+
text.taskText,
99+
text.taskTextOutside,
100+
[class*='taskText'] tspan { display: none !important; } \n
101+
102+
/* Show labels for the 'r' group (inside or outside, incl. tspans) */
103+
text.taskText[id^='r'],
104+
text.taskTextOutside[id^='r'],
105+
text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
106+
107+
/* Keep section titles styled */
108+
.sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
109+
110+
/* Hide the first two section titles (F1, F2). Change indexes if needed. */
111+
.sectionTitle:nth-of-type(1),
112+
.sectionTitle:nth-of-type(2) { display: none !important; } \n
113+
114+
/* Also hide SPACING row labels on the left */
115+
text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
77116
"
78117
themeVariables:
79118
sectionBkgColor: '#fff'
@@ -86,50 +125,62 @@ In the synchronous scenario, both the collators and validators draw context from
86125
gantt
87126
dateFormat YYYY
88127
axisFormat %y
89-
%% this next line doesn't recognise 'decade' or 'year', but will silently ignore
90128
tickInterval '10year'
91129
92130
R1 : r, 1905, 1907
93131
R2 : r, 1911, 1913
94132
R3 : r, 1917, 1919
95133
R4 : r, 1923, 1925
134+
R5 : r, 1929, 1931
96135
97136
SPACING : p1padTop, 1905, 1907
98137
SPACING : p1padTop, 1911, 1913
99138
SPACING : p1padTop, 1917, 1919
100139
SPACING : p1padTop, 1923, 1925
140+
SPACING : p1padTop, 1929, 1931
101141
102142
section P1
103-
X : item1, 1900, 1901
104-
Backing : item2, 1901, 1906
105-
Inclusion : item3, 1906, 1912
143+
X : item1, 1900, 1902
144+
Backing : item2, 1902, 1912
145+
Inclusion : item3, 1912, 1918
106146
107147
section P2
108-
X : item1, 1912, 1913
109-
Backing : item2, 1913, 1918
110-
Inclusion : item3, 1918, 1924
111-
```
148+
X : item1, 1906, 1908
149+
Backing : item2, 1908, 1918
150+
Inclusion : item3, 1918, 1924
151+
152+
section P3
153+
X : item1, 1912, 1914
154+
Backing : item2, 1914, 1924
155+
Inclusion : item3, 1924, 1930
112156
113-
In the asynchronous scenario, where both the collators and validators have access to Unincluded Segments as an additional context source, the Backing and Generation steps are no longer coupled to the prior block completing the full inclusion pipeline. Instead, the prior parablock only needs to complete the generation step and be added to the Unincluded Segments before the next parablock can begin the Backing and Generation steps.
157+
section P4
158+
X : item1, 1918, 1920
159+
Backing : item2, 1920, 1930
160+
```
114161

115-
This results in one parablock being processed *every* relay block, and allows for more time to execute during the Generation step (0.5s --> 2s).
162+
Notice how `P2` starts before the backing stage of `P1`
116163

164+
In the multi-core scenario
117165
```mermaid
118166
---
119167
displayMode: compact
120168
config:
121169
themeCSS: "
122-
#item1 { fill: #4f2eb7; stroke: #000; } \n
123-
#item2 { fill: #ffc62a; stroke: #000; } \n
124-
#item3 { fill: #4faff9; stroke: #000; } \n
125-
#r { fill: #eb4172; stroke: #000; } \n
126-
#p1padTop { fill:none;stroke:none;opacity:0; } \n
170+
#item1 { fill: #450693; stroke: #450693; } \n
171+
#item2 { fill: #8C00FF; stroke: #8C00FF; } \n
172+
#item3 { fill: #FFC400; stroke: #FFC400; } \n
173+
#r { fill: #eb4172; stroke: none; } \n
174+
#p1padTop { display: none; } \n
127175
text.taskText[id^=p1padTop] { fill: none !important; color: #000 !important; } \n
128176
129177
130178
/* Default inside task text: white */ \n
131179
.taskText { fill: #fff !important; color: #fff !important; font-weight: 700; font-size: 18px; } \n
132180
181+
/* Hide text inside bars */
182+
.taskText { display: none !important; } \n
183+
133184
/* Outside labels and section titles: black */ \n
134185
.taskTextOutside, .sectionTitle { fill: #000 !important; color: #000 !important; font-weight: 700; font-size: 18px; } \n
135186
@@ -150,12 +201,14 @@ gantt
150201
%% this next line doesn't recognise 'decade' or 'year', but will silently ignore
151202
tickInterval '10year'
152203
204+
section F1
153205
R1 : r, 1905, 1907
154206
R2 : r, 1911, 1913
155207
R3 : r, 1917, 1919
156208
R4 : r, 1923, 1925
157209
R5 : r, 1929, 1931
158210
211+
section F2
159212
SPACING : p1padTop, 1905, 1907
160213
SPACING : p1padTop, 1911, 1913
161214
SPACING : p1padTop, 1917, 1919
@@ -177,22 +230,32 @@ gantt
177230
Backing : item2, 1914, 1924
178231
Inclusion : item3, 1924, 1930
179232
180-
section P4
181-
X : item1, 1918, 1920
182-
Backing : item2, 1920, 1930
183-
```
233+
section F20
234+
SPACING : p1padTop, 1901, 1930
184235
185-
### Compute Advantage
186-
Below is a table showing the main advantages of asynchronous over synchronous backing.
236+
section F21
237+
R1 : r, 1905, 1907
238+
R2 : r, 1911, 1913
239+
R3 : r, 1917, 1919
240+
R4 : r, 1923, 1925
241+
R5 : r, 1929, 1931
187242
188-
| | Sync Backing | Async Backing | Async Backing Advantage |
189-
| ------------------------------------ | ------------ | ------------ | ----------------------------------------- |
190-
| **Parablocks included every** | 12 seconds | 6 seconds | **2x** more parablocks included |
191-
| **Parablock maximum execution time** | 0.5 seconds | 2 seconds | **4x** more execution time in a parablock |
192-
| **Total Computer Gain (per core)** | | | **8x Compute Throughput** |
243+
section F22
244+
SPACING : p1padTop, 1901, 1930
193245
194-
## Configurations
195-
The following configurations can be set by onchain governance:
196246
197-
* [`max_candidate_depth`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L49): the number of parachain blocks a collator can produce that are not yet included in the relay chain.
198-
* [`allowed_ancestry_len`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L54): the oldest relay chain parent a parachain block can be built on top of.
247+
section P4
248+
X : item1, 1900, 1902
249+
Backing : item2, 1902, 1912
250+
Inclusion : item3, 1912, 1918
251+
252+
section P5
253+
X : item1, 1906, 1908
254+
Backing : item2, 1908, 1918
255+
Inclusion : item3, 1918, 1924
256+
257+
section P6
258+
X : item1, 1912, 1914
259+
Backing : item2, 1914, 1924
260+
Inclusion : item3, 1924, 1930
261+
```

0 commit comments

Comments
 (0)