ChainSafe / ChainSafe/gossamer
PVF Prechecking subsystem
- Dominant language
- Go
- Stars
- 454
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
## Issue summary
- PVF means Parachains Validation Function. It is a wasm module provided by each parachain and it remains on-chain.
- PVFs are using by `candidate-validation` subsystem to validate candidates against it.
- If the compilation of PVF takes too long or takes too much memory, this could leave a node in limbo as to whether a candidate of that parachain is valid or not.
- The amount of time that a PVF takes to compile is a subjective resource limit and as such PVFs may be maliciously crafted so that there is e.g. a 50/50 split of validators which can and cannot compile and execute the PVF.
This has the following implications:
- In backing, inclusion may be slow due to backing groups being unable to execute the block
- In approval checking, there may be many no-shows, leading to slow finality
- In disputes, neither side may reach supermajority. Nobody will get slashed and the chain will not be reverted or finalized.
To solve this problem we need a fairly hard guarantee that the PVFs of registered parachains/threads can be compiled within a reasonable amount of time. We call this process **prechecking**
In Prechecking, we are basically going to compile the PVF Wasm blob with stricter limits than regular compilation.
## Other information and links
For detailed requirements and explaination of prechecking, we are going to refer to these docs below
https://paritytech.github.io/polkadot-sdk/book/pvf-prechecking.html
https://paritytech.github.io/polkadot-sdk/book/node/utility/pvf-prechecker.html
Contributor guide
Assessment
This issue has not been assessed yet.