mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
Remove all prod eth1 related code (#7133)
N/A After the electra fork which includes EIP 6110, the beacon node no longer needs the eth1 bridging mechanism to include new deposits as they are provided by the EL as a `deposit_request`. So after electra + a transition period where the finalized bridge deposits pre-fork are included through the old mechanism, we no longer need the elaborate machinery we had to get deposit contract data from the execution layer. Since holesky has already forked to electra and completed the transition period, this PR basically checks to see if removing all the eth1 related logic leads to any surprises.
This commit is contained in:
@@ -13,12 +13,10 @@ use client::{ClientConfig, ClientGenesis};
|
||||
use directory::{DEFAULT_BEACON_NODE_DIR, DEFAULT_NETWORK_DIR, DEFAULT_ROOT_DIR};
|
||||
use environment::RuntimeContext;
|
||||
use execution_layer::DEFAULT_JWT_FILE;
|
||||
use genesis::Eth1Endpoint;
|
||||
use http_api::TlsConfig;
|
||||
use lighthouse_network::ListenAddress;
|
||||
use lighthouse_network::{multiaddr::Protocol, Enr, Multiaddr, NetworkConfig, PeerIdSerialized};
|
||||
use sensitive_url::SensitiveUrl;
|
||||
use std::cmp::max;
|
||||
use std::collections::HashSet;
|
||||
use std::fmt::Debug;
|
||||
use std::fs;
|
||||
@@ -266,31 +264,21 @@ pub fn get_config<E: EthSpec>(
|
||||
}
|
||||
|
||||
/*
|
||||
* Eth1
|
||||
* Deprecated Eth1 flags (can be removed in the next minor release after v7.1.0)
|
||||
*/
|
||||
|
||||
if cli_args.get_flag("dummy-eth1") {
|
||||
warn!("The --dummy-eth1 flag is deprecated");
|
||||
}
|
||||
|
||||
if cli_args.get_flag("eth1") {
|
||||
warn!("The --eth1 flag is deprecated");
|
||||
}
|
||||
|
||||
if let Some(val) = cli_args.get_one::<String>("eth1-blocks-per-log-query") {
|
||||
client_config.eth1.blocks_per_log_query = val
|
||||
.parse()
|
||||
.map_err(|_| "eth1-blocks-per-log-query is not a valid integer".to_string())?;
|
||||
if cli_args
|
||||
.get_one::<String>("eth1-blocks-per-log-query")
|
||||
.is_some()
|
||||
{
|
||||
warn!("The eth1-blocks-per-log-query flag is deprecated");
|
||||
}
|
||||
|
||||
if cli_args.get_flag("eth1-purge-cache") {
|
||||
client_config.eth1.purge_cache = true;
|
||||
warn!("The eth1-purge-cache flag is deprecated");
|
||||
}
|
||||
|
||||
if let Some(follow_distance) =
|
||||
clap_utils::parse_optional(cli_args, "eth1-cache-follow-distance")?
|
||||
{
|
||||
client_config.eth1.cache_follow_distance = Some(follow_distance);
|
||||
if clap_utils::parse_optional::<u64>(cli_args, "eth1-cache-follow-distance")?.is_some() {
|
||||
warn!("The eth1-purge-cache flag is deprecated");
|
||||
}
|
||||
|
||||
// `--execution-endpoint` is required now.
|
||||
@@ -358,13 +346,6 @@ pub fn get_config<E: EthSpec>(
|
||||
clap_utils::parse_required(cli_args, "execution-timeout-multiplier")?;
|
||||
el_config.execution_timeout_multiplier = Some(execution_timeout_multiplier);
|
||||
|
||||
client_config.eth1.endpoint = Eth1Endpoint::Auth {
|
||||
endpoint: execution_endpoint,
|
||||
jwt_path: secret_file,
|
||||
jwt_id: el_config.jwt_id.clone(),
|
||||
jwt_version: el_config.jwt_version.clone(),
|
||||
};
|
||||
|
||||
// Store the EL config in the client config.
|
||||
client_config.execution_layer = Some(el_config);
|
||||
|
||||
@@ -506,20 +487,9 @@ pub fn get_config<E: EthSpec>(
|
||||
.as_ref()
|
||||
.ok_or("Context is missing eth2 network config")?;
|
||||
|
||||
client_config.eth1.deposit_contract_address = format!("{:?}", spec.deposit_contract_address);
|
||||
client_config.eth1.deposit_contract_deploy_block =
|
||||
eth2_network_config.deposit_contract_deploy_block;
|
||||
client_config.eth1.lowest_cached_block_number =
|
||||
client_config.eth1.deposit_contract_deploy_block;
|
||||
client_config.eth1.follow_distance = spec.eth1_follow_distance;
|
||||
client_config.eth1.node_far_behind_seconds =
|
||||
max(5, spec.eth1_follow_distance / 2) * spec.seconds_per_eth1_block;
|
||||
client_config.eth1.chain_id = spec.deposit_chain_id.into();
|
||||
client_config.eth1.set_block_cache_truncation::<E>(spec);
|
||||
|
||||
info!(
|
||||
deploy_block = client_config.eth1.deposit_contract_deploy_block,
|
||||
address = &client_config.eth1.deposit_contract_address,
|
||||
deploy_block = eth2_network_config.deposit_contract_deploy_block,
|
||||
address = ?spec.deposit_contract_address,
|
||||
"Deposit contract"
|
||||
);
|
||||
|
||||
@@ -815,9 +785,8 @@ pub fn get_config<E: EthSpec>(
|
||||
}
|
||||
}
|
||||
|
||||
// Note: This overrides any previous flags that enable this option.
|
||||
if cli_args.get_flag("disable-deposit-contract-sync") {
|
||||
client_config.sync_eth1_chain = false;
|
||||
warn!("The disable-deposit-contract-sync flag is deprecated");
|
||||
}
|
||||
|
||||
client_config.chain.prepare_payload_lookahead =
|
||||
|
||||
Reference in New Issue
Block a user