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

Enable progressive balances fast mode by default #4971

Merged
merged 2 commits into from
Dec 4, 2023
Merged
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
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/chain_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Default for ChainConfig {
shuffling_cache_size: crate::shuffling_cache::DEFAULT_CACHE_SIZE,
genesis_backfill: false,
always_prepare_payload: false,
progressive_balances_mode: ProgressiveBalancesMode::Checked,
progressive_balances_mode: ProgressiveBalancesMode::Fast,
epochs_per_migration: crate::migrate::DEFAULT_EPOCHS_PER_MIGRATION,
}
}
Expand Down
12 changes: 6 additions & 6 deletions beacon_node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,12 +1228,12 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
Arg::with_name("progressive-balances")
.long("progressive-balances")
.value_name("MODE")
.help("Options to enable or disable the progressive balances cache for \
unrealized FFG progression calculation. The default `checked` mode compares \
the progressive balances from the cache against results from the existing \
method. If there is a mismatch, it falls back to the existing method. The \
optimized mode (`fast`) is faster but is still experimental, and is \
not recommended for mainnet usage at this time.")
.help("Control the progressive balances cache mode. The default `fast` mode uses \
the cache to speed up fork choice. A more conservative `checked` mode \
compares the cache's results against results without the cache. If \
there is a mismatch, it falls back to the cache-free result. Using the \
default `fast` mode is recommended unless advised otherwise by the \
Lighthouse team.")
.takes_value(true)
.possible_values(ProgressiveBalancesMode::VARIANTS)
)
Expand Down
8 changes: 4 additions & 4 deletions lighthouse/tests/beacon_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2443,20 +2443,20 @@ fn progressive_balances_default() {
.with_config(|config| {
assert_eq!(
config.chain.progressive_balances_mode,
ProgressiveBalancesMode::Checked
ProgressiveBalancesMode::Fast
)
});
}

#[test]
fn progressive_balances_fast() {
fn progressive_balances_checked() {
CommandLineTest::new()
.flag("progressive-balances", Some("fast"))
.flag("progressive-balances", Some("checked"))
.run_with_zero_port()
.with_config(|config| {
assert_eq!(
config.chain.progressive_balances_mode,
ProgressiveBalancesMode::Fast
ProgressiveBalancesMode::Checked
)
});
}
Expand Down
Loading