feat(parachain/availability-distribution): implement cache for runtime info #4494
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
The availability distribution subsystem needs information obtain from the runtime to perform its tasks. To avoid the performance impact of redundant calls, it makes sense to cache this information in the subsystems state.
Implementation details
This issue should be done last when implementing the availability distribution subsystem.
The Parity implementation uses multiple types to implement caching such as
RuntimeInfo
andSessionCache
. There is some overlap in the data they store because some of these types are used in other contexts as well. Instead of anticipating this in our implementation, it probably makes sense to only cover the needs of availability distribution for now and focus on caching the data returned by the runtime functions it uses:ParachainHostSessionIndexForChild()
ParachainHostSessionInfo()
ParachainHostAvailabilityCores()
Since this data needs to be accessed by the subsystem itself, as well as the chunk fetching tasks, the cache should probably be implemented in a separate type.
Acceptance criteria
The text was updated successfully, but these errors were encountered: