mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
resolve merge conflicts between untstable and release-v7.0.0
This commit is contained in:
@@ -776,6 +776,15 @@ pub fn cli_app() -> Command {
|
||||
.action(ArgAction::Set)
|
||||
.display_order(0)
|
||||
)
|
||||
.arg(
|
||||
Arg::new("state-cache-headroom")
|
||||
.long("state-cache-headroom")
|
||||
.value_name("N")
|
||||
.help("Minimum number of states to cull from the state cache when it gets full")
|
||||
.default_value("1")
|
||||
.action(ArgAction::Set)
|
||||
.display_order(0)
|
||||
)
|
||||
.arg(
|
||||
Arg::new("block-cache-size")
|
||||
.long("block-cache-size")
|
||||
@@ -812,7 +821,7 @@ pub fn cli_app() -> Command {
|
||||
.long("state-cache-size")
|
||||
.value_name("STATE_CACHE_SIZE")
|
||||
.help("Specifies the size of the state cache")
|
||||
.default_value("128")
|
||||
.default_value("32")
|
||||
.action(ArgAction::Set)
|
||||
.display_order(0)
|
||||
)
|
||||
@@ -1009,7 +1018,7 @@ pub fn cli_app() -> Command {
|
||||
database when they are older than the data availability boundary \
|
||||
relative to the current epoch.")
|
||||
.action(ArgAction::Set)
|
||||
.default_value("1")
|
||||
.default_value("256")
|
||||
.display_order(0)
|
||||
)
|
||||
.arg(
|
||||
@@ -1646,5 +1655,13 @@ pub fn cli_app() -> Command {
|
||||
.hide(true)
|
||||
.display_order(0)
|
||||
)
|
||||
.arg(
|
||||
Arg::new("invalid-block-roots")
|
||||
.long("invalid-block-roots")
|
||||
.value_name("FILE")
|
||||
.help("Path to a comma separated file containing block roots that should be treated as invalid during block verification.")
|
||||
.action(ArgAction::Set)
|
||||
.hide(true)
|
||||
)
|
||||
.group(ArgGroup::new("enable_http").args(["http", "gui", "staking"]).multiple(true))
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use account_utils::{read_input_from_user, STDIN_INPUTS_FLAG};
|
||||
use beacon_chain::chain_config::{
|
||||
DisallowedReOrgOffsets, ReOrgThreshold, DEFAULT_PREPARE_PAYLOAD_LOOKAHEAD_FACTOR,
|
||||
DEFAULT_RE_ORG_HEAD_THRESHOLD, DEFAULT_RE_ORG_MAX_EPOCHS_SINCE_FINALIZATION,
|
||||
DEFAULT_RE_ORG_PARENT_THRESHOLD,
|
||||
DEFAULT_RE_ORG_PARENT_THRESHOLD, INVALID_HOLESKY_BLOCK_ROOT,
|
||||
};
|
||||
use beacon_chain::graffiti_calculator::GraffitiOrigin;
|
||||
use beacon_chain::TrustedSetup;
|
||||
@@ -19,9 +19,10 @@ use lighthouse_network::ListenAddress;
|
||||
use lighthouse_network::{multiaddr::Protocol, Enr, Multiaddr, NetworkConfig, PeerIdSerialized};
|
||||
use sensitive_url::SensitiveUrl;
|
||||
use std::cmp::max;
|
||||
use std::collections::HashSet;
|
||||
use std::fmt::Debug;
|
||||
use std::fs;
|
||||
use std::io::IsTerminal;
|
||||
use std::io::{IsTerminal, Read};
|
||||
use std::net::Ipv6Addr;
|
||||
use std::net::{IpAddr, Ipv4Addr, ToSocketAddrs};
|
||||
use std::num::NonZeroU16;
|
||||
@@ -449,6 +450,12 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.chain.epochs_per_migration = epochs_per_migration;
|
||||
}
|
||||
|
||||
if let Some(state_cache_headroom) =
|
||||
clap_utils::parse_optional(cli_args, "state-cache-headroom")?
|
||||
{
|
||||
client_config.store.state_cache_headroom = state_cache_headroom;
|
||||
}
|
||||
|
||||
if let Some(prune_blobs) = clap_utils::parse_optional(cli_args, "prune-blobs")? {
|
||||
client_config.store.prune_blobs = prune_blobs;
|
||||
}
|
||||
@@ -897,6 +904,39 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.chain.data_column_publishing_delay = Some(Duration::from_secs_f64(delay));
|
||||
}
|
||||
|
||||
if let Some(invalid_block_roots_file_path) =
|
||||
clap_utils::parse_optional::<String>(cli_args, "invalid-block-roots")?
|
||||
{
|
||||
let mut file = std::fs::File::open(invalid_block_roots_file_path)
|
||||
.map_err(|e| format!("Failed to open invalid-block-roots file: {}", e))?;
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents)
|
||||
.map_err(|e| format!("Failed to read invalid-block-roots file {}", e))?;
|
||||
let invalid_block_roots: HashSet<Hash256> = contents
|
||||
.split(',')
|
||||
.filter_map(
|
||||
|s| match Hash256::from_str(s.strip_prefix("0x").unwrap_or(s).trim()) {
|
||||
Ok(block_root) => Some(block_root),
|
||||
Err(error) => {
|
||||
warn!(
|
||||
block_root = s,
|
||||
?error,
|
||||
"Unable to parse invalid block root",
|
||||
);
|
||||
None
|
||||
}
|
||||
},
|
||||
)
|
||||
.collect();
|
||||
client_config.chain.invalid_block_roots = invalid_block_roots;
|
||||
} else if spec
|
||||
.config_name
|
||||
.as_ref()
|
||||
.is_some_and(|network_name| network_name == "holesky")
|
||||
{
|
||||
client_config.chain.invalid_block_roots = HashSet::from([*INVALID_HOLESKY_BLOCK_ROOT]);
|
||||
}
|
||||
|
||||
Ok(client_config)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user