Open axaysagathiya opened 1 month ago
in legacy backing, (Collation generation + backing) and (availability and inclusion), they require one to finish before the other can start. They can't run in parallel.
a parachain produce a block whenever relaychain block has included a previous candidate from that parachain.
after a parachain candidate block gets enough supporting votes, relay chain block author selects one candidate of each parachain to be included in a relay chain. and they get included directly to the relay chain. but...
In Async backing, instead of back the candidate on chain, we cache these candidates in a storage structure in the relay chain client. and later these cached candidates are then used for the availability and inclusion steps.
The Async backing optimistic collator assumptions
The worst case here the parablock we assumed will be included, doesn't get included. may be we have remake a few blocks. But this assumptions gives us mmuch more than what they could take away.
Unincluded Segment: it stores the parachain block which are not yet included into the relaychain block. unincluded segments live in the runtimes of parachain collators.
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.
In Synchronous backing,
parablock generation is tightly coupled to the relay chain's progression:
In Async Backing.
Two parameters of asynchronous backing can be controlled by Governance:
max_candidate_depth: the number of parachain blocks a collator can produce that are not yet included in the relay chain.
allowed_ancestry_len: the oldest relay chain parent a parachain block can be built on top of. Initial values will be set to 3 (4 unincluded parablocks at all times) and 2 (relay parent can be the third last).
parachain block Gets 2 second execution time, which was 0.5 seconds in synchronous backing.
The 2-second execution time is thus a limiter, not a system limitation. If parablock generation takes >2 seconds, the unincluded segment will shrink (less unincluded parablocks), while if it takes < 2 seconds, the segment will grow (more unincluded parablocks that will need to be backed and included). Such flexibility from the parachain side will be possible when, on the relay chain side, there will be elastic scaling (i.e., agile core usage and coretime allocation).
Keep track of parablocks that have been submitted to backers but have yet to be included.
A parablock stops being a prospective parablock when it is included on chain. At that point prospective parachains does not have to care about it anymore. Alternatively, a parablock's relay parent can get too old before that parablock is included, in which case prospective parachains can throw away the candidate.
we can now build prospective parachains – that is, trees of potential (but likely) future parachain blocks. This is the subsystem responsible for doing so.
other subsystems such as Backing rely on Prospective Parachains, e.g. for determining if a candidate can be seconded.
Prospective Parachains is primarily an implementation of fragment trees.
ProspectiveParachainsMessage::IntroduceCandidate
ProspectiveParachainsMessage::CandidateSeconded
ProspectiveParachainsMessage::CandidateBacked
ProspectiveParachainsMessage::GetHypotheticalFrontier
ProspectiveParachainsMessage::GetTreeMembership
ProspectiveParachainsMessage::GetMinimumRelayParents
Statement distribution subsystem
introduced cluster distribution protocol to share within backing group and grid distribution protocol to share with all the validators
Provisioner subsystem:
Modify code to request backable candidates from the candidate backing subsystem.
Prospective parachain
- New subsystem introduced in async backing.
- Introduced fragment tree to store backable parachain block
Issue summary
Other information and links
Acceptance criteria's (Outcomes)
@axaysagathiya please check how we put the AC in Elastic Scaling issue and add them here @kishansagathiya