Add a cli option for the snapshot cache size (#5270)

* Add a cli option for snapshot cache size

* Remove junk

* Make snapshot_cache module public

* lint

* Update docs
This commit is contained in:
Pawan Dhananjay
2024-02-26 10:49:39 +05:30
committed by GitHub
parent de6ede163c
commit 3ab9d3a84e
8 changed files with 42 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ use types::{
};
/// The default size of the cache.
pub const DEFAULT_SNAPSHOT_CACHE_SIZE: usize = 4;
pub const DEFAULT_SNAPSHOT_CACHE_SIZE: usize = 3;
/// The minimum block delay to clone the state in the cache instead of removing it.
/// This helps keep block processing fast during re-orgs from late blocks.
@@ -174,6 +174,7 @@ impl<T: EthSpec> SnapshotCache<T> {
self.snapshots.iter().map(|s| s.beacon_block_root).collect()
}
#[allow(clippy::len_without_is_empty)]
/// The number of snapshots contained in `self`.
pub fn len(&self) -> usize {
self.snapshots.len()