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
+4 -10
View File
@@ -51,8 +51,8 @@ use sp_api::{
ProvideRuntimeApi,
};
use sp_blockchain::{
self as blockchain, well_known_cache_keys::Id as CacheKeyId, Backend as ChainBackend,
CachedHeaderMetadata, Error, HeaderBackend as ChainHeaderBackend, HeaderMetadata,
self as blockchain, Backend as ChainBackend, CachedHeaderMetadata, Error,
HeaderBackend as ChainHeaderBackend, HeaderMetadata,
};
use sp_consensus::{BlockOrigin, BlockStatus, Error as ConsensusError};
@@ -504,7 +504,6 @@ where
&self,
operation: &mut ClientImportOperation<Block, B>,
import_block: BlockImportParams<Block, backend::TransactionFor<B, Block>>,
new_cache: HashMap<CacheKeyId, Vec<u8>>,
storage_changes: Option<
sc_consensus::StorageChanges<Block, backend::TransactionFor<B, Block>>,
>,
@@ -559,7 +558,6 @@ where
body,
indexed_body,
storage_changes,
new_cache,
finalized,
auxiliary,
fork_choice,
@@ -599,7 +597,6 @@ where
storage_changes: Option<
sc_consensus::StorageChanges<Block, backend::TransactionFor<B, Block>>,
>,
new_cache: HashMap<CacheKeyId, Vec<u8>>,
finalized: bool,
aux: Vec<(Vec<u8>, Option<Vec<u8>>)>,
fork_choice: ForkChoiceStrategy,
@@ -712,7 +709,6 @@ where
},
};
operation.op.update_cache(new_cache);
storage_changes
},
None => None,
@@ -1770,7 +1766,6 @@ where
async fn import_block(
&mut self,
mut import_block: BlockImportParams<Block, backend::TransactionFor<B, Block>>,
new_cache: HashMap<CacheKeyId, Vec<u8>>,
) -> Result<ImportResult, Self::Error> {
let span = tracing::span!(tracing::Level::DEBUG, "import_block");
let _enter = span.enter();
@@ -1785,7 +1780,7 @@ where
};
self.lock_import_and_run(|operation| {
self.apply_block(operation, import_block, new_cache, storage_changes)
self.apply_block(operation, import_block, storage_changes)
})
.map_err(|e| {
warn!("Block import error: {}", e);
@@ -1875,9 +1870,8 @@ where
async fn import_block(
&mut self,
import_block: BlockImportParams<Block, Self::Transaction>,
new_cache: HashMap<CacheKeyId, Vec<u8>>,
) -> Result<ImportResult, Self::Error> {
(&*self).import_block(import_block, new_cache).await
(&*self).import_block(import_block).await
}
async fn check_block(