Skip to content

Commit b435b7a

Browse files
Copilotjimmygchen
andcommitted
Remove deprecated CLI flags and references for v8.0.0
Co-authored-by: jimmygchen <742762+jimmygchen@users.noreply.github.com>
1 parent 8707233 commit b435b7a

File tree

4 files changed

+17
-223
lines changed

4 files changed

+17
-223
lines changed

beacon_node/src/cli.rs

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -703,34 +703,9 @@ pub fn cli_app() -> Command {
703703
/*
704704
* Eth1 Integration
705705
*/
706-
.arg(
707-
Arg::new("eth1-purge-cache")
708-
.long("eth1-purge-cache")
709-
.value_name("PURGE-CACHE")
710-
.help("DEPRECATED")
711-
.action(ArgAction::SetTrue)
712-
.help_heading(FLAG_HEADER)
713-
.display_order(0)
714-
.hide(true)
715-
)
716-
.arg(
717-
Arg::new("eth1-blocks-per-log-query")
718-
.long("eth1-blocks-per-log-query")
719-
.value_name("BLOCKS")
720-
.help("DEPRECATED")
721-
.action(ArgAction::Set)
722-
.display_order(0)
723-
.hide(true)
724-
)
725-
.arg(
726-
Arg::new("eth1-cache-follow-distance")
727-
.long("eth1-cache-follow-distance")
728-
.value_name("BLOCKS")
729-
.help("DEPRECATED")
730-
.action(ArgAction::Set)
731-
.display_order(0)
732-
.hide(true)
733-
)
706+
707+
708+
734709
.arg(
735710
Arg::new("slots-per-restore-point")
736711
.long("slots-per-restore-point")
@@ -1498,16 +1473,7 @@ pub fn cli_app() -> Command {
14981473
.help_heading(FLAG_HEADER)
14991474
.display_order(0)
15001475
)
1501-
.arg(
1502-
Arg::new("disable-deposit-contract-sync")
1503-
.long("disable-deposit-contract-sync")
1504-
.help("DEPRECATED")
1505-
.action(ArgAction::SetTrue)
1506-
.help_heading(FLAG_HEADER)
1507-
.conflicts_with("staking")
1508-
.display_order(0)
1509-
.hide(true)
1510-
)
1476+
15111477
.arg(
15121478
Arg::new("disable-optimistic-finalized-sync")
15131479
.long("disable-optimistic-finalized-sync")
@@ -1518,15 +1484,7 @@ pub fn cli_app() -> Command {
15181484
Lighthouse and only passed to the EL if initial verification fails.")
15191485
.display_order(0)
15201486
)
1521-
.arg(
1522-
Arg::new("light-client-server")
1523-
.long("light-client-server")
1524-
.help("DEPRECATED")
1525-
.action(ArgAction::SetTrue)
15261487

1527-
.help_heading(FLAG_HEADER)
1528-
.display_order(0)
1529-
)
15301488
.arg(
15311489
Arg::new("disable-light-client-server")
15321490
.long("disable-light-client-server")

beacon_node/src/config.rs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,7 @@ pub fn get_config<E: EthSpec>(
170170
parse_required(cli_args, "http-duplicate-block-status")?;
171171
}
172172

173-
if cli_args.get_flag("light-client-server") {
174-
warn!(
175-
"The --light-client-server flag is deprecated. The light client server is enabled \
176-
by default"
177-
);
178-
}
173+
179174

180175
if cli_args.get_flag("disable-light-client-server") {
181176
client_config.chain.enable_light_client_server = false;
@@ -262,23 +257,7 @@ pub fn get_config<E: EthSpec>(
262257
client_config.http_metrics.allocator_metrics_enabled = false;
263258
}
264259

265-
/*
266-
* Deprecated Eth1 flags (can be removed in the next minor release after v7.1.0)
267-
*/
268-
if cli_args
269-
.get_one::<String>("eth1-blocks-per-log-query")
270-
.is_some()
271-
{
272-
warn!("The eth1-blocks-per-log-query flag is deprecated");
273-
}
274-
275-
if cli_args.get_flag("eth1-purge-cache") {
276-
warn!("The eth1-purge-cache flag is deprecated");
277-
}
278260

279-
if clap_utils::parse_optional::<u64>(cli_args, "eth1-cache-follow-distance")?.is_some() {
280-
warn!("The eth1-cache-follow-distance flag is deprecated");
281-
}
282261

283262
// `--execution-endpoint` is required now.
284263
let endpoints: String = clap_utils::parse_required(cli_args, "execution-endpoint")?;
@@ -773,9 +752,7 @@ pub fn get_config<E: EthSpec>(
773752
}
774753
}
775754

776-
if cli_args.get_flag("disable-deposit-contract-sync") {
777-
warn!("The disable-deposit-contract-sync flag is deprecated");
778-
}
755+
779756

780757
client_config.chain.prepare_payload_lookahead =
781758
clap_utils::parse_optional(cli_args, "prepare-payload-lookahead")?

lighthouse/src/main.rs

Lines changed: 8 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use std::path::PathBuf;
2828
use std::process::exit;
2929
use std::sync::LazyLock;
3030
use task_executor::ShutdownReason;
31-
use tracing::{Level, info, warn};
31+
use tracing::{Level, info};
3232
use tracing_subscriber::{Layer, filter::EnvFilter, layer::SubscriberExt, util::SubscriberInitExt};
3333
use types::{EthSpec, EthSpecId};
3434
use validator_client::ProductionValidatorClient;
@@ -126,16 +126,7 @@ fn main() {
126126
.global(true)
127127
.display_order(0),
128128
)
129-
.arg(
130-
Arg::new("logfile")
131-
.long("logfile")
132-
.value_name("PATH")
133-
.help("DEPRECATED")
134-
.action(ArgAction::Set)
135-
.global(true)
136-
.hide(true)
137-
.display_order(0)
138-
)
129+
139130
.arg(
140131
Arg::new("logfile-dir")
141132
.long("logfile-dir")
@@ -385,48 +376,10 @@ fn main() {
385376
.global(true)
386377
.display_order(0)
387378
)
388-
.arg(
389-
Arg::new("terminal-total-difficulty-override")
390-
.long("terminal-total-difficulty-override")
391-
.value_name("INTEGER")
392-
.help("DEPRECATED")
393-
.action(ArgAction::Set)
394-
.global(true)
395-
.display_order(0)
396-
.hide(true)
397-
)
398-
.arg(
399-
Arg::new("terminal-block-hash-override")
400-
.long("terminal-block-hash-override")
401-
.value_name("TERMINAL_BLOCK_HASH")
402-
.help("DEPRECATED")
403-
.requires("terminal-block-hash-epoch-override")
404-
.action(ArgAction::Set)
405-
.global(true)
406-
.display_order(0)
407-
.hide(true)
408-
)
409-
.arg(
410-
Arg::new("terminal-block-hash-epoch-override")
411-
.long("terminal-block-hash-epoch-override")
412-
.value_name("EPOCH")
413-
.help("DEPRECATED")
414-
.requires("terminal-block-hash-override")
415-
.action(ArgAction::Set)
416-
.global(true)
417-
.display_order(0)
418-
.hide(true)
419-
)
420-
.arg(
421-
Arg::new("safe-slots-to-import-optimistically")
422-
.long("safe-slots-to-import-optimistically")
423-
.value_name("INTEGER")
424-
.help("DEPRECATED")
425-
.action(ArgAction::Set)
426-
.global(true)
427-
.display_order(0)
428-
.hide(true)
429-
)
379+
380+
381+
382+
430383
.arg(
431384
Arg::new("genesis-state-url")
432385
.long("genesis-state-url")
@@ -780,10 +733,7 @@ fn run<E: EthSpec>(
780733
// Allow Prometheus access to the version and commit of the Lighthouse build.
781734
metrics::expose_lighthouse_version();
782735

783-
// DEPRECATED: can be removed in v7.2.0/v8.0.0.
784-
if clap_utils::parse_optional::<PathBuf>(matches, "logfile")?.is_some() {
785-
warn!("The --logfile flag is deprecated and replaced by --logfile-dir");
786-
}
736+
787737

788738
#[cfg(all(feature = "modern", target_arch = "x86_64"))]
789739
if !std::is_x86_feature_detected!("adx") {
@@ -793,19 +743,7 @@ fn run<E: EthSpec>(
793743
);
794744
}
795745

796-
// Warn for DEPRECATED global flags. This code should be removed when we finish deleting these
797-
// flags.
798-
let deprecated_flags = [
799-
"terminal-total-difficulty-override",
800-
"terminal-block-hash-override",
801-
"terminal-block-hash-epoch-override",
802-
"safe-slots-to-import-optimistically",
803-
];
804-
for flag in deprecated_flags {
805-
if matches.get_one::<String>(flag).is_some() {
806-
warn!("The {} flag is deprecated and does nothing", flag);
807-
}
808-
}
746+
809747

810748
// Note: the current code technically allows for starting a beacon node _and_ a validator
811749
// client at the same time.

lighthouse/tests/beacon_node.rs

Lines changed: 3 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -423,28 +423,7 @@ fn complete_blob_backfill_and_prune_blobs_true() {
423423
});
424424
}
425425

426-
// Tests for Eth1 flags.
427-
// DEPRECATED but should not crash
428-
#[test]
429-
fn eth1_blocks_per_log_query_flag() {
430-
CommandLineTest::new()
431-
.flag("eth1-blocks-per-log-query", Some("500"))
432-
.run_with_zero_port();
433-
}
434-
// DEPRECATED but should not crash
435-
#[test]
436-
fn eth1_purge_cache_flag() {
437-
CommandLineTest::new()
438-
.flag("eth1-purge-cache", None)
439-
.run_with_zero_port();
440-
}
441-
// DEPRECATED but should not crash
442-
#[test]
443-
fn eth1_cache_follow_distance_manual() {
444-
CommandLineTest::new()
445-
.flag("eth1-cache-follow-distance", Some("128"))
446-
.run_with_zero_port();
447-
}
426+
448427

449428
// Tests for Bellatrix flags.
450429
fn run_bellatrix_execution_endpoints_flag_test(flag: &str) {
@@ -781,31 +760,7 @@ fn jwt_optional_flags() {
781760
fn jwt_optional_alias_flags() {
782761
run_jwt_optional_flags_test("jwt-secrets", "jwt-id", "jwt-version");
783762
}
784-
// DEPRECATED. This flag is deprecated but should not cause a crash.
785-
#[test]
786-
fn terminal_total_difficulty_override_flag() {
787-
CommandLineTest::new()
788-
.flag("terminal-total-difficulty-override", Some("1337424242"))
789-
.run_with_zero_port();
790-
}
791-
// DEPRECATED. This flag is deprecated but should not cause a crash.
792-
#[test]
793-
fn terminal_block_hash_and_activation_epoch_override_flags() {
794-
CommandLineTest::new()
795-
.flag("terminal-block-hash-epoch-override", Some("1337"))
796-
.flag(
797-
"terminal-block-hash-override",
798-
Some("0x4242424242424242424242424242424242424242424242424242424242424242"),
799-
)
800-
.run_with_zero_port();
801-
}
802-
// DEPRECATED. This flag is deprecated but should not cause a crash.
803-
#[test]
804-
fn safe_slots_to_import_optimistically_flag() {
805-
CommandLineTest::new()
806-
.flag("safe-slots-to-import-optimistically", Some("421337"))
807-
.run_with_zero_port();
808-
}
763+
809764

810765
// Tests for Network flags.
811766
#[test]
@@ -2523,42 +2478,9 @@ fn logfile_format_flag() {
25232478
)
25242479
});
25252480
}
2526-
// DEPRECATED but should not crash.
2527-
#[test]
2528-
fn deprecated_logfile() {
2529-
CommandLineTest::new()
2530-
.flag("logfile", Some("test.txt"))
2531-
.run_with_zero_port();
2532-
}
25332481

2534-
// DEPRECATED but should not crash.
2535-
#[test]
2536-
fn sync_eth1_chain_disable_deposit_contract_sync_flag() {
2537-
let dir = TempDir::new().expect("Unable to create temporary directory");
2538-
CommandLineTest::new_with_no_execution_endpoint()
2539-
.flag("disable-deposit-contract-sync", None)
2540-
.flag("execution-endpoints", Some("http://localhost:8551/"))
2541-
.flag(
2542-
"execution-jwt",
2543-
dir.path().join("jwt-file").as_os_str().to_str(),
2544-
)
2545-
.run_with_zero_port();
2546-
}
25472482

2548-
#[test]
2549-
#[should_panic]
2550-
fn disable_deposit_contract_sync_conflicts_with_staking() {
2551-
let dir = TempDir::new().expect("Unable to create temporary directory");
2552-
CommandLineTest::new_with_no_execution_endpoint()
2553-
.flag("disable-deposit-contract-sync", None)
2554-
.flag("staking", None)
2555-
.flag("execution-endpoints", Some("http://localhost:8551/"))
2556-
.flag(
2557-
"execution-jwt",
2558-
dir.path().join("jwt-file").as_os_str().to_str(),
2559-
)
2560-
.run_with_zero_port();
2561-
}
2483+
25622484

25632485
#[test]
25642486
fn light_client_server_default() {
@@ -2573,7 +2495,6 @@ fn light_client_server_default() {
25732495
#[test]
25742496
fn light_client_server_enabled() {
25752497
CommandLineTest::new()
2576-
.flag("light-client-server", None)
25772498
.run_with_zero_port()
25782499
.with_config(|config| {
25792500
assert!(config.network.enable_light_client_server);

0 commit comments

Comments
 (0)