mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Add cache for parallel HTTP requests (#4879)
This commit is contained in:
@@ -15,6 +15,9 @@ pub const DEFAULT_PREPARE_PAYLOAD_LOOKAHEAD_FACTOR: u32 = 3;
|
||||
/// Fraction of a slot lookahead for fork choice in the state advance timer (500ms on mainnet).
|
||||
pub const FORK_CHOICE_LOOKAHEAD_FACTOR: u32 = 24;
|
||||
|
||||
/// Cache only a small number of states in the parallel cache by default.
|
||||
pub const DEFAULT_PARALLEL_STATE_CACHE_SIZE: usize = 2;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
||||
pub struct ChainConfig {
|
||||
/// Maximum number of slots to skip when importing an attestation.
|
||||
@@ -83,6 +86,8 @@ pub struct ChainConfig {
|
||||
pub progressive_balances_mode: ProgressiveBalancesMode,
|
||||
/// Number of epochs between each migration of data from the hot database to the freezer.
|
||||
pub epochs_per_migration: u64,
|
||||
/// Size of the promise cache for de-duplicating parallel state requests.
|
||||
pub parallel_state_cache_size: usize,
|
||||
}
|
||||
|
||||
impl Default for ChainConfig {
|
||||
@@ -114,6 +119,7 @@ impl Default for ChainConfig {
|
||||
always_prepare_payload: false,
|
||||
progressive_balances_mode: ProgressiveBalancesMode::Fast,
|
||||
epochs_per_migration: crate::migrate::DEFAULT_EPOCHS_PER_MIGRATION,
|
||||
parallel_state_cache_size: DEFAULT_PARALLEL_STATE_CACHE_SIZE,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user