mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 11:41:51 +00:00
Add Electra fork boilerplate (#5122)
* Add Electra fork boilerplate * Remove electra from spec tests * Fix tests * Remove sneaky log file * Fix more tests * Fix even more tests and add suggestions * Remove unrelated lcli addition * Update more tests * Merge branch 'unstable' into electra * Add comment for test-suite lcli override * Merge branch 'unstable' into electra * Cleanup * Merge branch 'unstable' into electra * Apply suggestions * Merge branch 'unstable' into electra * Merge sigp/unstable into electra * Merge branch 'unstable' into electra
This commit is contained in:
@@ -2,6 +2,7 @@ use crate::metrics;
|
||||
use beacon_chain::{
|
||||
capella_readiness::CapellaReadiness,
|
||||
deneb_readiness::DenebReadiness,
|
||||
electra_readiness::ElectraReadiness,
|
||||
merge_readiness::{GenesisExecutionPayloadStatus, MergeConfig, MergeReadiness},
|
||||
BeaconChain, BeaconChainTypes, ExecutionStatus,
|
||||
};
|
||||
@@ -321,6 +322,7 @@ pub fn spawn_notifier<T: BeaconChainTypes>(
|
||||
merge_readiness_logging(current_slot, &beacon_chain, &log).await;
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -512,8 +514,7 @@ async fn deneb_readiness_logging<T: BeaconChainTypes>(
|
||||
error!(
|
||||
log,
|
||||
"Execution endpoint required";
|
||||
"info" => "you need a Deneb enabled execution engine to validate blocks, see: \
|
||||
https://lighthouse-book.sigmaprime.io/merge-migration.html"
|
||||
"info" => "you need a Deneb enabled execution engine to validate blocks."
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -542,6 +543,66 @@ async fn deneb_readiness_logging<T: BeaconChainTypes>(
|
||||
),
|
||||
}
|
||||
}
|
||||
/// Provides some helpful logging to users to indicate if their node is ready for Electra.
|
||||
async fn electra_readiness_logging<T: BeaconChainTypes>(
|
||||
current_slot: Slot,
|
||||
beacon_chain: &BeaconChain<T>,
|
||||
log: &Logger,
|
||||
) {
|
||||
// TODO(electra): Once Electra has features, this code can be swapped back.
|
||||
let electra_completed = false;
|
||||
//let electra_completed = beacon_chain
|
||||
// .canonical_head
|
||||
// .cached_head()
|
||||
// .snapshot
|
||||
// .beacon_block
|
||||
// .message()
|
||||
// .body()
|
||||
// .execution_payload()
|
||||
// .map_or(false, |payload| payload.electra_placeholder().is_ok());
|
||||
|
||||
let has_execution_layer = beacon_chain.execution_layer.is_some();
|
||||
|
||||
if electra_completed && has_execution_layer
|
||||
|| !beacon_chain.is_time_to_prepare_for_electra(current_slot)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if electra_completed && !has_execution_layer {
|
||||
// When adding a new fork, add a check for the next fork readiness here.
|
||||
error!(
|
||||
log,
|
||||
"Execution endpoint required";
|
||||
"info" => "you need a Electra enabled execution engine to validate blocks."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
match beacon_chain.check_electra_readiness().await {
|
||||
ElectraReadiness::Ready => {
|
||||
info!(
|
||||
log,
|
||||
"Ready for Electra";
|
||||
"info" => "ensure the execution endpoint is updated to the latest Electra/Prague release"
|
||||
)
|
||||
}
|
||||
readiness @ ElectraReadiness::ExchangeCapabilitiesFailed { error: _ } => {
|
||||
error!(
|
||||
log,
|
||||
"Not ready for Electra";
|
||||
"hint" => "the execution endpoint may be offline",
|
||||
"info" => %readiness,
|
||||
)
|
||||
}
|
||||
readiness => warn!(
|
||||
log,
|
||||
"Not ready for Electra";
|
||||
"hint" => "try updating the execution endpoint",
|
||||
"info" => %readiness,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
async fn genesis_execution_payload_logging<T: BeaconChainTypes>(
|
||||
beacon_chain: &BeaconChain<T>,
|
||||
|
||||
Reference in New Issue
Block a user