roadmap/implementers-guide/src/node/backing/prospective-parachains.md
Purpose: Tracks and handles prospective parachain fragments and informs other backing-stage subsystems of work to be done.
"prospective":
Asynchronous backing changes the runtime to accept parachain candidates from a certain allowed range of historic relay-parents. This means 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. This subsystem is the main coordinator of work within the node for the collation and backing phases of parachain consensus.
Prospective Parachains is primarily an implementation of fragment trees. It also handles concerns such as:
See the following sections for more details.
This subsystem builds up fragment trees, which are trees of prospective para candidates. Each path through the tree represents a possible state transition path for the para. Each potential candidate is a fragment, or a node, in the tree. Candidates are validated against constraints as they are added.
This subsystem builds up trees for each relay-chain block in the view, for each para. These fragment trees are used for:
For example, here is a tree with several possible paths:
Para Head registered by the relay chain: included_head
↲ ↳
depth 0: head_0_a head_0_b
↲ ↳
depth 1: head_1_a head_1_b
↲ | ↳
depth 2: head_2_a1 head_2_a2 head_2_a3
We account for the same candidate possibly appearing in different forks. While we still build fragment trees for each head in each fork, we are efficient with how we reference candidates to save space.
Allowed ancestry doesn't cross session boundary. That is, you can only build on top of the freshest relay parent when the session starts. This is a current limitation that may be lifted in the future.
Also, runtime configuration values needed for constraints (such as
max_pov_size) are constant within a session. This is important when building
prospective validation data. This is unlikely to change.
ActiveLeaves
ProspectiveParachainsMessage::IntroduceCandidate
ProspectiveParachainsMessage::CandidateSeconded
IntroduceCandidate, if that wasn't
rejected by Prospective Parachains.ProspectiveParachainsMessage::CandidateBacked
ProspectiveParachainsMessage::GetBackableCandidate
ProspectiveParachainsMessage::GetHypotheticalFrontier
ProspectiveParachainsMessage::GetTreeMembership
ProspectiveParachainsMessage::GetMinimumRelayParents
ProspectiveParachainsMessage::GetProspectiveValidationData
RuntimeApiRequest::StagingParaBackingState
RuntimeApiRequest::AvailabilityCores
ChainApiMessage::Ancestors
k ancestor block hashes of a block with the given
hash.ChainApiMessage::BlockHeader