Merge branch 'unstable' into vc-fallback

This commit is contained in:
Mac L
2024-04-15 21:31:51 +10:00
574 changed files with 34664 additions and 12047 deletions

View File

@@ -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!(

View File

@@ -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 {

View File

@@ -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.