Configurable diff buffer cache size (#4420)

This commit is contained in:
Michael Sproul
2023-06-20 19:10:05 +10:00
committed by GitHub
parent d56cec83fc
commit 6eb151396d
4 changed files with 20 additions and 6 deletions

View File

@@ -665,6 +665,14 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.help("Specifies how many states the database should cache in memory [default: 128]")
.takes_value(true)
)
.arg(
Arg::with_name("diff-buffer-cache-size")
.long("diff-buffer-cache-size")
.value_name("SIZE")
.help("The maximum number of diff buffers to hold in memory. This cache is used \
when fetching historic states [default: 16]")
.takes_value(true)
)
.arg(
Arg::with_name("compression-level")
.long("compression-level")

View File

@@ -390,6 +390,11 @@ pub fn get_config<E: EthSpec>(
if let Some(state_cache_size) = clap_utils::parse_optional(cli_args, "state-cache-size")? {
client_config.store.state_cache_size = state_cache_size;
}
if let Some(diff_buffer_cache_size) =
clap_utils::parse_optional(cli_args, "diff-buffer-cache-size")?
{
client_config.store.diff_buffer_cache_size = diff_buffer_cache_size;
}
if let Some(compression_level) = clap_utils::parse_optional(cli_args, "compression-level")? {
client_config.store.compression_level = compression_level;
}