feat(parachain/availability-distribution): implement get_block_ancestors_in_same_session
#4490
Labels
C-simple
Minor changes changes, no additional research needed. Good first issue/review.
S-subsystems-availability
issues related to polkadot host availability subsystem functionality.
T-implementation
this issue/pr is a new feature or functionality.
Issue summary
This function is part of the message handling logic for
ActiveLeavesUpdateSignal
.Implementation details
As part of this issue, no caching of runtime information should be implemented. That is covered by #4494, which should be worked on after this issue is completed.
For each newly activated leaf, retrieve the headers of up to
leafAncestryLenWithinSession
ancestors. Instantiate the runtime for the first ancestor and callParachainHostSessionIndexForChild()
to get the session index of the newly activated leaf. If no ancestors have been found, set this value to 0 instead.If the list of ancestors is not empty, iterate through the remaining ones and check that they have the same session index as the newly activated leaf. Stop iterating if a different session index is found and discard those ancestors.
Other information and links
Acceptance criteria
The text was updated successfully, but these errors were encountered: