Remove the dependency on heapsize (#2459)

* Remove heapsize dependency

* Finish removing heapsize

* Revert accidental change

* Fix Cargo.lock
This commit is contained in:
Pierre Krieger
2019-05-04 13:59:59 +02:00
committed by Gavin Wood
parent 9fdd7df582
commit 5a820db7f5
23 changed files with 62 additions and 111 deletions
+4 -5
View File
@@ -33,7 +33,6 @@ use crate::light::blockchain::{Blockchain, Storage as BlockchainStorage};
use crate::light::fetcher::{Fetcher, RemoteReadRequest};
use hash_db::Hasher;
use trie::MemoryDB;
use heapsize::HeapSizeOf;
use consensus::well_known_cache_keys;
const IN_MEMORY_EXPECT_PROOF: &str = "InMemory state backend has Void error type and always suceeds; qed";
@@ -108,7 +107,7 @@ impl<S, F, Block, H> ClientBackend<Block, H> for Backend<S, F, H> where
S: BlockchainStorage<Block>,
F: Fetcher<Block>,
H: Hasher<Out=Block::Hash>,
H::Out: HeapSizeOf + Ord,
H::Out: Ord,
{
type BlockImportOperation = ImportOperation<Block, S, F, H>;
type Blockchain = Blockchain<S, F>;
@@ -222,7 +221,7 @@ where
S: BlockchainStorage<Block>,
F: Fetcher<Block>,
H: Hasher<Out=Block::Hash>,
H::Out: HeapSizeOf + Ord,
H::Out: Ord,
{
fn is_local_state_available(&self, block: &BlockId<Block>) -> bool {
self.genesis_state.read().is_some()
@@ -238,7 +237,7 @@ where
F: Fetcher<Block>,
S: BlockchainStorage<Block>,
H: Hasher<Out=Block::Hash>,
H::Out: HeapSizeOf + Ord,
H::Out: Ord,
{
type State = OnDemandOrGenesisState<Block, S, F, H>;
@@ -390,7 +389,7 @@ where
F: Fetcher<Block>,
S: BlockchainStorage<Block>,
H: Hasher<Out=Block::Hash>,
H::Out: HeapSizeOf + Ord,
H::Out: Ord,
{
type Error = ClientError;
type Transaction = ();
@@ -41,7 +41,6 @@ use crate::call_executor::CallExecutor;
use crate::error::{Error as ClientError, Result as ClientResult};
use crate::light::fetcher::{Fetcher, RemoteCallRequest};
use executor::{RuntimeVersion, NativeVersion};
use heapsize::HeapSizeOf;
use trie::MemoryDB;
/// Call executor that executes methods on remote node, querying execution proof
@@ -436,7 +435,7 @@ pub fn check_execution_proof<Header, E, H>(
Header: HeaderT,
E: CodeExecutor<H>,
H: Hasher,
H::Out: Ord + HeapSizeOf,
H::Out: Ord,
{
let local_state_root = request.header.state_root();
let root: H::Out = convert_hash(&local_state_root);
+3 -4
View File
@@ -22,7 +22,6 @@ use std::marker::PhantomData;
use futures::IntoFuture;
use hash_db::{HashDB, Hasher};
use heapsize::HeapSizeOf;
use primitives::{ChangesTrieConfiguration, convert_hash};
use runtime_primitives::traits::{As, Block as BlockT, Header as HeaderT, NumberFor};
use state_machine::{CodeExecutor, ChangesTrieRootsStorage, ChangesTrieAnchorBlockId,
@@ -188,7 +187,7 @@ impl<E, H, B: BlockT, S: BlockchainStorage<B>, F> LightDataChecker<E, H, B, S, F
) -> ClientResult<Vec<(NumberFor<B>, u32)>>
where
H: Hasher,
H::Out: Ord + HeapSizeOf,
H::Out: Ord,
{
// since we need roots of all changes tries for the range begin..max
// => remote node can't use max block greater that one that we have passed
@@ -259,7 +258,7 @@ impl<E, H, B: BlockT, S: BlockchainStorage<B>, F> LightDataChecker<E, H, B, S, F
) -> ClientResult<()>
where
H: Hasher,
H::Out: Ord + HeapSizeOf,
H::Out: Ord,
{
// all the checks are sharing the same storage
let storage = create_proof_check_backend_storage(remote_roots_proof);
@@ -309,7 +308,7 @@ impl<E, Block, H, S, F> FetchChecker<Block> for LightDataChecker<E, H, Block, S,
Block: BlockT,
E: CodeExecutor<H>,
H: Hasher,
H::Out: Ord + HeapSizeOf,
H::Out: Ord,
S: BlockchainStorage<Block>,
F: Send + Sync,
{