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:
Pawan Dhananjay
2025-06-22 20:00:07 -07:00
committed by GitHub
parent d50924677a
commit 11bcccb353
59 changed files with 158 additions and 7834 deletions

View File

@@ -702,54 +702,33 @@ pub fn cli_app() -> Command {
/*
* Eth1 Integration
*/
.arg(
Arg::new("eth1")
.long("eth1")
.help("DEPRECATED")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.display_order(0)
.hide(true)
)
.arg(
Arg::new("dummy-eth1")
.long("dummy-eth1")
.help("DEPRECATED")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.conflicts_with("eth1")
.display_order(0)
.hide(true)
)
.arg(
Arg::new("eth1-purge-cache")
.long("eth1-purge-cache")
.value_name("PURGE-CACHE")
.help("Purges the eth1 block and deposit caches")
.help("DEPRECATED")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.display_order(0)
.hide(true)
)
.arg(
Arg::new("eth1-blocks-per-log-query")
.long("eth1-blocks-per-log-query")
.value_name("BLOCKS")
.help("Specifies the number of blocks that a deposit log query should span. \
This will reduce the size of responses from the Eth1 endpoint.")
.default_value("1000")
.help("DEPRECATED")
.action(ArgAction::Set)
.display_order(0)
.hide(true)
)
.arg(
Arg::new("eth1-cache-follow-distance")
.long("eth1-cache-follow-distance")
.value_name("BLOCKS")
.help("Specifies the distance between the Eth1 chain head and the last block which \
should be imported into the cache. Setting this value lower can help \
compensate for irregular Proof-of-Work block times, but setting it too low \
can make the node vulnerable to re-orgs.")
.help("DEPRECATED")
.action(ArgAction::Set)
.display_order(0)
.hide(true)
)
.arg(
Arg::new("slots-per-restore-point")
@@ -1513,13 +1492,12 @@ pub fn cli_app() -> Command {
.arg(
Arg::new("disable-deposit-contract-sync")
.long("disable-deposit-contract-sync")
.help("Explicitly disables syncing of deposit logs from the execution node. \
This overrides any previous option that depends on it. \
Useful if you intend to run a non-validating beacon node.")
.help("DEPRECATED")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.conflicts_with("staking")
.display_order(0)
.hide(true)
)
.arg(
Arg::new("disable-optimistic-finalized-sync")

View File

@@ -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 =

View File

@@ -2,9 +2,7 @@ mod cli;
mod config;
pub use beacon_chain;
use beacon_chain::{
builder::Witness, eth1_chain::CachingEth1Backend, slot_clock::SystemTimeSlotClock,
};
use beacon_chain::{builder::Witness, slot_clock::SystemTimeSlotClock};
use clap::ArgMatches;
pub use cli::cli_app;
pub use client::{Client, ClientBuilder, ClientConfig, ClientGenesis};
@@ -19,15 +17,8 @@ use tracing::{info, warn};
use types::{ChainSpec, Epoch, EthSpec, ForkName};
/// A type-alias to the tighten the definition of a production-intended `Client`.
pub type ProductionClient<E> = Client<
Witness<
SystemTimeSlotClock,
CachingEth1Backend<E>,
E,
BeaconNodeBackend<E>,
BeaconNodeBackend<E>,
>,
>;
pub type ProductionClient<E> =
Client<Witness<SystemTimeSlotClock, E, BeaconNodeBackend<E>, BeaconNodeBackend<E>>>;
/// The beacon node `Client` that will be used in production.
///
@@ -132,22 +123,7 @@ impl<E: EthSpec> ProductionBeaconNode<E> {
let builder = builder
.beacon_chain_builder(client_genesis, client_config.clone())
.await?;
let builder = if client_config.sync_eth1_chain {
info!(
endpoint = ?client_config.eth1.endpoint,
method = "json rpc via http",
"Block production enabled"
);
builder
.caching_eth1_backend(client_config.eth1.clone())
.await?
} else {
info!(
reason = "no eth1 backend configured",
"Block production disabled"
);
builder.no_eth1_backend()?
};
info!("Block production enabled");
let builder = builder.system_time_slot_clock()?;