-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Remove discarded blocks and states from database by default #11983
Changes from 5 commits
bc5ba8e
d762b63
e425634
70b21b8
124f586
e2c5674
7bff3cb
da0c426
c519937
3f03c82
940d9db
458e078
a228701
6ae25a1
54a5a2b
9e3e8eb
ac58113
4c3810c
f4ea09b
2b0c25c
6cbc62e
df5ffec
cb62c23
79afe8b
3dff0f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ pub struct PruningParams { | |
pub state_pruning: Option<String>, | ||
/// Specify the number of finalized blocks to keep in the database. | ||
/// | ||
/// Default is to keep all blocks. | ||
/// Default is to keep all of finalized blocks. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we should add that 0 keep all blocks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm,,It's really not very intuitive that 0 keep all blocks. IMO it's a compromise approach now.
hzy1919 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// | ||
/// NOTE: only finalized blocks are subject for removal! | ||
#[clap(alias = "keep-blocks", long, value_name = "COUNT")] | ||
|
@@ -46,7 +46,7 @@ impl PruningParams { | |
.as_ref() | ||
.map(|s| match s.as_str() { | ||
"archive" => Ok(PruningMode::ArchiveAll), | ||
"canonical" => Ok(PruningMode::ArchiveCanonical), | ||
"final" => Ok(PruningMode::ArchiveCanonical), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the doc there is also a "archive-canonical" mention that did not look linked, I would maybe use it instead of "final". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it should be called |
||
bc => bc | ||
.parse() | ||
.map_err(|_| error::Error::Input("Invalid pruning mode specified".to_string())) | ||
|
@@ -58,8 +58,9 @@ impl PruningParams { | |
/// Get the block pruning value from the parameters | ||
pub fn blocks_pruning(&self) -> error::Result<BlocksPruning> { | ||
Ok(match self.blocks_pruning { | ||
Some(0) => BlocksPruning::AllWithNonFinalized, | ||
Some(n) => BlocksPruning::Some(n), | ||
None => BlocksPruning::All, | ||
None => BlocksPruning::AllFinalized, | ||
}) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc for this param should be updated with the new
final
option.