Skip to content
  • Sergey Pepyakin's avatar
    pvf-precheck: Strip PastCodeMeta (#4408) · 3c2fb21b
    Sergey Pepyakin authored
    This PR is a part of
    https://github.com/paritytech/polkadot/issues/3211.
    
    This PR prepares ground for the following runtime changes required for
    PVF pre-checking. Specifically, we do several changes here:
    
    1. We remove `validation_code_at` and `validation_code_hash_at`. Those
       functions are not used. They were added in the early days with intent
       to use it later but turned out that we do not need them.
    2. We replace `validation_code_hash_at` with just `current_code_hash`
       for the case of inclusion and candidate checking.
    3. We also replace `last_code_upgrade` with a direct query into
       `FutureCodeHash` and `UpgradeRestrictionSignal`. Those in conjunction
       should replace the logic that was used for allowing/disallowing
       upgrades. This requires special attention of the reviewers.
    4. Then we remove the machinery required to support those queries.
       Specifically the code related to `UseCodeAt`. We do not need it since
       we do not answer the historical queries. However, we still leave all
       the data on-chain. At some point we may clean it up, but that would
       be needed to be done with a dedicated migration which can be done as
       follow-up.
    5. Some now irrelevant tests were removed and/or adapted.
    3c2fb21b