mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
* multiple broadcast flags * rewrite with single --broadcast option * satisfy cargo fmt * shorten sync-committee-messages * fix a doc comment and a test * use strum * Add broadcast test to simulator * bring --disable-run-on-all flag back with deprecation notice
This commit is contained in:
committed by
GitHub
parent
e856a904ef
commit
b4556a3d62
@@ -1,3 +1,4 @@
|
||||
use crate::beacon_node_fallback::ApiTopic;
|
||||
use crate::graffiti_file::GraffitiFile;
|
||||
use crate::{http_api, http_metrics};
|
||||
use clap::ArgMatches;
|
||||
@@ -9,7 +10,7 @@ use directory::{
|
||||
use eth2::types::Graffiti;
|
||||
use sensitive_url::SensitiveUrl;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use slog::{info, Logger};
|
||||
use slog::{info, warn, Logger};
|
||||
use std::fs;
|
||||
use std::net::IpAddr;
|
||||
use std::path::PathBuf;
|
||||
@@ -73,8 +74,8 @@ pub struct Config {
|
||||
///
|
||||
/// This is *not* recommended in prod and should only be used for testing.
|
||||
pub block_delay: Option<Duration>,
|
||||
/// Disables publishing http api requests to all beacon nodes for select api calls.
|
||||
pub disable_run_on_all: bool,
|
||||
/// Enables broadcasting of various requests (by topic) to all beacon nodes.
|
||||
pub broadcast_topics: Vec<ApiTopic>,
|
||||
/// Enables a service which attempts to measure latency between the VC and BNs.
|
||||
pub enable_latency_measurement_service: bool,
|
||||
/// Defines the number of validators per `validator/register_validator` request sent to the BN.
|
||||
@@ -117,7 +118,7 @@ impl Default for Config {
|
||||
builder_proposals: false,
|
||||
builder_registration_timestamp_override: None,
|
||||
gas_limit: None,
|
||||
disable_run_on_all: false,
|
||||
broadcast_topics: vec![ApiTopic::Subscriptions],
|
||||
enable_latency_measurement_service: true,
|
||||
validator_registration_batch_size: 500,
|
||||
}
|
||||
@@ -179,7 +180,6 @@ impl Config {
|
||||
.map_err(|e| format!("Unable to parse proposer node URL: {:?}", e))?;
|
||||
}
|
||||
|
||||
config.disable_run_on_all = cli_args.is_present("disable-run-on-all");
|
||||
config.disable_auto_discover = cli_args.is_present("disable-auto-discover");
|
||||
config.init_slashing_protection = cli_args.is_present("init-slashing-protection");
|
||||
config.use_long_timeouts = cli_args.is_present("use-long-timeouts");
|
||||
@@ -222,6 +222,26 @@ impl Config {
|
||||
config.beacon_nodes_tls_certs = Some(tls_certs.split(',').map(PathBuf::from).collect());
|
||||
}
|
||||
|
||||
if cli_args.is_present("disable-run-on-all") {
|
||||
warn!(
|
||||
log,
|
||||
"The --disable-run-on-all flag is deprecated";
|
||||
"msg" => "please use --broadcast instead"
|
||||
);
|
||||
config.broadcast_topics = vec![];
|
||||
}
|
||||
if let Some(broadcast_topics) = cli_args.value_of("broadcast") {
|
||||
config.broadcast_topics = broadcast_topics
|
||||
.split(',')
|
||||
.filter(|t| *t != "none")
|
||||
.map(|t| {
|
||||
t.trim()
|
||||
.parse::<ApiTopic>()
|
||||
.map_err(|_| format!("Unknown API topic to broadcast: {t}"))
|
||||
})
|
||||
.collect::<Result<_, _>>()?;
|
||||
}
|
||||
|
||||
/*
|
||||
* Http API server
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user