Configurable epochs-per-state-diff

This commit is contained in:
Michael Sproul
2023-01-31 10:04:12 +11:00
parent 90797a1b04
commit c64d7a48d6
3 changed files with 34 additions and 0 deletions

View File

@@ -566,6 +566,16 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.default_value("4")
.takes_value(true)
)
.arg(
Arg::with_name("epochs-per-state-diff")
.long("epochs-per-state-diff")
.value_name("EPOCHS")
.help("Number of epochs between state diffs stored in the database. Lower values \
result in more writes and more data stored, while higher values result in \
more block replaying and longer load times in case of cache miss.")
.default_value("4")
.takes_value(true)
)
/*
* Misc.
*/

View File

@@ -403,6 +403,12 @@ pub fn get_config<E: EthSpec>(
client_config.store_migrator.epochs_per_run = epochs_per_migration;
}
if let Some(epochs_per_state_diff) =
clap_utils::parse_optional(cli_args, "epochs-per-state-diff")?
{
client_config.store.epochs_per_state_diff = epochs_per_state_diff;
}
/*
* Zero-ports
*