Compact proof. (#295)

* 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 aa5c56850ef461ce3cb774213a92af4b1dd6cee5.

* 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 commit is contained in:
cheme
2021-06-08 11:51:32 +02:00
committed by GitHub
parent 794bc23de4
commit d935b81e70
6 changed files with 274 additions and 249 deletions
+5 -5
View File
@@ -198,7 +198,7 @@ pub struct ParachainBlockData<B: BlockT> {
/// The extrinsics of the parachain block.
extrinsics: sp_std::vec::Vec<B::Extrinsic>,
/// The data that is required to emulate the storage accesses executed by all extrinsics.
storage_proof: sp_trie::StorageProof,
storage_proof: sp_trie::CompactProof,
}
impl<B: BlockT> ParachainBlockData<B> {
@@ -206,7 +206,7 @@ impl<B: BlockT> ParachainBlockData<B> {
pub fn new(
header: <B as BlockT>::Header,
extrinsics: sp_std::vec::Vec<<B as BlockT>::Extrinsic>,
storage_proof: sp_trie::StorageProof,
storage_proof: sp_trie::CompactProof,
) -> Self {
Self {
header,
@@ -235,13 +235,13 @@ impl<B: BlockT> ParachainBlockData<B> {
&self.extrinsics
}
/// Returns the [`StorageProof`](sp_trie::StorageProof).
pub fn storage_proof(&self) -> &sp_trie::StorageProof {
/// Returns the [`CompactProof`](sp_trie::CompactProof).
pub fn storage_proof(&self) -> &sp_trie::CompactProof {
&self.storage_proof
}
/// Deconstruct into the inner parts.
pub fn deconstruct(self) -> (B::Header, sp_std::vec::Vec<B::Extrinsic>, sp_trie::StorageProof) {
pub fn deconstruct(self) -> (B::Header, sp_std::vec::Vec<B::Extrinsic>, sp_trie::CompactProof) {
(self.header, self.extrinsics, self.storage_proof)
}
}