This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Refactor inherent filtering to be contained completely in the runtime #3989
Labels
I8-refactor
Code needs refactoring.
At the moment, the provisioner does some filtering of candidates and bitfields to provide them to the runtime. However, it's not tightly integrated into the runtime which makes filtering difficult to do accurately and on a per-candidate or per-bitfield basis, and also for it to account for weight.
For disputes, the filtering is offloaded completely to the runtime's
ProvideInherent
implementation for theParasInherent
. This is invoked off-chain by the block author, and the provisioner just supplies all dispute votes and expects the runtime to filter it down to an acceptable set of disputes. It allows filtering out just a single dispute.This pattern should be extended to cover both candidates and bitfields, and also apply filtering based on the disputes that are included. Basically, any kind of filtering needed in order for the end result to pass all checks in
ParasInherent::enter
on a fresh state. Additionally, the filtering done in the provisioner can be discarded, as it'll all be done by the runtime.Concretely:
InherentData
could be altered to contain a random value provided by the authoring node as a means of seeding an RNG within the runtime.InherentData
could be altered to contain a random value provided by the authoring node as a means of seeding an RNG within the runtime.Most of these checks are already done by the provisioner, but some are new.
The text was updated successfully, but these errors were encountered: