Dynamically generate CHT roots on a full client (#6944)

* Generate CHT roots on a full client

* add changes_trie_root function

* Add a test

* Line widths

* Fix sc-service-test

* Clarify comments

* Revert comments
This commit is contained in:
Ashley
2020-08-24 15:11:21 +02:00
committed by GitHub
parent f009f6c227
commit c8ca2ce183
8 changed files with 139 additions and 56 deletions
+3 -3
View File
@@ -23,11 +23,11 @@ use std::convert::TryInto;
use parking_lot::RwLock;
use sc_client_api::{
cht, backend::{AuxStore, NewBlockState}, UsageInfo,
cht, backend::{AuxStore, NewBlockState, ProvideChtRoots}, UsageInfo,
blockchain::{
BlockStatus, Cache as BlockchainCache, Info as BlockchainInfo,
},
Storage, ChtRootStorage,
Storage,
};
use sp_blockchain::{
CachedHeaderMetadata, HeaderMetadata, HeaderMetadataCache,
@@ -596,7 +596,7 @@ impl<Block> Storage<Block> for LightStorage<Block>
}
}
impl<Block> ChtRootStorage<Block> for LightStorage<Block>
impl<Block> ProvideChtRoots<Block> for LightStorage<Block>
where Block: BlockT,
{
fn header_cht_root(