-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PVF should accept data based on preimages #811
Comments
This issue has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/altering-polkadots-fork-choice-to-reduce-da-load/3389/4 |
An example of a pre-image would be a block meant to be committed to now, but executed somewhat later? |
@burdges I think common preimages would be, for example, popular smart contracts. Or any other data which stays mostly the same, but is read often. I could imagine multisigs would be another candidate for example, although impact to DA may be small in this example. But I do think it would be cool if, for an on-demand parachain, they can just upload the whole block beforehand, as a part of the collation, and then it would not involve the DA limits at all. I could imagine such a block could be many times the maximum block size, since multiple transactions could provide parts of the final block which is eventually concatenated together. Stuff like that. |
* Cache milagro G1 pubkeys * Update cumulus * More refactoring * Fix parachain test in CI * Revert to use BoundedVec for SyncCommitteePrepared * Use DispatchError * Revert "Revert to use BoundedVec for SyncCommitteePrepared" This reverts commit 22274fad4e604152a347fc03cfb9eefea28fbc6b. * Revert "Revert to use BoundedVec for SyncCommitteePrepared" This reverts commit 22274fad4e604152a347fc03cfb9eefea28fbc6b. * optimize things * Update Milagro * More refactoring * Uncomment benchmark * Pin cumulus branch * Update rust toolchain & More polish * Fix build * Update cumulus --------- Co-authored-by: Vincent Geddes <vincent.geddes@hey.com>
Plain pre-images won't work as we require probabilistic finality on them for use in parachains. |
Can you elaborate here? If data exists on the relay chain, (even if the block is not yet finalized), why can't it be used in the parachain validation function? Either the block, the data, and the parachain is all finalized, or none of it is. Perhaps we are not eye to eye on what this issue is trying to call out. |
We need all PVF inputs to be available to all validators, meaning either (1) the data exists in relay chain state, or else (2) we delcared the data available in the availability system. We're damaging (1) slightly in async backing, so the simplest solution becomes probabalistic finality, aka two epochs delay, so like PVFs work now. Afaik, Jam specifically avoids solving this problem, by doing relay chain IO only from the accumulate function, maybe unrealstic. We should probably utilize the availability system more agressively here, meaning parablock headers could name multiple availability stored blobs which they desire, even portions of blobs give like In particular, I doubt we remember who possesses which availability chunks now. We'd retain this off-chain somehow, but off-chain messaging requires this anyways, and worse that validators provide this information to collators simular to how bittorrent trackers work. |
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:
CandidateReceipt
s 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.ValidateFromExhaustive
should 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.
The text was updated successfully, but these errors were encountered: