Skip to content

Commit 7fd9389

Browse files
Delete deprecated cli flags (#4906)
* Delete BN spec flag and VC beacon-node flag * Remove warn * slog * add warn * delete eth1-endpoint * delete server from vc cli.rs * delete server flag in config.rs * delete delete-lockfiles in vc * delete allow-unsynced flag in VC * delete strict-fee-recipient in VC and warn log * delete merge flag in bn (hidden) * delete count-unrealized and count-unrealized-full in bn (hidden) * delete http-disable-legacy-spec in bn (hidden) * delete eth1-endpoint in lcli * delete warn message lcli * delete eth1-endpoints * delete minify in slashing protection * delete minify related * Remove mut * add back warn! log * Indentation * Delete count-unrealized * Delete eth1-endpoints * Delete eth1-endpoint test * delete eth1-endpints test * delete allow-unsynced test * Add back lcli eth1-endpoint --------- Co-authored-by: Michael Sproul <[email protected]>
1 parent 7818100 commit 7fd9389

File tree

8 files changed

+5
-386
lines changed

8 files changed

+5
-386
lines changed

account_manager/src/validator/slashing_protection.rs

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub const EXPORT_CMD: &str = "export";
1616
pub const IMPORT_FILE_ARG: &str = "IMPORT-FILE";
1717
pub const EXPORT_FILE_ARG: &str = "EXPORT-FILE";
1818

19-
pub const MINIFY_FLAG: &str = "minify";
2019
pub const PUBKEYS_FLAG: &str = "pubkeys";
2120

2221
pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
@@ -31,16 +30,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
3130
.value_name("FILE")
3231
.help("The slashing protection interchange file to import (.json)"),
3332
)
34-
.arg(
35-
Arg::with_name(MINIFY_FLAG)
36-
.long(MINIFY_FLAG)
37-
.takes_value(true)
38-
.possible_values(&["false", "true"])
39-
.help(
40-
"Deprecated: Lighthouse no longer requires minification on import \
41-
because it always minifies",
42-
),
43-
),
4433
)
4534
.subcommand(
4635
App::new(EXPORT_CMD)
@@ -61,17 +50,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
6150
comma-separated. All known keys will be exported if omitted",
6251
),
6352
)
64-
.arg(
65-
Arg::with_name(MINIFY_FLAG)
66-
.long(MINIFY_FLAG)
67-
.takes_value(true)
68-
.default_value("false")
69-
.possible_values(&["false", "true"])
70-
.help(
71-
"Minify the output file. This will make it smaller and faster to \
72-
import, but not faster to generate.",
73-
),
74-
),
7553
)
7654
}
7755

@@ -92,7 +70,6 @@ pub fn cli_run<T: EthSpec>(
9270
match matches.subcommand() {
9371
(IMPORT_CMD, Some(matches)) => {
9472
let import_filename: PathBuf = clap_utils::parse_required(matches, IMPORT_FILE_ARG)?;
95-
let minify: Option<bool> = clap_utils::parse_optional(matches, MINIFY_FLAG)?;
9673
let import_file = File::open(&import_filename).map_err(|e| {
9774
format!(
9875
"Unable to open import file at {}: {:?}",
@@ -102,23 +79,10 @@ pub fn cli_run<T: EthSpec>(
10279
})?;
10380

10481
eprint!("Loading JSON file into memory & deserializing");
105-
let mut interchange = Interchange::from_json_reader(&import_file)
82+
let interchange = Interchange::from_json_reader(&import_file)
10683
.map_err(|e| format!("Error parsing file for import: {:?}", e))?;
10784
eprintln!(" [done].");
10885

109-
if let Some(minify) = minify {
110-
eprintln!(
111-
"WARNING: --minify flag is deprecated and will be removed in a future release"
112-
);
113-
if minify {
114-
eprint!("Minifying input file for faster loading");
115-
interchange = interchange
116-
.minify()
117-
.map_err(|e| format!("Minification failed: {:?}", e))?;
118-
eprintln!(" [done].");
119-
}
120-
}
121-
12286
let slashing_protection_database =
12387
SlashingDatabase::open_or_create(&slashing_protection_db_path).map_err(|e| {
12488
format!(
@@ -206,7 +170,6 @@ pub fn cli_run<T: EthSpec>(
206170
}
207171
(EXPORT_CMD, Some(matches)) => {
208172
let export_filename: PathBuf = clap_utils::parse_required(matches, EXPORT_FILE_ARG)?;
209-
let minify: bool = clap_utils::parse_required(matches, MINIFY_FLAG)?;
210173

211174
let selected_pubkeys = if let Some(pubkeys) =
212175
clap_utils::parse_optional::<String>(matches, PUBKEYS_FLAG)?
@@ -237,17 +200,10 @@ pub fn cli_run<T: EthSpec>(
237200
)
238201
})?;
239202

240-
let mut interchange = slashing_protection_database
203+
let interchange = slashing_protection_database
241204
.export_interchange_info(genesis_validators_root, selected_pubkeys.as_deref())
242205
.map_err(|e| format!("Error during export: {:?}", e))?;
243206

244-
if minify {
245-
eprintln!("Minifying output file");
246-
interchange = interchange
247-
.minify()
248-
.map_err(|e| format!("Unable to minify output: {:?}", e))?;
249-
}
250-
251207
let output_file = File::create(export_filename)
252208
.map_err(|e| format!("Error creating output file: {:?}", e))?;
253209

beacon_node/src/cli.rs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
388388
address of this server (e.g., http://localhost:5052).")
389389
.takes_value(true),
390390
)
391-
.arg(
392-
Arg::with_name("http-disable-legacy-spec")
393-
.long("http-disable-legacy-spec")
394-
.requires("enable_http")
395-
.hidden(true)
396-
)
397391
.arg(
398392
Arg::with_name("http-spec-fork")
399393
.long("http-spec-fork")
@@ -569,24 +563,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
569563
.help("If present, uses an eth1 backend that generates static dummy data.\
570564
Identical to the method used at the 2019 Canada interop.")
571565
)
572-
.arg(
573-
Arg::with_name("eth1-endpoint")
574-
.long("eth1-endpoint")
575-
.value_name("HTTP-ENDPOINT")
576-
.help("Deprecated. Use --eth1-endpoints.")
577-
.takes_value(true)
578-
)
579-
.arg(
580-
Arg::with_name("eth1-endpoints")
581-
.long("eth1-endpoints")
582-
.value_name("HTTP-ENDPOINTS")
583-
.conflicts_with("eth1-endpoint")
584-
.help("One http endpoint for a web3 connection to an execution node. \
585-
Note: This flag is now only useful for testing, use `--execution-endpoint` \
586-
flag to connect to an execution node on mainnet and testnets.
587-
Defaults to http://127.0.0.1:8545.")
588-
.takes_value(true)
589-
)
590566
.arg(
591567
Arg::with_name("eth1-purge-cache")
592568
.long("eth1-purge-cache")
@@ -649,14 +625,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
649625
/*
650626
* Execution Layer Integration
651627
*/
652-
.arg(
653-
Arg::with_name("merge")
654-
.long("merge")
655-
.help("Deprecated. The feature activates automatically when --execution-endpoint \
656-
is supplied.")
657-
.takes_value(false)
658-
.hidden(true)
659-
)
660628
.arg(
661629
Arg::with_name("execution-endpoint")
662630
.long("execution-endpoint")
@@ -1200,22 +1168,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
12001168
.requires("builder")
12011169
.takes_value(true)
12021170
)
1203-
.arg(
1204-
Arg::with_name("count-unrealized")
1205-
.long("count-unrealized")
1206-
.hidden(true)
1207-
.help("This flag is deprecated and has no effect.")
1208-
.takes_value(true)
1209-
.default_value("true")
1210-
)
1211-
.arg(
1212-
Arg::with_name("count-unrealized-full")
1213-
.long("count-unrealized-full")
1214-
.hidden(true)
1215-
.help("This flag is deprecated and has no effect.")
1216-
.takes_value(true)
1217-
.default_value("false")
1218-
)
12191171
.arg(
12201172
Arg::with_name("reset-payload-statuses")
12211173
.long("reset-payload-statuses")

beacon_node/src/config.rs

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,6 @@ pub fn get_config<E: EthSpec>(
120120
client_config.http_api.allow_origin = Some(allow_origin.to_string());
121121
}
122122

123-
if cli_args.is_present("http-disable-legacy-spec") {
124-
warn!(
125-
log,
126-
"The flag --http-disable-legacy-spec is deprecated and will be removed"
127-
);
128-
}
129-
130123
if let Some(fork_name) = clap_utils::parse_optional(cli_args, "http-spec-fork")? {
131124
client_config.http_api.spec_fork_name = Some(fork_name);
132125
}
@@ -240,25 +233,6 @@ pub fn get_config<E: EthSpec>(
240233
client_config.sync_eth1_chain = true;
241234
}
242235

243-
// Defines the URL to reach the eth1 node.
244-
if let Some(endpoint) = cli_args.value_of("eth1-endpoint") {
245-
warn!(
246-
log,
247-
"The --eth1-endpoint flag is deprecated";
248-
"msg" => "please use --eth1-endpoints instead"
249-
);
250-
client_config.sync_eth1_chain = true;
251-
252-
let endpoint = SensitiveUrl::parse(endpoint)
253-
.map_err(|e| format!("eth1-endpoint was an invalid URL: {:?}", e))?;
254-
client_config.eth1.endpoint = Eth1Endpoint::NoAuth(endpoint);
255-
} else if let Some(endpoint) = cli_args.value_of("eth1-endpoints") {
256-
client_config.sync_eth1_chain = true;
257-
let endpoint = SensitiveUrl::parse(endpoint)
258-
.map_err(|e| format!("eth1-endpoints contains an invalid URL {:?}", e))?;
259-
client_config.eth1.endpoint = Eth1Endpoint::NoAuth(endpoint);
260-
}
261-
262236
if let Some(val) = cli_args.value_of("eth1-blocks-per-log-query") {
263237
client_config.eth1.blocks_per_log_query = val
264238
.parse()
@@ -275,20 +249,6 @@ pub fn get_config<E: EthSpec>(
275249
client_config.eth1.cache_follow_distance = Some(follow_distance);
276250
}
277251

278-
if cli_args.is_present("merge") {
279-
if cli_args.is_present("execution-endpoint") {
280-
warn!(
281-
log,
282-
"The --merge flag is deprecated";
283-
"info" => "the --execution-endpoint flag automatically enables this feature"
284-
)
285-
} else {
286-
return Err("The --merge flag is deprecated. \
287-
Supply a value to --execution-endpoint instead."
288-
.into());
289-
}
290-
}
291-
292252
if let Some(endpoints) = cli_args.value_of("execution-endpoint") {
293253
let mut el_config = execution_layer::Config::default();
294254

@@ -364,16 +324,6 @@ pub fn get_config<E: EthSpec>(
364324
clap_utils::parse_required(cli_args, "execution-timeout-multiplier")?;
365325
el_config.execution_timeout_multiplier = Some(execution_timeout_multiplier);
366326

367-
// If `--execution-endpoint` is provided, we should ignore any `--eth1-endpoints` values and
368-
// use `--execution-endpoint` instead. Also, log a deprecation warning.
369-
if cli_args.is_present("eth1-endpoints") || cli_args.is_present("eth1-endpoint") {
370-
warn!(
371-
log,
372-
"Ignoring --eth1-endpoints flag";
373-
"info" => "the value for --execution-endpoint will be used instead. \
374-
--eth1-endpoints has been deprecated for post-merge configurations"
375-
);
376-
}
377327
client_config.eth1.endpoint = Eth1Endpoint::Auth {
378328
endpoint: execution_endpoint,
379329
jwt_path: secret_file,
@@ -816,22 +766,6 @@ pub fn get_config<E: EthSpec>(
816766
client_config.chain.fork_choice_before_proposal_timeout_ms = timeout;
817767
}
818768

819-
if !clap_utils::parse_required::<bool>(cli_args, "count-unrealized")? {
820-
warn!(
821-
log,
822-
"The flag --count-unrealized is deprecated and will be removed";
823-
"info" => "any use of the flag will have no effect"
824-
);
825-
}
826-
827-
if clap_utils::parse_required::<bool>(cli_args, "count-unrealized-full")? {
828-
warn!(
829-
log,
830-
"The flag --count-unrealized-full is deprecated and will be removed";
831-
"info" => "setting it to `true` has no effect"
832-
);
833-
}
834-
835769
client_config.chain.always_reset_payload_statuses =
836770
cli_args.is_present("reset-payload-statuses");
837771

lighthouse/src/main.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use ethereum_hashing::have_sha_extensions;
1111
use futures::TryFutureExt;
1212
use lighthouse_version::VERSION;
1313
use malloc_utils::configure_memory_allocator;
14-
use slog::{crit, info, warn};
14+
use slog::{crit, info};
1515
use std::path::PathBuf;
1616
use std::process::exit;
1717
use task_executor::ShutdownReason;
@@ -81,16 +81,6 @@ fn main() {
8181
cfg!(feature = "gnosis"),
8282
).as_str()
8383
)
84-
.arg(
85-
Arg::with_name("spec")
86-
.short("s")
87-
.long("spec")
88-
.value_name("DEPRECATED")
89-
.help("This flag is deprecated, it will be disallowed in a future release. This \
90-
value is now derived from the --network or --testnet-dir flags.")
91-
.takes_value(true)
92-
.global(true)
93-
)
9484
.arg(
9585
Arg::with_name("env_log")
9686
.short("l")
@@ -549,16 +539,9 @@ fn run<E: EthSpec>(
549539
// Allow Prometheus access to the version and commit of the Lighthouse build.
550540
metrics::expose_lighthouse_version();
551541

552-
if matches.is_present("spec") {
553-
warn!(
554-
log,
555-
"The --spec flag is deprecated and will be removed in a future release"
556-
);
557-
}
558-
559542
#[cfg(all(feature = "modern", target_arch = "x86_64"))]
560543
if !std::is_x86_feature_detected!("adx") {
561-
warn!(
544+
slog::warn!(
562545
log,
563546
"CPU seems incompatible with optimized Lighthouse build";
564547
"advice" => "If you get a SIGILL, please try Lighthouse portable build"

0 commit comments

Comments
 (0)