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

[Merged by Bors] - Enable count-unrealized by default #3389

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions beacon_node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
Arg::with_name("count-unrealized")
.long("count-unrealized")
.hidden(true)
.help("**EXPERIMENTAL** Enables an alternative, potentially more performant FFG \
vote tracking method.")
.takes_value(false)
.help("Enables an alternative, potentially more performant FFG \
vote tracking method.")
.takes_value(true)
.default_value("true")
)
}
5 changes: 2 additions & 3 deletions beacon_node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,8 @@ pub fn get_config<E: EthSpec>(
client_config.chain.fork_choice_before_proposal_timeout_ms = timeout;
}

if cli_args.is_present("count-unrealized") {
client_config.chain.count_unrealized = true;
}
client_config.chain.count_unrealized =
clap_utils::parse_required(cli_args, "count-unrealized")?;

Ok(client_config)
}
Expand Down
31 changes: 31 additions & 0 deletions lighthouse/tests/beacon_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,37 @@ fn fork_choice_before_proposal_timeout_zero() {
.with_config(|config| assert_eq!(config.chain.fork_choice_before_proposal_timeout_ms, 0));
}

#[test]
fn count_unrealized_default() {
CommandLineTest::new()
.run_with_zero_port()
.with_config(|config| assert!(config.chain.count_unrealized));
}

#[test]
fn count_unrealized_no_arg() {
CommandLineTest::new()
.flag("count-unrealized", None)
.run_with_zero_port()
.with_config(|config| assert!(config.chain.count_unrealized));
}

#[test]
fn count_unrealized_false() {
CommandLineTest::new()
.flag("count-unrealized", Some("false"))
.run_with_zero_port()
.with_config(|config| assert!(!config.chain.count_unrealized));
}

#[test]
fn count_unrealized_true() {
CommandLineTest::new()
.flag("count-unrealized", Some("true"))
.run_with_zero_port()
.with_config(|config| assert!(config.chain.count_unrealized));
}

#[test]
fn freezer_dir_flag() {
let dir = TempDir::new().expect("Unable to create temporary directory");
Expand Down