This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Use cached session index to obtain executor params #7646
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes paritytech/polkadot-sdk#579
To validate a candidate, approval voting and dispute coordinator subsystems currently rely on the candidate validation subsystem, which requests executor parameters at a session determined by the candidate's relay parent. This is unreliable, as the state at that relay parent may already be pruned. Still, we want to be able to apply slashes in that case.
This PR makes use of the internal cache maintained by approval voting and dispute distribution subsystems to reliably obtain session index even if the state in question has already been pruned. Then the execution parameters are requested and provided to the candidate validation subsystem, which doesn't have to request them on its own anymore.
The positive side effect is that the candidate validation subsystem is returning to its pre-#6161 state, that is, it expects the exhaustive validation data from a requesting subsystem instead of doing its own data collection.
The backing subsystem, also affected by the change, does not maintain any cache of session indexes as it doesn't need it, as the state at that stage is guaranteed to be alive. A session index is always known when a backing job is created. Executor parameters are requested before performing the actual validation using that session index.