Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(parachain/availability-distribution): implement management of chunk fetching tasks #4492

Open
1 task
Tracked by #3598
haikoschol opened this issue Jan 21, 2025 · 0 comments
Open
1 task
Tracked by #3598
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.

Comments

@haikoschol
Copy link
Contributor

Issue summary

This functionality is part of the message handling logic for ActiveLeavesUpdateSignal.

Implementation details

For each newly activated leaf plus the ancestors retrieved in the previous step, instantiate a runtime instance and call ParachainHostAvailabilityCores(). Filter out all cores that are unoccupied or not associated with the relay parent. For each core, check whether there is already a fetch task running for the candidate hash associated with the core. If yes, add the newly activated leaf to the state of the fetch task.

If not, determine the chunk index for the core and start a new fetch task for this chunk.

For each deactivated leaf, remove it from the state of all running fetch tasks. Cancel all fetch tasks that have an empty list of leaves.

package availabilitydistribution

type BlockState interface {
    GetHeader(hash common.Hash) (*types.Header, error)
    GetRuntime(hash common.Hash) (instance runtime.Instance, err error)
}

type fetchChunkTask struct {
    leaves []common.Hash
    // ...
}

type AvailabilityDistribution struct {
    blockState BlockState
    fetches map[parachaintypes.CandidateHash]*fetchChunkTask
    // ...
}

Other information and links

Acceptance criteria

  • New code is 60% covered with unit tests
@haikoschol haikoschol added S-subsystems-availability issues related to polkadot host availability subsystem functionality. T-implementation this issue/pr is a new feature or functionality. labels Jan 21, 2025
@haikoschol haikoschol added the C-simple Minor changes changes, no additional research needed. Good first issue/review. label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant