Skip to content

Commit 5bc9f0f

Browse files
committing all difs generated by workflow script on commits
1 parent f21afb1 commit 5bc9f0f

10 files changed

+5624
-6742
lines changed

.ai/categories/polkadot-protocol.md

Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,271 @@ For detailed error management in XCM, see Gavin Wood's blog post on [XCM Executi
757757
</div>
758758

759759

760+
---
761+
762+
Page Title: Asynchronous Backing
763+
764+
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-async-backing.md
765+
- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/async-backing/
766+
- Summary: Understand how asynchronous backing pipelines rollup block production, the protocol changes it introduces on the Relay Chain, and how rollups participate safely and efficiently.
767+
768+
Asynchronous backing (often shortened to ***Async Backing***) is a rollup [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** stages of the [Inclusion Pipeline](/reference/parachains/consensus/inclusion-pipeline).
769+
770+
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}.
771+
772+
## Configurations
773+
The following configurations can be set by onchain governance, dictating how many blocks ahead of the relay chain a given rollup's collators can run:
774+
775+
* [`max_candidate_depth`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L49): the number of blocks a rollup collator can produce that are not yet included in the relay chain. A value of `2` means that there can be a maximum of 3 unincluded rollup blocks at any given time.
776+
* [`allowed_ancestry_len`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L54): the oldest relay parent a rollup block can be built on top of. A value of `1` means collators can start building blocks 6 seconds in advance.
777+
778+
## Synchronous VS. Asynchronous Processing
779+
780+
*in progress*
781+
782+
In the synchronous scenario, both the collators and validators draw context from the relay parent of the prior rollup block, 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 block, and only `0.5` seconds are assigned for execution.
783+
784+
<div className="merm-16x9">
785+
```mermaid
786+
---
787+
displayMode: compact
788+
config:
789+
themeCSS: "
790+
#item1 { fill: #450693; stroke: #450693; } \n
791+
#item2 { fill: #8C00FF; stroke: #8C00FF; } \n
792+
#item3 { fill: #FFC400; stroke: #FFC400; } \n
793+
#r { fill: #eb4172; stroke: none; } \n
794+
#p1padTop { display: none; } \n
795+
796+
/* Hide ALL task labels (inside or outside), across breakpoints */
797+
text.taskText,
798+
text.taskTextOutside,
799+
[class*='taskText'] tspan { display: none !important; } \n
800+
801+
/* Keep outside labels + section titles styled */
802+
.taskTextOutside, .sectionTitle { fill: #000 !important; color: #000 !important; font-weight: 700; } \n
803+
804+
805+
svg { width: 100% !important; height: auto !important; aspect-ratio: 21 / 9; } \n
806+
807+
"
808+
themeVariables:
809+
sectionBkgColor: '#fff'
810+
gantt:
811+
numberSectionStyles: 1
812+
barHeight: 70
813+
gridLineStartPadding: 100
814+
---
815+
gantt
816+
dateFormat YYYY
817+
axisFormat %y
818+
tickInterval '10year'
819+
820+
R1 : r, 1905, 1907
821+
R2 : r, 1911, 1913
822+
R3 : r, 1917, 1919
823+
R4 : r, 1923, 1925
824+
825+
SPACING : p1padTop, 1905, 1907
826+
SPACING : p1padTop, 1911, 1913
827+
SPACING : p1padTop, 1917, 1919
828+
SPACING : p1padTop, 1923, 1925
829+
830+
section P1
831+
X : item1, 1900, 1901
832+
Backing : item2, 1901, 1906
833+
Inclusion : item3, 1906, 1912
834+
835+
section P2
836+
X : item1, 1912, 1913
837+
Backing : item2, 1913, 1918
838+
Inclusion : item3, 1918, 1924
839+
```
840+
</div>
841+
842+
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.
843+
844+
This results in one parablock being processed *every* relay block, and allows for more time to execute during the Generation step (0.5s --> 2s).
845+
846+
```mermaid
847+
---
848+
displayMode: compact
849+
config:
850+
themeCSS: "
851+
#item1 { fill: #450693; stroke: #450693; } \n
852+
#item2 { fill: #8C00FF; stroke: #8C00FF; } \n
853+
#item3 { fill: #FFC400; stroke: #FFC400; } \n
854+
#r { fill: #eb4172; stroke:none; font-size: 20px; } \n
855+
svg text { font-size: 20px !important; } \n
856+
svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
857+
858+
/* Hide ALL task labels by default */
859+
text.taskText,
860+
text.taskTextOutside,
861+
[class*='taskText'] tspan { display: none !important; } \n
862+
863+
/* Show labels for the 'r' group (inside or outside, incl. tspans) */
864+
text.taskText[id^='r'],
865+
text.taskTextOutside[id^='r'],
866+
text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
867+
868+
/* Keep section titles styled */
869+
.sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
870+
871+
/* Hide the first two section titles (F1, F2). Change indexes if needed. */
872+
.sectionTitle:nth-of-type(1),
873+
.sectionTitle:nth-of-type(2) { display: none !important; } \n
874+
875+
/* Also hide SPACING row labels on the left */
876+
text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
877+
"
878+
themeVariables:
879+
sectionBkgColor: '#fff'
880+
gantt:
881+
numberSectionStyles: 1
882+
barHeight: 70
883+
gridLineStartPadding: 100
884+
---
885+
%%{init: {"gantt": {"barHeight": 70 }}}%%
886+
gantt
887+
dateFormat YYYY
888+
axisFormat %y
889+
tickInterval '10year'
890+
891+
R1 : r, 1905, 1907
892+
R2 : r, 1911, 1913
893+
R3 : r, 1917, 1919
894+
R4 : r, 1923, 1925
895+
R5 : r, 1929, 1931
896+
897+
SPACING : p1padTop, 1905, 1907
898+
SPACING : p1padTop, 1911, 1913
899+
SPACING : p1padTop, 1917, 1919
900+
SPACING : p1padTop, 1923, 1925
901+
SPACING : p1padTop, 1929, 1931
902+
903+
section P1
904+
X : item1, 1900, 1902
905+
Backing : item2, 1902, 1912
906+
Inclusion : item3, 1912, 1918
907+
908+
section P2
909+
X : item1, 1906, 1908
910+
Backing : item2, 1908, 1918
911+
Inclusion : item3, 1918, 1924
912+
913+
section P3
914+
X : item1, 1912, 1914
915+
Backing : item2, 1914, 1924
916+
Inclusion : item3, 1924, 1930
917+
918+
section P4
919+
X : item1, 1918, 1920
920+
Backing : item2, 1920, 1930
921+
```
922+
923+
Notice how `P2` starts before the backing stage of `P1`
924+
925+
In the multi-core scenario
926+
```mermaid
927+
---
928+
displayMode: compact
929+
config:
930+
themeCSS: "
931+
#item1 { fill: #450693; stroke: #450693; } \n
932+
#item2 { fill: #8C00FF; stroke: #8C00FF; } \n
933+
#item3 { fill: #FFC400; stroke: #FFC400; } \n
934+
#r { fill: #eb4172; stroke: none; } \n
935+
#p1padTop { display: none; } \n
936+
text.taskText[id^=p1padTop] { fill: none !important; color: #000 !important; } \n
937+
938+
939+
/* Default inside task text: white */ \n
940+
.taskText { fill: #fff !important; color: #fff !important; font-weight: 700; font-size: 18px; } \n
941+
942+
/* Hide text inside bars */
943+
.taskText { display: none !important; } \n
944+
945+
/* Outside labels and section titles: black */ \n
946+
.taskTextOutside, .sectionTitle { fill: #000 !important; color: #000 !important; font-weight: 700; font-size: 18px; } \n
947+
948+
/* Inside text for #r items: black */ \n
949+
text.taskText[id^=r] { fill: #fff !important; } \n
950+
"
951+
themeVariables:
952+
sectionBkgColor: '#fff'
953+
gantt:
954+
numberSectionStyles: 1
955+
barHeight: 70
956+
gridLineStartPadding: 100
957+
---
958+
%%{init: {"gantt": {"barHeight": 70 }}}%%
959+
gantt
960+
dateFormat YYYY
961+
axisFormat %y
962+
%% this next line doesn't recognise 'decade' or 'year', but will silently ignore
963+
tickInterval '10year'
964+
965+
section F1
966+
R1 : r, 1905, 1907
967+
R2 : r, 1911, 1913
968+
R3 : r, 1917, 1919
969+
R4 : r, 1923, 1925
970+
R5 : r, 1929, 1931
971+
972+
section F2
973+
SPACING : p1padTop, 1905, 1907
974+
SPACING : p1padTop, 1911, 1913
975+
SPACING : p1padTop, 1917, 1919
976+
SPACING : p1padTop, 1923, 1925
977+
SPACING : p1padTop, 1929, 1931
978+
979+
section P1
980+
X : item1, 1900, 1902
981+
Backing : item2, 1902, 1912
982+
Inclusion : item3, 1912, 1918
983+
984+
section P2
985+
X : item1, 1906, 1908
986+
Backing : item2, 1908, 1918
987+
Inclusion : item3, 1918, 1924
988+
989+
section P3
990+
X : item1, 1912, 1914
991+
Backing : item2, 1914, 1924
992+
Inclusion : item3, 1924, 1930
993+
994+
section F20
995+
SPACING : p1padTop, 1901, 1930
996+
997+
section F21
998+
R1 : r, 1905, 1907
999+
R2 : r, 1911, 1913
1000+
R3 : r, 1917, 1919
1001+
R4 : r, 1923, 1925
1002+
R5 : r, 1929, 1931
1003+
1004+
section F22
1005+
SPACING : p1padTop, 1901, 1930
1006+
1007+
1008+
section P4
1009+
X : item1, 1900, 1902
1010+
Backing : item2, 1902, 1912
1011+
Inclusion : item3, 1912, 1918
1012+
1013+
section P5
1014+
X : item1, 1906, 1908
1015+
Backing : item2, 1908, 1918
1016+
Inclusion : item3, 1918, 1924
1017+
1018+
section P6
1019+
X : item1, 1912, 1914
1020+
Backing : item2, 1914, 1924
1021+
Inclusion : item3, 1924, 1930
1022+
```
1023+
1024+
7601025
---
7611026

7621027
Page Title: Blocks
@@ -5071,6 +5336,46 @@ By defining weights, you can trade-off the number of transactions per second and
50715336
Westend is a Parity-maintained, Polkadot SDK-based blockchain that serves as a test network for the [Polkadot](#polkadot) network.
50725337

50735338

5339+
---
5340+
5341+
Page Title: Inclusion Pipeline
5342+
5343+
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-inclusion-pipeline.md
5344+
- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/inclusion-pipeline/
5345+
- Summary: TODO!
5346+
5347+
The mulit-step pipeline through which rollup blocks are processed into the Polkadot relay chain:
5348+
5349+
```mermaid
5350+
%%{init: {"flowchart": {"nodeSpacing": 40, "rankSpacing": 60}}}%%
5351+
flowchart LR
5352+
%% Keep the pipeline on one row (container is hidden)
5353+
subgraph Row[" "]
5354+
direction LR
5355+
G["Generation"] --> B["Backing"] --> I["Inclusion"]
5356+
end
5357+
style Row fill:none,stroke:none
5358+
5359+
%% Context: plain text (no box) pointing to both G and B
5360+
C["Context"]:::nobox
5361+
C -.-> G
5362+
C -.-> B
5363+
5364+
classDef nobox fill:none,stroke:none,color:inherit;
5365+
```
5366+
**Context**: Context of state is provided as input in order for collators and validators to build a rollup block during the generation and backing stages, respectively. This context is provided by two sources:
5367+
5368+
* **Relay Parent**: The relay chain block which a given rollup block is anchored to. Note that the relay parent of a rollup block and the relay block including that rollup block are always different. This context source lives on the relay chain.
5369+
5370+
* **Unincluded Segments**: Chains of candidate rollup blocks that have yet to be included in the relay chain, i.e. they can contain blocks 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.
5371+
5372+
**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.
5373+
5374+
**Backing**: A subset of active validators verify if the rollup block follows the state transition rules of the rollup 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.
5375+
5376+
**Inclusion**: Validators gossip [erasure code chunks]() and put the rollup block through the final [approval process]() before it is considered *included* in the relay chain.
5377+
5378+
50745379
---
50755380

50765381
Page Title: Install Polkadot SDK Dependencies

0 commit comments

Comments
 (0)