mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Add is_parent_strong proposer re-org check (#5417)
* initial fork choice additions * add helper fns * add is_parent_strong * Merge branch 'unstable' of https://github.com/sigp/lighthouse into add_is_parent_strong_check * disabling proposer reorg should set parent_threshold to u64 max * add new flag, is_parent_strong check in override fcu params * cherry-pick changes * Merge branch 'unstable' of https://github.com/sigp/lighthouse into add_is_parent_strong_check * cleanup * fmt * Minor review tweaks
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use beacon_chain::chain_config::{
|
||||
DisallowedReOrgOffsets, ReOrgThreshold, DEFAULT_PREPARE_PAYLOAD_LOOKAHEAD_FACTOR,
|
||||
DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION, DEFAULT_RE_ORG_THRESHOLD,
|
||||
DEFAULT_RE_ORG_HEAD_THRESHOLD, DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION,
|
||||
DEFAULT_RE_ORG_PARENT_THRESHOLD,
|
||||
};
|
||||
use beacon_chain::TrustedSetup;
|
||||
use clap::ArgMatches;
|
||||
@@ -749,12 +750,13 @@ pub fn get_config<E: EthSpec>(
|
||||
}
|
||||
|
||||
if cli_args.is_present("disable-proposer-reorgs") {
|
||||
client_config.chain.re_org_threshold = None;
|
||||
client_config.chain.re_org_head_threshold = None;
|
||||
client_config.chain.re_org_parent_threshold = None;
|
||||
} else {
|
||||
client_config.chain.re_org_threshold = Some(
|
||||
client_config.chain.re_org_head_threshold = Some(
|
||||
clap_utils::parse_optional(cli_args, "proposer-reorg-threshold")?
|
||||
.map(ReOrgThreshold)
|
||||
.unwrap_or(DEFAULT_RE_ORG_THRESHOLD),
|
||||
.unwrap_or(DEFAULT_RE_ORG_HEAD_THRESHOLD),
|
||||
);
|
||||
client_config.chain.re_org_max_epochs_since_finalization =
|
||||
clap_utils::parse_optional(cli_args, "proposer-reorg-epochs-since-finalization")?
|
||||
@@ -762,6 +764,12 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.chain.re_org_cutoff_millis =
|
||||
clap_utils::parse_optional(cli_args, "proposer-reorg-cutoff")?;
|
||||
|
||||
client_config.chain.re_org_parent_threshold = Some(
|
||||
clap_utils::parse_optional(cli_args, "proposer-reorg-parent-threshold")?
|
||||
.map(ReOrgThreshold)
|
||||
.unwrap_or(DEFAULT_RE_ORG_PARENT_THRESHOLD),
|
||||
);
|
||||
|
||||
if let Some(disallowed_offsets_str) =
|
||||
clap_utils::parse_optional::<String>(cli_args, "proposer-reorg-disallowed-offsets")?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user