Fix UnableToReadSlot at startup (#3066)

## Issue Addressed

Don't send an fcU message at startup if it's pre-genesis. The startup fcU message is not critical, not required by the spec, so it's fine to avoid it for networks that start post-Bellatrix fork.
This commit is contained in:
Paul Hauner 2022-03-09 23:04:19 +00:00
parent 65eaf01942
commit c475499dfe

View File

@ -662,14 +662,12 @@ where
); );
if let Some(execution_layer) = beacon_chain.execution_layer.as_ref() { if let Some(execution_layer) = beacon_chain.execution_layer.as_ref() {
// Only send a head update *after* genesis.
if let Ok(current_slot) = beacon_chain.slot() {
let head = beacon_chain let head = beacon_chain
.head_info() .head_info()
.map_err(|e| format!("Unable to read beacon chain head: {:?}", e))?; .map_err(|e| format!("Unable to read beacon chain head: {:?}", e))?;
let current_slot = beacon_chain
.slot()
.map_err(|e| format!("Unable to read slot: {:?}", e))?;
// Issue the head to the execution engine on startup. This ensures it can start // Issue the head to the execution engine on startup. This ensures it can start
// syncing. // syncing.
if head if head
@ -706,13 +704,15 @@ where
execution_layer.spawn_watchdog_routine(beacon_chain.slot_clock.clone()); execution_layer.spawn_watchdog_routine(beacon_chain.slot_clock.clone());
// Spawn a routine that removes expired proposer preparations. // Spawn a routine that removes expired proposer preparations.
execution_layer.spawn_clean_proposer_preparation_routine::<TSlotClock, TEthSpec>( execution_layer
.spawn_clean_proposer_preparation_routine::<TSlotClock, TEthSpec>(
beacon_chain.slot_clock.clone(), beacon_chain.slot_clock.clone(),
); );
// Spawns a routine that polls the `exchange_transition_configuration` endpoint. // Spawns a routine that polls the `exchange_transition_configuration` endpoint.
execution_layer.spawn_transition_configuration_poll(beacon_chain.spec.clone()); execution_layer.spawn_transition_configuration_poll(beacon_chain.spec.clone());
} }
}
start_proposer_prep_service(runtime_context.executor.clone(), beacon_chain.clone()); start_proposer_prep_service(runtime_context.executor.clone(), beacon_chain.clone());
} }