You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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 */
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).
**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.
0 commit comments