mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 14:24:44 +00:00
Merge branch 'unstable' into deneb-free-blobs
# Conflicts: # .github/workflows/docker.yml # .github/workflows/local-testnet.yml # .github/workflows/test-suite.yml # Cargo.lock # Cargo.toml # beacon_node/beacon_chain/src/beacon_chain.rs # beacon_node/beacon_chain/src/builder.rs # beacon_node/beacon_chain/src/test_utils.rs # beacon_node/execution_layer/src/engine_api/json_structures.rs # beacon_node/network/src/beacon_processor/mod.rs # beacon_node/network/src/beacon_processor/worker/gossip_methods.rs # beacon_node/network/src/sync/backfill_sync/mod.rs # beacon_node/store/src/config.rs # beacon_node/store/src/hot_cold_store.rs # common/eth2_network_config/Cargo.toml # consensus/ssz/src/decode/impls.rs # consensus/ssz_derive/src/lib.rs # consensus/ssz_derive/tests/tests.rs # consensus/ssz_types/src/serde_utils/mod.rs # consensus/tree_hash/src/impls.rs # consensus/tree_hash/src/lib.rs # consensus/types/Cargo.toml # consensus/types/src/beacon_state.rs # consensus/types/src/chain_spec.rs # consensus/types/src/eth_spec.rs # consensus/types/src/fork_name.rs # lcli/Cargo.toml # lcli/src/main.rs # lcli/src/new_testnet.rs # scripts/local_testnet/el_bootnode.sh # scripts/local_testnet/genesis.json # scripts/local_testnet/geth.sh # scripts/local_testnet/setup.sh # scripts/local_testnet/start_local_testnet.sh # scripts/local_testnet/vars.env # scripts/tests/doppelganger_protection.sh # scripts/tests/genesis.json # scripts/tests/vars.env # testing/ef_tests/Cargo.toml # validator_client/src/block_service.rs
This commit is contained in:
@@ -130,7 +130,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
Arg::with_name("target-peers")
|
||||
.long("target-peers")
|
||||
.help("The target number of peers.")
|
||||
.default_value("80")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
@@ -255,6 +254,12 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.help("One or more comma-delimited trusted peer ids which always have the highest score according to the peer scoring system.")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("genesis-backfill")
|
||||
.long("genesis-backfill")
|
||||
.help("Attempts to download blocks all the way back to genesis when checkpoint syncing.")
|
||||
.takes_value(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("enable-private-discovery")
|
||||
.long("enable-private-discovery")
|
||||
@@ -276,6 +281,15 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.min_values(0)
|
||||
.hidden(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("proposer-only")
|
||||
.long("proposer-only")
|
||||
.help("Sets this beacon node at be a block proposer only node. \
|
||||
This will run the beacon node in a minimal configuration that is sufficient for block publishing only. This flag should be used \
|
||||
for a beacon node being referenced by validator client using the --proposer-node flag. This configuration is for enabling more secure setups.")
|
||||
.takes_value(false),
|
||||
)
|
||||
|
||||
.arg(
|
||||
Arg::with_name("disable-backfill-rate-limiting")
|
||||
.long("disable-backfill-rate-limiting")
|
||||
@@ -518,6 +532,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.help("Specifies how many blocks the database should cache in memory [default: 5]")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("historic-state-cache-size")
|
||||
.long("historic-state-cache-size")
|
||||
.value_name("SIZE")
|
||||
.help("Specifies how many states from the freezer database should cache in memory [default: 1]")
|
||||
.takes_value(true)
|
||||
)
|
||||
/*
|
||||
* Execution Layer Integration
|
||||
*/
|
||||
@@ -858,7 +879,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.arg(
|
||||
Arg::with_name("reconstruct-historic-states")
|
||||
.long("reconstruct-historic-states")
|
||||
.help("After a checkpoint sync, reconstruct historic states in the database.")
|
||||
.help("After a checkpoint sync, reconstruct historic states in the database. This requires syncing all the way back to genesis.")
|
||||
.takes_value(false)
|
||||
)
|
||||
.arg(
|
||||
@@ -1102,7 +1123,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.long("gui")
|
||||
.hidden(true)
|
||||
.help("Enable the graphical user interface and all its requirements. \
|
||||
This is equivalent to --http and --validator-monitor-auto.")
|
||||
This enables --http and --validator-monitor-auto and enables SSE logging.")
|
||||
.takes_value(false)
|
||||
)
|
||||
.arg(
|
||||
@@ -1114,4 +1135,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
// always using the builder.
|
||||
.conflicts_with("builder-profit-threshold")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("invalid-gossip-verified-blocks-path")
|
||||
.long("invalid-gossip-verified-blocks-path")
|
||||
.value_name("PATH")
|
||||
.help("If a block succeeds gossip validation whilst failing full validation, store \
|
||||
the block SSZ as a file at this path. This feature is only recommended for \
|
||||
developers. This directory is not pruned, users should be careful to avoid \
|
||||
filling up their disks.")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -404,6 +404,12 @@ pub fn get_config<E: EthSpec>(
|
||||
.map_err(|_| "block-cache-size is not a valid integer".to_string())?;
|
||||
}
|
||||
|
||||
if let Some(historic_state_cache_size) = cli_args.value_of("historic-state-cache-size") {
|
||||
client_config.store.historic_state_cache_size = historic_state_cache_size
|
||||
.parse()
|
||||
.map_err(|_| "historic-state-cache-size is not a valid integer".to_string())?;
|
||||
}
|
||||
|
||||
client_config.store.compact_on_init = cli_args.is_present("compact-db");
|
||||
if let Some(compact_on_prune) = cli_args.value_of("auto-compact-db") {
|
||||
client_config.store.compact_on_prune = compact_on_prune
|
||||
@@ -539,6 +545,7 @@ pub fn get_config<E: EthSpec>(
|
||||
|
||||
if cli_args.is_present("reconstruct-historic-states") {
|
||||
client_config.chain.reconstruct_historic_states = true;
|
||||
client_config.chain.genesis_backfill = true;
|
||||
}
|
||||
|
||||
let raw_graffiti = if let Some(graffiti) = cli_args.value_of("graffiti") {
|
||||
@@ -811,6 +818,9 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.chain.optimistic_finalized_sync =
|
||||
!cli_args.is_present("disable-optimistic-finalized-sync");
|
||||
|
||||
if cli_args.is_present("genesis-backfill") {
|
||||
client_config.chain.genesis_backfill = true;
|
||||
}
|
||||
// Payload selection configs
|
||||
if cli_args.is_present("always-prefer-builder-payload") {
|
||||
client_config.always_prefer_builder_payload = true;
|
||||
@@ -820,6 +830,11 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.chain.enable_backfill_rate_limiting =
|
||||
!cli_args.is_present("disable-backfill-rate-limiting");
|
||||
|
||||
if let Some(path) = clap_utils::parse_optional(cli_args, "invalid-gossip-verified-blocks-path")?
|
||||
{
|
||||
client_config.network.invalid_block_storage = Some(path);
|
||||
}
|
||||
|
||||
Ok(client_config)
|
||||
}
|
||||
|
||||
@@ -1016,10 +1031,13 @@ pub fn set_network_config(
|
||||
|
||||
config.set_listening_addr(parse_listening_addresses(cli_args, log)?);
|
||||
|
||||
// A custom target-peers command will overwrite the --proposer-only default.
|
||||
if let Some(target_peers_str) = cli_args.value_of("target-peers") {
|
||||
config.target_peers = target_peers_str
|
||||
.parse::<usize>()
|
||||
.map_err(|_| format!("Invalid number of target peers: {}", target_peers_str))?;
|
||||
} else {
|
||||
config.target_peers = 80; // default value
|
||||
}
|
||||
|
||||
if let Some(value) = cli_args.value_of("network-load") {
|
||||
@@ -1078,6 +1096,9 @@ pub fn set_network_config(
|
||||
.map_err(|_| format!("Invalid trusted peer id: {}", peer_id))
|
||||
})
|
||||
.collect::<Result<Vec<PeerIdSerialized>, _>>()?;
|
||||
if config.trusted_peers.len() >= config.target_peers {
|
||||
slog::warn!(log, "More trusted peers than the target peer limit. This will prevent efficient peer selection criteria."; "target_peers" => config.target_peers, "trusted_peers" => config.trusted_peers.len());
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(enr_udp_port_str) = cli_args.value_of("enr-udp-port") {
|
||||
@@ -1255,6 +1276,20 @@ pub fn set_network_config(
|
||||
config.outbound_rate_limiter_config = Some(Default::default());
|
||||
}
|
||||
|
||||
// Proposer-only mode overrides a number of previous configuration parameters.
|
||||
// Specifically, we avoid subscribing to long-lived subnets and wish to maintain a minimal set
|
||||
// of peers.
|
||||
if cli_args.is_present("proposer-only") {
|
||||
config.subscribe_all_subnets = false;
|
||||
|
||||
if cli_args.value_of("target-peers").is_none() {
|
||||
// If a custom value is not set, change the default to 15
|
||||
config.target_peers = 15;
|
||||
}
|
||||
config.proposer_only = true;
|
||||
warn!(log, "Proposer-only mode enabled"; "info"=> "Do not connect a validator client to this node unless via the --proposer-nodes flag");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user