mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Merge unstable 20230925 into deneb-free-blobs.
This commit is contained in:
@@ -259,7 +259,7 @@ where
|
||||
"Starting from known genesis state";
|
||||
);
|
||||
|
||||
let genesis_state = genesis_state(&runtime_context, &config, log)?;
|
||||
let genesis_state = genesis_state(&runtime_context, &config, log).await?;
|
||||
|
||||
builder.genesis_state(genesis_state).map(|v| (v, None))?
|
||||
}
|
||||
@@ -279,7 +279,7 @@ where
|
||||
.map_err(|e| format!("Unable to parse weak subj state SSZ: {:?}", e))?;
|
||||
let anchor_block = SignedBeaconBlock::from_ssz_bytes(&anchor_block_bytes, &spec)
|
||||
.map_err(|e| format!("Unable to parse weak subj block SSZ: {:?}", e))?;
|
||||
let genesis_state = genesis_state(&runtime_context, &config, log)?;
|
||||
let genesis_state = genesis_state(&runtime_context, &config, log).await?;
|
||||
|
||||
builder
|
||||
.weak_subjectivity_state(anchor_state, anchor_block, genesis_state)
|
||||
@@ -380,7 +380,7 @@ where
|
||||
|
||||
debug!(context.log(), "Downloaded finalized block");
|
||||
|
||||
let genesis_state = genesis_state(&runtime_context, &config, log)?;
|
||||
let genesis_state = genesis_state(&runtime_context, &config, log).await?;
|
||||
|
||||
info!(
|
||||
context.log(),
|
||||
@@ -1099,7 +1099,7 @@ where
|
||||
}
|
||||
|
||||
/// Obtain the genesis state from the `eth2_network_config` in `context`.
|
||||
fn genesis_state<T: EthSpec>(
|
||||
async fn genesis_state<T: EthSpec>(
|
||||
context: &RuntimeContext<T>,
|
||||
config: &ClientConfig,
|
||||
log: &Logger,
|
||||
@@ -1113,6 +1113,7 @@ fn genesis_state<T: EthSpec>(
|
||||
config.genesis_state_url.as_deref(),
|
||||
config.genesis_state_url_timeout,
|
||||
log,
|
||||
)?
|
||||
)
|
||||
.await?
|
||||
.ok_or_else(|| "Genesis state is unknown".to_string())
|
||||
}
|
||||
|
||||
@@ -46,20 +46,6 @@ impl<T: BeaconChainTypes> Client<T> {
|
||||
self.http_metrics_listen_addr
|
||||
}
|
||||
|
||||
/// Returns the ipv4 port of the client's libp2p stack, if it was started.
|
||||
pub fn libp2p_listen_ipv4_port(&self) -> Option<u16> {
|
||||
self.network_globals
|
||||
.as_ref()
|
||||
.and_then(|n| n.listen_port_tcp4())
|
||||
}
|
||||
|
||||
/// Returns the ipv6 port of the client's libp2p stack, if it was started.
|
||||
pub fn libp2p_listen_ipv6_port(&self) -> Option<u16> {
|
||||
self.network_globals
|
||||
.as_ref()
|
||||
.and_then(|n| n.listen_port_tcp6())
|
||||
}
|
||||
|
||||
/// Returns the list of libp2p addresses the client is listening to.
|
||||
pub fn libp2p_listen_addresses(&self) -> Option<Vec<Multiaddr>> {
|
||||
self.network_globals.as_ref().map(|n| n.listen_multiaddrs())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::metrics;
|
||||
use beacon_chain::{
|
||||
capella_readiness::CapellaReadiness,
|
||||
merge_readiness::{MergeConfig, MergeReadiness},
|
||||
merge_readiness::{GenesisExecutionPayloadStatus, MergeConfig, MergeReadiness},
|
||||
BeaconChain, BeaconChainTypes, ExecutionStatus,
|
||||
};
|
||||
use lighthouse_network::{types::SyncState, NetworkGlobals};
|
||||
@@ -62,6 +62,9 @@ pub fn spawn_notifier<T: BeaconChainTypes>(
|
||||
"wait_time" => estimated_time_pretty(Some(next_slot.as_secs() as f64)),
|
||||
);
|
||||
eth1_logging(&beacon_chain, &log);
|
||||
merge_readiness_logging(Slot::new(0), &beacon_chain, &log).await;
|
||||
capella_readiness_logging(Slot::new(0), &beacon_chain, &log).await;
|
||||
genesis_execution_payload_logging(&beacon_chain, &log).await;
|
||||
sleep(slot_duration).await;
|
||||
}
|
||||
_ => break,
|
||||
@@ -365,7 +368,7 @@ async fn merge_readiness_logging<T: BeaconChainTypes>(
|
||||
return;
|
||||
}
|
||||
|
||||
match beacon_chain.check_merge_readiness().await {
|
||||
match beacon_chain.check_merge_readiness(current_slot).await {
|
||||
MergeReadiness::Ready {
|
||||
config,
|
||||
current_difficulty,
|
||||
@@ -476,6 +479,79 @@ async fn capella_readiness_logging<T: BeaconChainTypes>(
|
||||
}
|
||||
}
|
||||
|
||||
async fn genesis_execution_payload_logging<T: BeaconChainTypes>(
|
||||
beacon_chain: &BeaconChain<T>,
|
||||
log: &Logger,
|
||||
) {
|
||||
match beacon_chain
|
||||
.check_genesis_execution_payload_is_correct()
|
||||
.await
|
||||
{
|
||||
Ok(GenesisExecutionPayloadStatus::Correct(block_hash)) => {
|
||||
info!(
|
||||
log,
|
||||
"Execution enabled from genesis";
|
||||
"genesis_payload_block_hash" => ?block_hash,
|
||||
);
|
||||
}
|
||||
Ok(GenesisExecutionPayloadStatus::BlockHashMismatch { got, expected }) => {
|
||||
error!(
|
||||
log,
|
||||
"Genesis payload block hash mismatch";
|
||||
"info" => "genesis is misconfigured and likely to fail",
|
||||
"consensus_node_block_hash" => ?expected,
|
||||
"execution_node_block_hash" => ?got,
|
||||
);
|
||||
}
|
||||
Ok(GenesisExecutionPayloadStatus::TransactionsRootMismatch { got, expected }) => {
|
||||
error!(
|
||||
log,
|
||||
"Genesis payload transactions root mismatch";
|
||||
"info" => "genesis is misconfigured and likely to fail",
|
||||
"consensus_node_transactions_root" => ?expected,
|
||||
"execution_node_transactions_root" => ?got,
|
||||
);
|
||||
}
|
||||
Ok(GenesisExecutionPayloadStatus::WithdrawalsRootMismatch { got, expected }) => {
|
||||
error!(
|
||||
log,
|
||||
"Genesis payload withdrawals root mismatch";
|
||||
"info" => "genesis is misconfigured and likely to fail",
|
||||
"consensus_node_withdrawals_root" => ?expected,
|
||||
"execution_node_withdrawals_root" => ?got,
|
||||
);
|
||||
}
|
||||
Ok(GenesisExecutionPayloadStatus::OtherMismatch) => {
|
||||
error!(
|
||||
log,
|
||||
"Genesis payload header mismatch";
|
||||
"info" => "genesis is misconfigured and likely to fail",
|
||||
"detail" => "see debug logs for payload headers"
|
||||
);
|
||||
}
|
||||
Ok(GenesisExecutionPayloadStatus::Irrelevant) => {
|
||||
info!(
|
||||
log,
|
||||
"Execution is not enabled from genesis";
|
||||
);
|
||||
}
|
||||
Ok(GenesisExecutionPayloadStatus::AlreadyHappened) => {
|
||||
warn!(
|
||||
log,
|
||||
"Unable to check genesis which has already occurred";
|
||||
"info" => "this is probably a race condition or a bug"
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
error!(
|
||||
log,
|
||||
"Unable to check genesis execution payload";
|
||||
"error" => ?e
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn eth1_logging<T: BeaconChainTypes>(beacon_chain: &BeaconChain<T>, log: &Logger) {
|
||||
let current_slot_opt = beacon_chain.slot().ok();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user