Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate http-spec-fork and http-allow-sync-stalled #5500

Merged
Prev Previous commit
Next Next commit
add warn, re-add tests
  • Loading branch information
eserilev committed Apr 10, 2024
commit 60bd5745a9a024813c0eed6ebd827e1c3031ce2d
2 changes: 1 addition & 1 deletion beacon_node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.requires("enable_http")
.value_name("ORIGIN")
.help("Set the value of the Access-Control-Allow-Origin response HTTP header. \
Use * to allow any origin (not recommended in production). \
Use * to allow any origin (not recommended in production).
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved
If no value is supplied, the CORS allowed origin is set to the listen \
address of this server (e.g., http://localhost:5052).")
.takes_value(true),
Expand Down
16 changes: 16 additions & 0 deletions beacon_node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ pub fn get_config<E: EthSpec>(
client_config.http_api.allow_origin = Some(allow_origin.to_string());
}

if cli_args.is_present("http-spec-fork") {
warn!(
log,
"Ignoring --http-spec-fork";
"info" => "this flag is deprecated and will be removed"
);
}

if cli_args.is_present("http-enable-tls") {
client_config.http_api.tls_config = Some(TlsConfig {
cert: cli_args
Expand All @@ -142,6 +150,14 @@ pub fn get_config<E: EthSpec>(
});
}

if cli_args.is_present("http-allow-sync-stalled") {
warn!(
log,
"Ignoring --http-allow-sync-stalled";
"info" => "this flag is deprecated and will be removed"
);
}

client_config.http_api.sse_capacity_multiplier =
parse_required(cli_args, "http-sse-capacity-multiplier")?;

Expand Down
16 changes: 16 additions & 0 deletions lighthouse/tests/beacon_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,14 @@ fn http_allow_origin_all_flag() {
.with_config(|config| assert_eq!(config.http_api.allow_origin, Some("*".to_string())));
}

#[test]
fn http_allow_sync_stalled_flag() {
CommandLineTest::new()
.flag("http", None)
.flag("http-allow-sync-stalled", None)
.run_with_zero_port();
}

#[test]
fn http_enable_beacon_processor() {
CommandLineTest::new()
Expand Down Expand Up @@ -1633,6 +1641,14 @@ fn http_spec_fork_default() {
.with_config(|config| assert_eq!(config.http_api.spec_fork_name, None));
}

#[test]
fn http_spec_fork_override() {
CommandLineTest::new()
.flag("http", None)
.flag("http-spec-fork", Some("altair"))
.run_with_zero_port();
}

// Tests for Metrics flags.
#[test]
fn metrics_flag() {
Expand Down