-
Notifications
You must be signed in to change notification settings - Fork 1.2k
PVF should accept data based on preimages #811
Copy link
Copy link
Open
Labels
I6-metaA specific issue for grouping tasks or bugs of a specific category.A specific issue for grouping tasks or bugs of a specific category.I9-optimisationAn enhancement to provide better overall performance in terms of time-to-completion for a task.An enhancement to provide better overall performance in terms of time-to-completion for a task.
Metadata
Metadata
Assignees
Labels
I6-metaA specific issue for grouping tasks or bugs of a specific category.A specific issue for grouping tasks or bugs of a specific category.I9-optimisationAn enhancement to provide better overall performance in terms of time-to-completion for a task.An enhancement to provide better overall performance in terms of time-to-completion for a task.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Backlog
A common issue is that parachains need to include data which is large and takes up PoV space. We can use the Preimage pallet to have validators load this data from the relay chain state and pass it into the PVF instead. An initial use-case is smart contract code. PVF upgrades may also be optimized with this method cc #971
Summary of changes:
CandidateReceipts should have adata_dependencies: Vec<Hash>which are the hashes of all the data that should be passed into the PVFVec<(Hash, Vec<u8>)>which are all the preimages for the candidate receipt.ValidateFromExhaustiveshould accept aHashMap<Hash, Vec<u8>>for candidate executionWe don't want to allow too many preimages because it adds runtime, network, and execution overhead for every candidate because of the added checks and candidate receipt size.
This also allows data (e.g. smart contract code) to be reused across parachains in a way that doesn't add to the PoV size. Collator logic and parachain runtimes can be customized to detect data at block authoring time which is available through the preimages pallet and opt to include it that way as opposed to the PoV state. Users will need to pay to store data on the relay-chain.