Files
pezkuwi-subxt/prdoc/pr_4211.prdoc
T
s0me0ne-unkn0wn c26cf3f6f2 Do not re-prepare PVFs if not needed (#4211)
Currently, PVFs are re-prepared if any execution environment parameter
changes. As we've recently seen on Kusama and Polkadot, that may lead to
a severe finality lag because every validator has to re-prepare every
PVF. That cannot be avoided altogether; however, we could cease
re-preparing PVFs when a change in the execution environment can't lead
to a change in the artifact itself. For example, it's clear that
changing the execution timeout cannot affect the artifact.

In this PR, I'm introducing a separate hash for the subset of execution
environment parameters that changes only if a preparation-related
parameter changes. It introduces some minor code duplication, but
without that, the scope of changes would be much bigger.

TODO:
- [x] Add a test to ensure the artifact is not re-prepared if
non-preparation-related parameter is changed
- [x] Add a test to ensure the artifact is re-prepared if a
preparation-related parameter is changed
- [x] Add comments, warnings, and, possibly, a test to ensure a new
parameter ever added to the executor environment parameters will be
evaluated by the author of changes with respect to its artifact
preparation impact and added to the new hash preimage if needed.

Closes #4132
2024-04-25 10:16:12 +00:00

16 lines
556 B
Plaintext

title: "Re-prepare PVF artifacts only if needed"
doc:
- audience: Node Dev
description: |
When a change in the executor environment parameters can not affect the prepared artifact,
it is preserved without recompilation and used for future executions. That mitigates
situations where every unrelated executor parameter change resulted in re-preparing every
artifact on every validator, causing a significant finality lag.
crates:
- name: polkadot-node-core-pvf
bump: minor
- name: polkadot-primitives
bump: minor