Merge branch 'unstable' into electra-focil

This commit is contained in:
jacobkaufmann
2024-12-26 12:54:09 -05:00
230 changed files with 3831 additions and 3317 deletions

View File

@@ -247,6 +247,18 @@ pub fn cli_app() -> Command {
.help_heading(FLAG_HEADER)
.display_order(0)
)
.arg(
Arg::new("http-token-path")
.long("http-token-path")
.requires("http")
.value_name("HTTP_TOKEN_PATH")
.help(
"Path to file containing the HTTP API token for validator client authentication. \
If not specified, defaults to {validators-dir}/api-token.txt."
)
.action(ArgAction::Set)
.display_order(0)
)
/* Prometheus metrics HTTP server related arguments */
.arg(
Arg::new("metrics")

View File

@@ -17,7 +17,7 @@ use std::path::PathBuf;
use std::str::FromStr;
use std::time::Duration;
use types::{Address, GRAFFITI_BYTES_LEN};
use validator_http_api;
use validator_http_api::{self, PK_FILENAME};
use validator_http_metrics;
use validator_store::Config as ValidatorStoreConfig;
@@ -314,6 +314,12 @@ impl Config {
config.http_api.store_passwords_in_secrets_dir = true;
}
if cli_args.get_one::<String>("http-token-path").is_some() {
config.http_api.http_token_path = parse_required(cli_args, "http-token-path")
// For backward compatibility, default to the path under the validator dir if not provided.
.unwrap_or_else(|_| config.validator_dir.join(PK_FILENAME));
}
/*
* Prometheus metrics HTTP server
*/

View File

@@ -568,7 +568,7 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
let (block_service_tx, block_service_rx) = mpsc::channel(channel_capacity);
let log = self.context.log();
let api_secret = ApiSecret::create_or_open(&self.config.validator_dir)?;
let api_secret = ApiSecret::create_or_open(&self.config.http_api.http_token_path)?;
self.http_api_listen_addr = if self.config.http_api.enabled {
let ctx = Arc::new(validator_http_api::Context {