mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 20:02:43 +00:00
Merge unstable (needs a few more fixes)
This commit is contained in:
@@ -777,6 +777,17 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.value_name("PATH")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("validator-monitor-individual-tracking-threshold")
|
||||
.long("validator-monitor-individual-tracking-threshold")
|
||||
.help("Once the validator monitor reaches this number of local validators \
|
||||
it will stop collecting per-validator Prometheus metrics and issuing \
|
||||
per-validator logs. Instead, it will provide aggregate metrics and logs. \
|
||||
This avoids infeasibly high cardinality in the Prometheus database and \
|
||||
high log volume when using many validators. Defaults to 64.")
|
||||
.value_name("INTEGER")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("disable-lock-timeouts")
|
||||
.long("disable-lock-timeouts")
|
||||
@@ -785,6 +796,38 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
experimental as it may obscure performance issues.")
|
||||
.takes_value(false)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("disable-proposer-reorgs")
|
||||
.long("disable-proposer-reorgs")
|
||||
.help("Do not attempt to reorg late blocks from other validators when proposing.")
|
||||
.takes_value(false)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("proposer-reorg-threshold")
|
||||
.long("proposer-reorg-threshold")
|
||||
.value_name("PERCENT")
|
||||
.help("Percentage of vote weight below which to attempt a proposer reorg. \
|
||||
Default: 20%")
|
||||
.conflicts_with("disable-proposer-reorgs")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("proposer-reorg-epochs-since-finalization")
|
||||
.long("proposer-reorg-epochs-since-finalization")
|
||||
.value_name("EPOCHS")
|
||||
.help("Maximum number of epochs since finalization at which proposer reorgs are \
|
||||
allowed. Default: 2")
|
||||
.conflicts_with("disable-proposer-reorgs")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("prepare-payload-lookahead")
|
||||
.long("prepare-payload-lookahead")
|
||||
.value_name("MILLISECONDS")
|
||||
.help("The time before the start of a proposal slot at which payload attributes \
|
||||
should be sent. Low values are useful for execution nodes which don't \
|
||||
improve their payload after the first call, and high values are useful \
|
||||
for ensuring the EL is given ample notice. Default: 1/3 of a slot.")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("fork-choice-before-proposal-timeout")
|
||||
.long("fork-choice-before-proposal-timeout")
|
||||
@@ -892,6 +935,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
Useful if you intend to run a non-validating beacon node.")
|
||||
.takes_value(false)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("disable-optimistic-finalized-sync")
|
||||
.long("disable-optimistic-finalized-sync")
|
||||
.help("Force Lighthouse to verify every execution block hash with the execution \
|
||||
client during finalized sync. By default block hashes will be checked in \
|
||||
Lighthouse and only passed to the EL if initial verification fails.")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("light-client-server")
|
||||
.long("light-client-server")
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
use beacon_chain::chain_config::{
|
||||
ReOrgThreshold, DEFAULT_PREPARE_PAYLOAD_LOOKAHEAD_FACTOR,
|
||||
DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION, DEFAULT_RE_ORG_THRESHOLD,
|
||||
};
|
||||
use clap::ArgMatches;
|
||||
use clap_utils::flags::DISABLE_MALLOC_TUNING_FLAG;
|
||||
use client::{ClientConfig, ClientGenesis};
|
||||
@@ -18,6 +22,7 @@ use std::net::Ipv6Addr;
|
||||
use std::net::{IpAddr, Ipv4Addr, ToSocketAddrs};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
use std::time::Duration;
|
||||
use types::{Checkpoint, Epoch, EthSpec, Hash256, PublicKeyBytes, GRAFFITI_BYTES_LEN};
|
||||
use unused_port::{unused_tcp_port, unused_udp_port};
|
||||
|
||||
@@ -679,15 +684,42 @@ pub fn get_config<E: EthSpec>(
|
||||
.extend_from_slice(&pubkeys);
|
||||
}
|
||||
|
||||
if let Some(count) =
|
||||
clap_utils::parse_optional(cli_args, "validator-monitor-individual-tracking-threshold")?
|
||||
{
|
||||
client_config.validator_monitor_individual_tracking_threshold = count;
|
||||
}
|
||||
|
||||
if cli_args.is_present("disable-lock-timeouts") {
|
||||
client_config.chain.enable_lock_timeouts = false;
|
||||
}
|
||||
|
||||
if cli_args.is_present("disable-proposer-reorgs") {
|
||||
client_config.chain.re_org_threshold = None;
|
||||
} else {
|
||||
client_config.chain.re_org_threshold = Some(
|
||||
clap_utils::parse_optional(cli_args, "proposer-reorg-threshold")?
|
||||
.map(ReOrgThreshold)
|
||||
.unwrap_or(DEFAULT_RE_ORG_THRESHOLD),
|
||||
);
|
||||
client_config.chain.re_org_max_epochs_since_finalization =
|
||||
clap_utils::parse_optional(cli_args, "proposer-reorg-epochs-since-finalization")?
|
||||
.unwrap_or(DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION);
|
||||
}
|
||||
|
||||
// Note: This overrides any previous flags that enable this option.
|
||||
if cli_args.is_present("disable-deposit-contract-sync") {
|
||||
client_config.sync_eth1_chain = false;
|
||||
}
|
||||
|
||||
client_config.chain.prepare_payload_lookahead =
|
||||
clap_utils::parse_optional(cli_args, "prepare-payload-lookahead")?
|
||||
.map(Duration::from_millis)
|
||||
.unwrap_or_else(|| {
|
||||
Duration::from_secs(spec.seconds_per_slot)
|
||||
/ DEFAULT_PREPARE_PAYLOAD_LOOKAHEAD_FACTOR
|
||||
});
|
||||
|
||||
if let Some(timeout) =
|
||||
clap_utils::parse_optional(cli_args, "fork-choice-before-proposal-timeout")?
|
||||
{
|
||||
@@ -724,6 +756,10 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.validator_monitor_auto = true;
|
||||
}
|
||||
|
||||
// Optimistic finalized sync.
|
||||
client_config.chain.optimistic_finalized_sync =
|
||||
!cli_args.is_present("disable-optimistic-finalized-sync");
|
||||
|
||||
Ok(client_config)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user