mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-10 21:11:22 +00:00
01f42a4d17
* removed state-cache-size flag from beacon_node/src * removed state-cache-size related lines from store/src/config.rs
25 lines
860 B
Rust
25 lines
860 B
Rust
use serde_derive::{Deserialize, Serialize};
|
|
use types::{EthSpec, MinimalEthSpec};
|
|
|
|
pub const DEFAULT_SLOTS_PER_RESTORE_POINT: u64 = 2048;
|
|
pub const DEFAULT_BLOCK_CACHE_SIZE: usize = 5;
|
|
|
|
/// Database configuration parameters.
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct StoreConfig {
|
|
/// Number of slots to wait between storing restore points in the freezer database.
|
|
pub slots_per_restore_point: u64,
|
|
/// Maximum number of blocks to store in the in-memory block cache.
|
|
pub block_cache_size: usize,
|
|
}
|
|
|
|
impl Default for StoreConfig {
|
|
fn default() -> Self {
|
|
Self {
|
|
// Safe default for tests, shouldn't ever be read by a CLI node.
|
|
slots_per_restore_point: MinimalEthSpec::slots_per_historical_root() as u64,
|
|
block_cache_size: DEFAULT_BLOCK_CACHE_SIZE,
|
|
}
|
|
}
|
|
}
|