mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 10:52:43 +00:00
Merge branch 'unstable' into vc-fallback
This commit is contained in:
@@ -288,13 +288,13 @@ pub(crate) async fn verify_light_client_updates<E: EthSpec>(
|
||||
}
|
||||
|
||||
// Verify light client optimistic update. `signature_slot_distance` should be 1 in the ideal scenario.
|
||||
let signature_slot = client
|
||||
let signature_slot = *client
|
||||
.get_beacon_light_client_optimistic_update::<E>()
|
||||
.await
|
||||
.map_err(|e| format!("Error while getting light client updates: {:?}", e))?
|
||||
.ok_or(format!("Light client optimistic update not found {slot:?}"))?
|
||||
.data
|
||||
.signature_slot;
|
||||
.signature_slot();
|
||||
let signature_slot_distance = slot - signature_slot;
|
||||
if signature_slot_distance > light_client_update_slot_tolerance {
|
||||
return Err(format!("Existing optimistic update too old: signature slot {signature_slot}, current slot {slot:?}"));
|
||||
@@ -317,13 +317,13 @@ pub(crate) async fn verify_light_client_updates<E: EthSpec>(
|
||||
}
|
||||
continue;
|
||||
}
|
||||
let signature_slot = client
|
||||
let signature_slot = *client
|
||||
.get_beacon_light_client_finality_update::<E>()
|
||||
.await
|
||||
.map_err(|e| format!("Error while getting light client updates: {:?}", e))?
|
||||
.ok_or(format!("Light client finality update not found {slot:?}"))?
|
||||
.data
|
||||
.signature_slot;
|
||||
.signature_slot();
|
||||
let signature_slot_distance = slot - signature_slot;
|
||||
if signature_slot_distance > light_client_update_slot_tolerance {
|
||||
return Err(format!(
|
||||
|
||||
@@ -4,10 +4,10 @@ use std::pin::Pin;
|
||||
|
||||
/// Executes the function with a specified number of retries if the function returns an error.
|
||||
/// Once it exceeds `max_retries` and still fails, the error is returned.
|
||||
pub async fn with_retry<T, E, F>(max_retries: usize, mut func: F) -> Result<T, E>
|
||||
pub async fn with_retry<T, U, F>(max_retries: usize, mut func: F) -> Result<T, U>
|
||||
where
|
||||
F: FnMut() -> Pin<Box<dyn Future<Output = Result<T, E>>>>,
|
||||
E: Debug,
|
||||
F: FnMut() -> Pin<Box<dyn Future<Output = Result<T, U>>>>,
|
||||
U: Debug,
|
||||
{
|
||||
let mut retry_count = 0;
|
||||
loop {
|
||||
|
||||
@@ -94,8 +94,6 @@ fn syncing_sim(
|
||||
beacon_config.dummy_eth1_backend = true;
|
||||
beacon_config.sync_eth1_chain = true;
|
||||
|
||||
beacon_config.http_api.allow_sync_stalled = true;
|
||||
|
||||
beacon_config.network.enr_address = (Some(Ipv4Addr::LOCALHOST), None);
|
||||
|
||||
// Generate the directories and keystores required for the validator clients.
|
||||
|
||||
Reference in New Issue
Block a user