mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
Remove discarded blocks and states from database by default (#11983)
* 1.Add pruning param "canonical" in sc-cli. 2.Make PruningMode's default value to ArchiveCanonical. * Update tests in sc-state-db. * Update tests in sc-state-db. * 1.Add a new value `AllWithNonFinalized` in `enum BlocksPruning` which Corresponds to `blocks_pruning 0` in CLI . 2.Change value `All` to `AllFinalized` in `enum BlocksPruning` and make it to keep full finalized block history. * Make some corresponding adjustments based on the content in the conversation. * Update client/db/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Apply suggestions from code review. * 1.Change `blocks_pruning` to be like `state_pruning` . * Fmt and add some doc. * Update client/cli/src/params/pruning_params.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update client/cli/src/params/pruning_params.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update doc. * Change `new_test_with_tx_storage` to take `BlocksPruning`. * Fmt Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -1200,7 +1200,7 @@ fn doesnt_import_blocks_that_revert_finality() {
|
||||
DatabaseSettings {
|
||||
trie_cache_maximum_size: Some(1 << 20),
|
||||
state_pruning: Some(PruningMode::ArchiveAll),
|
||||
blocks_pruning: BlocksPruning::All,
|
||||
blocks_pruning: BlocksPruning::KeepAll,
|
||||
source: DatabaseSource::RocksDb { path: tmp.path().into(), cache_size: 1024 },
|
||||
},
|
||||
u64::MAX,
|
||||
@@ -1426,7 +1426,7 @@ fn returns_status_for_pruned_blocks() {
|
||||
DatabaseSettings {
|
||||
trie_cache_maximum_size: Some(1 << 20),
|
||||
state_pruning: Some(PruningMode::blocks_pruning(1)),
|
||||
blocks_pruning: BlocksPruning::All,
|
||||
blocks_pruning: BlocksPruning::KeepFinalized,
|
||||
source: DatabaseSource::RocksDb { path: tmp.path().into(), cache_size: 1024 },
|
||||
},
|
||||
u64::MAX,
|
||||
|
||||
@@ -237,7 +237,7 @@ fn node_config<
|
||||
database: DatabaseSource::RocksDb { path: root.join("db"), cache_size: 128 },
|
||||
trie_cache_maximum_size: Some(16 * 1024 * 1024),
|
||||
state_pruning: Default::default(),
|
||||
blocks_pruning: BlocksPruning::All,
|
||||
blocks_pruning: BlocksPruning::KeepFinalized,
|
||||
chain_spec: Box::new((*spec).clone()),
|
||||
wasm_method: sc_service::config::WasmExecutionMethod::Interpreted,
|
||||
wasm_runtime_overrides: Default::default(),
|
||||
|
||||
Reference in New Issue
Block a user