consensus: remove caching functionality from block import pipeline (#13551)

* consensus: remove caching functionality from block import pipeline

* client: update docs on Verifier::verify

* node: fix block production benchmark
This commit is contained in:
André Silva
2023-03-07 11:19:19 +00:00
committed by GitHub
parent d86a32630b
commit 13b0f24abd
29 changed files with 103 additions and 214 deletions
@@ -25,7 +25,7 @@ use sp_runtime::{
};
use std::{any::Any, borrow::Cow, collections::HashMap, sync::Arc};
use sp_consensus::{BlockOrigin, CacheKeyId, Error};
use sp_consensus::{BlockOrigin, Error};
/// Block import result.
#[derive(Debug, PartialEq, Eq)]
@@ -348,12 +348,9 @@ pub trait BlockImport<B: BlockT> {
) -> Result<ImportResult, Self::Error>;
/// Import a block.
///
/// Cached data can be accessed through the blockchain cache.
async fn import_block(
&mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>,
) -> Result<ImportResult, Self::Error>;
}
@@ -374,14 +371,11 @@ where
}
/// Import a block.
///
/// Cached data can be accessed through the blockchain cache.
async fn import_block(
&mut self,
block: BlockImportParams<B, Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>,
) -> Result<ImportResult, Self::Error> {
(**self).import_block(block, cache).await
(**self).import_block(block).await
}
}
@@ -405,9 +399,8 @@ where
async fn import_block(
&mut self,
block: BlockImportParams<B, Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>,
) -> Result<ImportResult, Self::Error> {
(&**self).import_block(block, cache).await
(&**self).import_block(block).await
}
}