mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
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:
@@ -18,7 +18,6 @@
|
||||
|
||||
use crate::arg_enums::Database;
|
||||
use clap::Args;
|
||||
use sc_service::TransactionStorageMode;
|
||||
|
||||
/// Parameters for block import.
|
||||
#[derive(Debug, Clone, PartialEq, Args)]
|
||||
@@ -36,15 +35,6 @@ pub struct DatabaseParams {
|
||||
/// Limit the memory the database cache can use.
|
||||
#[clap(long = "db-cache", value_name = "MiB")]
|
||||
pub database_cache_size: Option<usize>,
|
||||
|
||||
/// Enable storage chain mode
|
||||
///
|
||||
/// This changes the storage format for blocks bodies.
|
||||
/// If this is enabled, each transaction is stored separately in the
|
||||
/// transaction database column and is only referenced by hash
|
||||
/// in the block body column.
|
||||
#[clap(long)]
|
||||
pub storage_chain: bool,
|
||||
}
|
||||
|
||||
impl DatabaseParams {
|
||||
@@ -57,13 +47,4 @@ impl DatabaseParams {
|
||||
pub fn database_cache_size(&self) -> Option<usize> {
|
||||
self.database_cache_size
|
||||
}
|
||||
|
||||
/// Transaction storage scheme.
|
||||
pub fn transaction_storage(&self) -> TransactionStorageMode {
|
||||
if self.storage_chain {
|
||||
TransactionStorageMode::StorageChain
|
||||
} else {
|
||||
TransactionStorageMode::BlockBody
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user