Add Fulu boilerplate (#6695)

* Add Fulu boilerplate

* Add more boilerplate

* Change fulu_time to osaka_time

* Merge branch 'unstable' into fulu-boilerplate

* Fix tests

* Merge branch 'unstable' into fulu-boilerplate

* More test fixes

* Apply suggestions

* Remove `get_payload` boilerplate

* Add lightclient fulu types and fix beacon-chain-tests

* Disable Fulu in ef-tests

* Reduce boilerplate for future forks

* Small fixes

* One more fix

* Apply suggestions

* Merge branch 'unstable' into fulu-boilerplate

* Fix lints
This commit is contained in:
Mac L
2025-01-10 09:25:23 +04:00
committed by GitHub
parent 722573f7ed
commit ecdf2d891f
91 changed files with 2365 additions and 674 deletions

View File

@@ -4,6 +4,7 @@ use beacon_chain::{
capella_readiness::CapellaReadiness,
deneb_readiness::DenebReadiness,
electra_readiness::ElectraReadiness,
fulu_readiness::FuluReadiness,
BeaconChain, BeaconChainTypes, ExecutionStatus,
};
use lighthouse_network::{types::SyncState, NetworkGlobals};
@@ -315,6 +316,7 @@ pub fn spawn_notifier<T: BeaconChainTypes>(
capella_readiness_logging(current_slot, &beacon_chain, &log).await;
deneb_readiness_logging(current_slot, &beacon_chain, &log).await;
electra_readiness_logging(current_slot, &beacon_chain, &log).await;
fulu_readiness_logging(current_slot, &beacon_chain, &log).await;
}
};
@@ -586,6 +588,62 @@ async fn electra_readiness_logging<T: BeaconChainTypes>(
}
}
/// Provides some helpful logging to users to indicate if their node is ready for Fulu.
async fn fulu_readiness_logging<T: BeaconChainTypes>(
current_slot: Slot,
beacon_chain: &BeaconChain<T>,
log: &Logger,
) {
let fulu_completed = beacon_chain
.canonical_head
.cached_head()
.snapshot
.beacon_state
.fork_name_unchecked()
.fulu_enabled();
let has_execution_layer = beacon_chain.execution_layer.is_some();
if fulu_completed && has_execution_layer
|| !beacon_chain.is_time_to_prepare_for_fulu(current_slot)
{
return;
}
if fulu_completed && !has_execution_layer {
error!(
log,
"Execution endpoint required";
"info" => "you need a Fulu enabled execution engine to validate blocks."
);
return;
}
match beacon_chain.check_fulu_readiness().await {
FuluReadiness::Ready => {
info!(
log,
"Ready for Fulu";
"info" => "ensure the execution endpoint is updated to the latest Fulu release"
)
}
readiness @ FuluReadiness::ExchangeCapabilitiesFailed { error: _ } => {
error!(
log,
"Not ready for Fulu";
"hint" => "the execution endpoint may be offline",
"info" => %readiness,
)
}
readiness => warn!(
log,
"Not ready for Fulu";
"hint" => "try updating the execution endpoint",
"info" => %readiness,
),
}
}
async fn genesis_execution_payload_logging<T: BeaconChainTypes>(
beacon_chain: &BeaconChain<T>,
log: &Logger,