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
+5 -9
View File
@@ -18,12 +18,10 @@
//! Substrate Client data backend
use crate::{
blockchain::{well_known_cache_keys, Backend as BlockchainBackend},
UsageInfo,
};
use std::collections::HashSet;
use parking_lot::RwLock;
use sp_blockchain;
use sp_consensus::BlockOrigin;
use sp_core::offchain::OffchainStorage;
use sp_runtime::{
@@ -35,7 +33,8 @@ use sp_state_machine::{
OffchainChangesCollection, StorageCollection, StorageIterator,
};
use sp_storage::{ChildInfo, StorageData, StorageKey};
use std::collections::{HashMap, HashSet};
use crate::{blockchain::Backend as BlockchainBackend, UsageInfo};
pub use sp_state_machine::{Backend as StateBackend, KeyValueStates};
@@ -179,9 +178,6 @@ pub trait BlockImportOperation<Block: BlockT> {
state: NewBlockState,
) -> sp_blockchain::Result<()>;
/// Update cached data.
fn update_cache(&mut self, cache: HashMap<well_known_cache_keys::Id, Vec<u8>>);
/// Inject storage data into the database.
fn update_db_storage(
&mut self,
+1 -3
View File
@@ -40,7 +40,7 @@ use std::{
use crate::{
backend::{self, NewBlockState},
blockchain::{self, well_known_cache_keys::Id as CacheKeyId, BlockStatus, HeaderBackend},
blockchain::{self, BlockStatus, HeaderBackend},
leaves::LeafSet,
UsageInfo,
};
@@ -549,8 +549,6 @@ where
Ok(())
}
fn update_cache(&mut self, _cache: HashMap<CacheKeyId, Vec<u8>>) {}
fn update_db_storage(
&mut self,
update: <InMemoryBackend<HashFor<Block>> as StateBackend<HashFor<Block>>>::Transaction,