Conversation
This reverts commit aa5c568.
|
I switch this PR to also extract ':code' from proof. The idea is that, with cumulus setting, validation code is the same as runtime code, so we have access to it while validating. Therefore the code is removed from proof when compressing and added back when decompressing (in a lazy maner by some validation host function). Notice that on polka size, code is pretty hacky, probably running Also design could be more generic (maybe this can be applied to other key than ':code'):
Regarding test done: So clearly there is more work to do (polkadot and alternative design), but this seems pretty ok, so this question is as relevant as either. |
| @@ -134,6 +143,7 @@ fn validate_block_no_extra_extrinsics() { | |||
| witness, | |||
| validation_data, | |||
| } = build_block_with_witness(&client, vec![], parent_head.clone()); | |||
There was a problem hiding this comment.
Why isn't this function directly returning the CompactProof?
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
| let root = match sp_trie::decode_compact::<sp_trie::Layout<HashFor<B>>, _, _>( | ||
| &mut db, | ||
| storage_proof.iter_compact_encoded_nodes(), | ||
| Some(parent_head.state_root()), | ||
| ) { |
There was a problem hiding this comment.
Ahh and didn't you added a method to the compactproof for uncompressing it?
There was a problem hiding this comment.
We would have to rebuild the db afterward, here we directly got the db with the right content.
|
bot merge |
|
Waiting for commit status. |
|
Merge aborted: Checks failed for 23afc08 |
* compact, need to be made optional and look into/compress child trie roots/state. * proto with child trie support * Missing set_offchain_storage overload. * right name * Ignore offchain indexing in validation function. * patch trie-db * decompress from iter * use compressed proof * remove wasm blob from proof (no inject plugged yet) * change lock * update trie * change in toml * Revert "change in toml" This reverts commit aa5c568. * use patch to branches * i * i:wq * switch branch * ii * ok, needed to patch the runtime by putting substrate patch in polkadot project. * test passing with this conf * actual lazy code fetch * patch issue * Code reorg * restore commented tests. * update deps. * remove polka patch * fixes * remove patch * revert cargo.lock * cargo update -p sp-trie polkadot-service * fix collator test (using parent state root). * Update pallets/parachain-system/src/validate_block/implementation.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove encode_witness test function. * Update pallets/parachain-system/src/validate_block/implementation.rs * Fix compilation Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <info@kchr.de>
This reverts commit d935b81.
This reverts commit d935b81.
This reverts commit d935b81.
This reverts commit d935b81.
This PR depends on :
paritytech/substrate#8574
This PR adds code proof compression (the state proof).