mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +00:00
Merge branch 'unstable' into deneb-merge-from-unstable-20230613
This commit is contained in:
@@ -834,8 +834,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
Arg::with_name("slasher-broadcast")
|
||||
.long("slasher-broadcast")
|
||||
.help("Broadcast slashings found by the slasher to the rest of the network \
|
||||
[disabled by default].")
|
||||
.requires("slasher")
|
||||
[Enabled by default].")
|
||||
.takes_value(true)
|
||||
.default_value("true")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("slasher-backend")
|
||||
|
||||
@@ -670,7 +670,9 @@ pub fn get_config<E: EthSpec>(
|
||||
slasher_config.validator_chunk_size = validator_chunk_size;
|
||||
}
|
||||
|
||||
slasher_config.broadcast = cli_args.is_present("slasher-broadcast");
|
||||
if let Some(broadcast) = clap_utils::parse_optional(cli_args, "slasher-broadcast")? {
|
||||
slasher_config.broadcast = broadcast;
|
||||
}
|
||||
|
||||
if let Some(backend) = clap_utils::parse_optional(cli_args, "slasher-backend")? {
|
||||
slasher_config.backend = backend;
|
||||
|
||||
@@ -16,7 +16,7 @@ pub use client::{Client, ClientBuilder, ClientConfig, ClientGenesis};
|
||||
pub use config::{get_config, get_data_dir, get_slots_per_restore_point, set_network_config};
|
||||
use environment::RuntimeContext;
|
||||
pub use eth2_config::Eth2Config;
|
||||
use slasher::Slasher;
|
||||
use slasher::{DatabaseBackendOverride, Slasher};
|
||||
use slog::{info, warn};
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::sync::Arc;
|
||||
@@ -93,7 +93,27 @@ impl<E: EthSpec> ProductionBeaconNode<E> {
|
||||
log.clone(),
|
||||
)?;
|
||||
|
||||
let builder = if let Some(slasher_config) = client_config.slasher.clone() {
|
||||
let builder = if let Some(mut slasher_config) = client_config.slasher.clone() {
|
||||
match slasher_config.override_backend() {
|
||||
DatabaseBackendOverride::Success(old_backend) => {
|
||||
info!(
|
||||
log,
|
||||
"Slasher backend overriden";
|
||||
"reason" => "database exists",
|
||||
"configured_backend" => %old_backend,
|
||||
"override_backend" => %slasher_config.backend,
|
||||
);
|
||||
}
|
||||
DatabaseBackendOverride::Failure(path) => {
|
||||
warn!(
|
||||
log,
|
||||
"Slasher backend override failed";
|
||||
"advice" => "delete old MDBX database or enable MDBX backend",
|
||||
"path" => path.display()
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
let slasher = Arc::new(
|
||||
Slasher::open(slasher_config, log.new(slog::o!("service" => "slasher")))
|
||||
.map_err(|e| format!("Slasher open error: {:?}", e))?,
|
||||
|
||||
Reference in New Issue
Block a user