Deprecate eth1 and dummy-eth1 flags (#6566)

* Deprecate eth1/dummy-eth1 flags

* Update book

* Simplify + make staking conflict with disable-deposit-contract
This commit is contained in:
Michael Sproul
2024-11-18 19:36:01 +11:00
committed by GitHub
parent 9fdd53df56
commit c5007eaa1c
7 changed files with 29 additions and 53 deletions

View File

@@ -59,10 +59,6 @@ pub struct Config {
/// Path where the blobs database will be located if blobs should be in a separate database.
pub blobs_db_path: Option<PathBuf>,
pub log_file: PathBuf,
/// If true, the node will use co-ordinated junk for eth1 values.
///
/// This is the method used for the 2019 client interop in Canada.
pub dummy_eth1_backend: bool,
pub sync_eth1_chain: bool,
/// Graffiti to be inserted everytime we create a block if the validator doesn't specify.
pub beacon_graffiti: GraffitiOrigin,
@@ -103,8 +99,7 @@ impl Default for Config {
store: <_>::default(),
network: NetworkConfig::default(),
chain: <_>::default(),
dummy_eth1_backend: false,
sync_eth1_chain: false,
sync_eth1_chain: true,
eth1: <_>::default(),
execution_layer: None,
trusted_setup,

View File

@@ -693,8 +693,7 @@ pub fn cli_app() -> Command {
Arg::new("staking")
.long("staking")
.help("Standard option for a staking beacon node. This will enable the HTTP server \
on localhost:5052 and import deposit logs from the execution node. This is \
equivalent to `--http` on merge-ready networks, or `--http --eth1` pre-merge")
on localhost:5052 and import deposit logs from the execution node.")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.display_order(0)
@@ -706,21 +705,21 @@ pub fn cli_app() -> Command {
.arg(
Arg::new("eth1")
.long("eth1")
.help("If present the node will connect to an eth1 node. This is required for \
block production, you must use this flag if you wish to serve a validator.")
.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")
.help("If present, uses an eth1 backend that generates static dummy data.\
Identical to the method used at the 2019 Canada interop.")
.display_order(0)
.hide(true)
)
.arg(
Arg::new("eth1-purge-cache")
@@ -1489,6 +1488,7 @@ pub fn cli_app() -> Command {
Useful if you intend to run a non-validating beacon node.")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.conflicts_with("staking")
.display_order(0)
)
.arg(

View File

@@ -121,7 +121,6 @@ pub fn get_config<E: EthSpec>(
if cli_args.get_flag("staking") {
client_config.http_api.enabled = true;
client_config.sync_eth1_chain = true;
}
/*
@@ -263,18 +262,12 @@ pub fn get_config<E: EthSpec>(
* Eth1
*/
// When present, use an eth1 backend that generates deterministic junk.
//
// Useful for running testnets without the overhead of a deposit contract.
if cli_args.get_flag("dummy-eth1") {
client_config.dummy_eth1_backend = true;
warn!(log, "The --dummy-eth1 flag is deprecated");
}
// When present, attempt to sync to an eth1 node.
//
// Required for block production.
if cli_args.get_flag("eth1") {
client_config.sync_eth1_chain = true;
warn!(log, "The --eth1 flag is deprecated");
}
if let Some(val) = cli_args.get_one::<String>("eth1-blocks-per-log-query") {
@@ -297,17 +290,6 @@ pub fn get_config<E: EthSpec>(
let endpoints: String = clap_utils::parse_required(cli_args, "execution-endpoint")?;
let mut el_config = execution_layer::Config::default();
// Always follow the deposit contract when there is an execution endpoint.
//
// This is wasteful for non-staking nodes as they have no need to process deposit contract
// logs and build an "eth1" cache. The alternative is to explicitly require the `--eth1` or
// `--staking` flags, however that poses a risk to stakers since they cannot produce blocks
// without "eth1".
//
// The waste for non-staking nodes is relatively small so we err on the side of safety for
// stakers. The merge is already complicated enough.
client_config.sync_eth1_chain = true;
// Parse a single execution endpoint, logging warnings if multiple endpoints are supplied.
let execution_endpoint = parse_only_one_value(
endpoints.as_str(),

View File

@@ -140,7 +140,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 && !client_config.dummy_eth1_backend {
let builder = if client_config.sync_eth1_chain {
info!(
log,
"Block production enabled";
@@ -150,13 +150,6 @@ impl<E: EthSpec> ProductionBeaconNode<E> {
builder
.caching_eth1_backend(client_config.eth1.clone())
.await?
} else if client_config.dummy_eth1_backend {
warn!(
log,
"Block production impaired";
"reason" => "dummy eth1 backend is enabled"
);
builder.dummy_eth1_backend()?
} else {
info!(
log,