Skip to content
  • Sergey Pepyakin's avatar
    paras: Add runtime events for PVF pre-checking (#4683) · 21419a81
    Sergey Pepyakin authored
    In this PR, paras module emit runtime events on certain PVF pre-checking
    related conditions.
    
    Specifically, there are 3 new events in the paras module:
    
    1. PvfCheckStarted
    2. PvfCheckAccepted
    3. PvfCheckRejected
    
    All of those have identifiers for the parachain that triggered the PVF
    pre-checking and the validation code that goes through the pre-checking.
    
    The mechanics of those are as follows. Each time a new PVF is added, be
    it due to onboarding or upgrading, the `PvfCheckStarted` will be
    triggered. If another parachain triggers a pre-checking process for the
    validation code which is already being pre-checked, another
    `PvfCheckStarted` event will be triggered with the corresponding para
    id.
    
    When the PVF pre-checking voting for a PVF was finished, several
    `PvfCheckAccepted/Rejected` events will be triggered: one for each para id that
    was subscribed to this check (i.e. was a "cause" for it).
    
    If the PVF pre-checking is disabled, then one can still expect these
    events to be fired. Since insta PVF approval is syncronous, the
    `PvfCheckStarted` will be followed by the `PvfCheckAccepted` with the
    same validation code and para id.
    
    If somebody is interested in following validation code changes for a PVF
    of a parachain, they would need to subscribe to those events. I did not
    supply the topics for the events, since I am not sure if that's needed
    or will be used, but they can be added later if needed.
    21419a81