-
Notifications
You must be signed in to change notification settings - Fork 69
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
Allow skipping value for compact proof #126
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Andronik Ordian <[email protected]>
And change LazyValue to LazyFetch
Are you removing values known due to all leaves being present? Or some other reason makes them redundent? |
No, the values are removed when they are known. eg you check some proof, then keep some of the value and use a different proof for which you know those value can be use. So it is just to remove values already known by the verifier. In practice the current target is to remove the ':code' key value from cumulus collated proof because with current cumulus we have the validation wasm being the same as the runtime wasm (requires a new polkadot host method to fetch this wasm lazilly when needed by the proof). |
It's for storage then? I see.. Yes, we definitely need code to be handled separately. lol |
Forgot to link a 'rough' (everything at the wrong place) implementation paritytech/cumulus#295 of the :code case. |
This PR extend trie_codec with the ability to selectively remove the values from the compact proof.
This differs from trie_db/src/proof by working on any proofs.
Encoding (compacting)
Values are removed by applying a given FnMut condition.
Values are replaced by the 0 length value.
We can escape actual 0 length value if needed, it is not needed when:
either as 0 length value will be a inline node which cannot be removed.
be replaced as parameter).
Decoding
Two possibilities: