mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 19:02:42 +00:00
Combine sync distance tolerance flags into one
This commit is contained in:
@@ -47,15 +47,16 @@ const FUTURE_SLOT_TOLERANCE: Slot = Slot::new(1);
|
||||
pub struct Config {
|
||||
/// Disables publishing http api requests to all beacon nodes for select api calls.
|
||||
pub disable_run_on_all: bool,
|
||||
/// Sets the number of slots behind the head a beacon node is allowed to be to still be
|
||||
/// considered `synced`.
|
||||
pub sync_tolerance: Option<u64>,
|
||||
/// Sets the size of the range of the `small` sync distance tier. This range starts immediately
|
||||
/// after `sync_tolerance`.
|
||||
pub small_sync_distance_modifier: Option<u64>,
|
||||
/// Sets the size of the range of the `medium` sync distance tier. This range starts immediately
|
||||
/// after the `small` range.
|
||||
pub medium_sync_distance_modifier: Option<u64>,
|
||||
pub sync_tolerances: BeaconNodeSyncDistanceTiers,
|
||||
// Sets the number of slots behind the head a beacon node is allowed to be to still be
|
||||
// considered `synced`.
|
||||
//pub sync_tolerance: Option<u64>,
|
||||
// Sets the size of the range of the `small` sync distance tier. This range starts immediately
|
||||
// after `sync_tolerance`.
|
||||
//pub small_sync_distance_modifier: Option<u64>,
|
||||
// Sets the size of the range of the `medium` sync distance tier. This range starts immediately
|
||||
// after the `small` range.
|
||||
//pub medium_sync_distance_modifier: Option<u64>,
|
||||
}
|
||||
|
||||
/// Indicates a measurement of latency between the VC and a BN.
|
||||
@@ -358,7 +359,7 @@ impl<T: SlotClock, E: EthSpec> BeaconNodeFallback<T, E> {
|
||||
spec: ChainSpec,
|
||||
log: Logger,
|
||||
) -> Self {
|
||||
let distance_tiers = BeaconNodeSyncDistanceTiers::from_config(&config);
|
||||
let distance_tiers = config.sync_tolerances;
|
||||
Self {
|
||||
candidates: Arc::new(RwLock::new(candidates)),
|
||||
distance_tiers,
|
||||
|
||||
Reference in New Issue
Block a user