mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
use state cache to optimise historical state lookup (#4228)
## Issue Addressed #3873 ## Proposed Changes add a cache to optimise historical state lookup. ## Additional Info N/A Co-authored-by: Michael Sproul <micsproul@gmail.com>
This commit is contained in:
@@ -519,6 +519,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.help("Specifies how many blocks the database should cache in memory [default: 5]")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("historic-state-cache-size")
|
||||
.long("historic-state-cache-size")
|
||||
.value_name("SIZE")
|
||||
.help("Specifies how many states from the freezer database should cache in memory [default: 1]")
|
||||
.takes_value(true)
|
||||
)
|
||||
/*
|
||||
* Execution Layer Integration
|
||||
*/
|
||||
|
||||
@@ -383,6 +383,12 @@ pub fn get_config<E: EthSpec>(
|
||||
.map_err(|_| "block-cache-size is not a valid integer".to_string())?;
|
||||
}
|
||||
|
||||
if let Some(historic_state_cache_size) = cli_args.value_of("historic-state-cache-size") {
|
||||
client_config.store.historic_state_cache_size = historic_state_cache_size
|
||||
.parse()
|
||||
.map_err(|_| "historic-state-cache-size is not a valid integer".to_string())?;
|
||||
}
|
||||
|
||||
client_config.store.compact_on_init = cli_args.is_present("compact-db");
|
||||
if let Some(compact_on_prune) = cli_args.value_of("auto-compact-db") {
|
||||
client_config.store.compact_on_prune = compact_on_prune
|
||||
|
||||
Reference in New Issue
Block a user