Asynchronous Backing (Deep)
How to use the slides - Full screen (new tab)
Deep Dive, Asynchronous Backing
Notes:
I'll be presenting the second of 3 lectures providing a window into Polkadot core, a slice of where we're at and where we're headed.
This lecture covers asynchronous backing, the new feature with potential to deliver shorter parachain block times and an order of magnitude increase in quantity of Polkadot blockspace.
Lets get to it
Overview
- Async Backing Motivation
- Laying the Groundwork, Contextual Execution of Parablocks
- Prospective Parachains, Storing Products of the Backing Process
- Supporting Changes
- Async Backing Advantages, Current and Future
Async Backing Motivation
Terminology: Backable vs Backed
- Backable candidate:
- Output of the off-chain backing process
- Received a quorum of "valid" votes from its backing group
- Backed candidate:
- A backable candidate that has been placed on-chain
- Also termed "pending availability"
Notes:
We avoid backing any candidate on the relay chain unless we know there is room for that candidate in the availability process. To do otherwise risks wasted on-chain work.
When a candidate is backed on-chain it immediately occupies an availability core and enters the availability, or erasure coding, process.
Synchronous Backing
Note:
Can anyone spot a problem with synchronous model?
-
Problem 1
- Can only start work on new parablock when prior is included
- One relay block for backing, one for inclusion
- Minimum block time of 12 seconds
-
Problem 2
- Minimal time to submit collation for 12 second total block time
- About .5 seconds
- Not enough to fill block fully
Asynchronous Backing
Notes:
- Point out the two independent processes and the "stopping points between them"
- Walk through, starting with unincluded segment
The Async Backing Reasonable Collator Assumptions
- "The best existing parablock I'm aware of will eventually be included in the relay chain."
- "There won't be a chain reversion impacting that best parablock."
The Stakes Are Low
Notes:
Best is determined by a process similar to the BABE fork choice rule. Brief BABE fork choice rule review
Contextual Execution of Parablocks
Async Backing Execution Context
- From relay chain
- Base constraints
- Relay parent
- From unincluded segment
- Constraint modifications
- Required parent

Notes:
- How it was before:
- Required parent included in relay parent
- No need for constraint modifications
- Relay parent vs required parent
- Base constraints vs modifications
Constraints and Modifications
Notes:
Constraints to Highlight:
- required_parent: Fragment would place its corresponding candidate here for children
- min_relay_parent_number: Monotonically increasing rule, max_ancestry_len
- ump_messages_sent mods ump_remaining
- code_upgrade_applied: Only one in the unincluded segment at a time!
Prospective Parachains
Storing Products of the Backing Process
Prospective Parachains Snapshot
Notes:
- Fragment trees only built for active leaves
- Fragment trees built per scheduled parachain at each leaf
- Fragment trees may have 0 or more fragments representing potential parablocks making up possible futures for a parachain's state.
- Collation generation, passing, and seconding work has already been completed for each fragment.
Anatomy of A Fragment Tree
Notes:
In this order
- Scope
- Root node: corresponds to most recently included candidate
- Child nodes: Mention required parent rule
FragmentNode
contentsCandidateStorage
GetBackableCandidate

Fragment Tree Inclusion Checklist
When and where can a candidate be included in a fragment tree?
- Required parent is in tree
- Included as child of required parent, if at all
Fragment::validate_against_constraints()
passes- Relay parent in scope
Relay Parent Limitations for Fragments
What does it mean for a relay parent to be in scope?
When is a relay parent allowed to be out of scope?
Notes:
In Scope:
- On same fork of the relay chain
- Within
allowed_ancestry_len
Out of scope:
- Candidates pending availability have been seen on-chain and need to be accounted for even if they go out of scope.
The most likely outcome for candidates pending availability is that they will become available, so we need those blocks to be in the
FragmentTree
to accept their children. - Relay parent can't move backwards relative to that of the required parent
Assembling Base Constraints
Excerpt from backing_state()
in runtime/parachains/src/runtime_api_impl/vstaging.rs
Applying Constraint Modifications
Excerpt from Constraints::apply_modifications()
Validating Against Constraints
Excerpt from Fragment::validate_against_constraints()
AsyncBackingParams
Numbers in use for testing Prospective Parachains:
max_candidate_depth
= 4allowed_ancestry_len
= 3
Supporting Changes
Statement Distribution Changes
Notes:
Why do we need the refactor?
Answer: Cap on simultaneous candidates per backing group ~3x higher
Mention
- Announcement - Acknowledgement
- Request - Response
Provisioner Changes
Function request_backable_candidates
from the Provisioner subsystem
Notes:
- Per core
- Discuss core states free, scheduled, occupied
- Discuss core freeing criteria
bitfields_indicate_availability
- next_up_on_available
- availability time out
- next_up_on_timeout
- Explain what required path is
- Why is required path left empty?

Cumulus Changes
- Consensus driven block authoring
- Parachain consensus refactor
- Aura rewrite
- Custom sequencing consensus:
- Tendermint
- Hotshot consensus
Async Backing Advantages, Current and Future
Advantages of Asynchronous Backing
- 3-5x more extrinsics per block
- Shorter parachain block times 6s vs 12s
- Resulting 6-10x boost in quantity of blockspace
- Fewer wasted parachain blocks
Notes:
- Collators have more time to fill each block
- Advance work ensures backable candidates for each parachain are present to be backed on the relay chain every 6 seconds
- Self explanatory
- Allow parachain blocks to be βreusedβ when they donβt make it onto the relay chain in the first attempt
Async Backing and Exotic Core Scheduling
- What is exotic core scheduling?
- Multiple cores per parachain
- Overlapping leases of many lengths
- Lease + On-demand
- How does asynchronous backing help?
Notes:
- The unincluded segment is necessary to build 2 or more parablocks in a single relay block

Shorter Block Times?
- Async backing gives us unincluded block queuing
- What else we need for useful shorter times:
- Soft finality
- Inclusion dependencies (comes with elastic scaling)
Notes:
- Soft finality means that the collators will submit as many new blocks with the same extrinsics as needed to retain the same ordering if a parablock candidate is dropped.
- Inclusion dependencies: Take two parablocks a and b, where a is built on top of b. Then if a and b are being made available on two different cores during the same block we need to ensure that b waits for inclusion until a is also included.