mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
Merge unstable 20230925 into deneb-free-blobs.
This commit is contained in:
@@ -2,45 +2,46 @@
|
||||
name = "client"
|
||||
version = "0.2.0"
|
||||
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
||||
edition = "2021"
|
||||
edition = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_yaml = "0.8.13"
|
||||
operation_pool = { path = "../operation_pool" }
|
||||
tokio = "1.14.0"
|
||||
serde_yaml = { workspace = true }
|
||||
state_processing = { workspace = true }
|
||||
operation_pool = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
state_processing = { path = "../../consensus/state_processing" }
|
||||
beacon_chain = { path = "../beacon_chain" }
|
||||
store = { path = "../store" }
|
||||
network = { path = "../network" }
|
||||
beacon_chain = { workspace = true }
|
||||
store = { workspace = true }
|
||||
network = { workspace = true }
|
||||
timer = { path = "../timer" }
|
||||
lighthouse_network = { path = "../lighthouse_network" }
|
||||
logging = { path = "../../common/logging" }
|
||||
parking_lot = "0.12.0"
|
||||
types = { path = "../../consensus/types" }
|
||||
eth2_config = { path = "../../common/eth2_config" }
|
||||
slot_clock = { path = "../../common/slot_clock" }
|
||||
serde = "1.0.116"
|
||||
lighthouse_network = { workspace = true }
|
||||
logging = { workspace = true }
|
||||
parking_lot = { workspace = true }
|
||||
types = { workspace = true }
|
||||
eth2_config = { workspace = true }
|
||||
slot_clock = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_derive = "1.0.116"
|
||||
error-chain = "0.12.4"
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
tokio = "1.14.0"
|
||||
dirs = "3.0.1"
|
||||
eth1 = { path = "../eth1" }
|
||||
eth2 = { path = "../../common/eth2" }
|
||||
sensitive_url = { path = "../../common/sensitive_url" }
|
||||
genesis = { path = "../genesis" }
|
||||
task_executor = { path = "../../common/task_executor" }
|
||||
environment = { path = "../../lighthouse/environment" }
|
||||
lazy_static = "1.4.0"
|
||||
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
|
||||
error-chain = { workspace = true }
|
||||
slog = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
dirs = { workspace = true }
|
||||
eth1 = { workspace = true }
|
||||
eth2 = { workspace = true }
|
||||
sensitive_url = { workspace = true }
|
||||
genesis = { workspace = true }
|
||||
task_executor = { workspace = true }
|
||||
environment = { workspace = true }
|
||||
lazy_static = { workspace = true }
|
||||
lighthouse_metrics = { workspace = true }
|
||||
time = "0.3.5"
|
||||
directory = {path = "../../common/directory"}
|
||||
http_api = { path = "../http_api" }
|
||||
directory = { workspace = true }
|
||||
http_api = { workspace = true }
|
||||
http_metrics = { path = "../http_metrics" }
|
||||
slasher = { path = "../../slasher" }
|
||||
slasher = { workspace = true }
|
||||
slasher_service = { path = "../../slasher/service" }
|
||||
monitoring_api = {path = "../../common/monitoring_api"}
|
||||
execution_layer = { path = "../execution_layer" }
|
||||
beacon_processor = { path = "../beacon_processor" }
|
||||
monitoring_api = { workspace = true }
|
||||
execution_layer = { workspace = true }
|
||||
beacon_processor = { workspace = true }
|
||||
num_cpus = { workspace = true }
|
||||
|
||||
@@ -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