Refactored block body database scheme (#10779)

* Refactored tx storage database scheme

* Bump parity-db

* fmt

* Fix handling invalid index size + test

* Removed superflous result

* Minor changes

* fmt
This commit is contained in:
Arkadiy Paronyan
2022-03-04 11:30:29 +01:00
committed by GitHub
parent e6b6c8aac6
commit 2bd493ff12
15 changed files with 332 additions and 295 deletions
@@ -23,9 +23,7 @@ use sc_block_builder::BlockBuilderProvider;
use sc_client_api::{
in_mem, BlockBackend, BlockchainEvents, FinalityNotifications, StorageProvider,
};
use sc_client_db::{
Backend, DatabaseSettings, DatabaseSource, KeepBlocks, PruningMode, TransactionStorageMode,
};
use sc_client_db::{Backend, DatabaseSettings, DatabaseSource, KeepBlocks, PruningMode};
use sc_consensus::{
BlockCheckParams, BlockImport, BlockImportParams, ForkChoiceStrategy, ImportResult,
};
@@ -1203,7 +1201,6 @@ fn doesnt_import_blocks_that_revert_finality() {
state_cache_child_ratio: None,
state_pruning: PruningMode::ArchiveAll,
keep_blocks: KeepBlocks::All,
transaction_storage: TransactionStorageMode::BlockBody,
source: DatabaseSource::RocksDb { path: tmp.path().into(), cache_size: 1024 },
},
u64::MAX,
@@ -1419,7 +1416,6 @@ fn returns_status_for_pruned_blocks() {
state_cache_child_ratio: None,
state_pruning: PruningMode::keep_blocks(1),
keep_blocks: KeepBlocks::All,
transaction_storage: TransactionStorageMode::BlockBody,
source: DatabaseSource::RocksDb { path: tmp.path().into(), cache_size: 1024 },
},
u64::MAX,
+1 -2
View File
@@ -30,7 +30,7 @@ use sc_service::{
client::Client,
config::{BasePath, DatabaseSource, KeystoreConfig},
ChainSpecExtension, Configuration, Error, GenericChainSpec, KeepBlocks, Role, RuntimeGenesis,
SpawnTaskHandle, TaskManager, TransactionStorageMode,
SpawnTaskHandle, TaskManager,
};
use sc_transaction_pool_api::TransactionPool;
use sp_api::BlockId;
@@ -235,7 +235,6 @@ fn node_config<
state_cache_child_ratio: None,
state_pruning: Default::default(),
keep_blocks: KeepBlocks::All,
transaction_storage: TransactionStorageMode::BlockBody,
chain_spec: Box::new((*spec).clone()),
wasm_method: sc_service::config::WasmExecutionMethod::Interpreted,
wasm_runtime_overrides: Default::default(),