mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-01 19:53:32 +00:00
Merge unstable 20230925 into deneb-free-blobs.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "lighthouse"
|
||||
version = "4.4.1"
|
||||
version = "4.5.0"
|
||||
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
||||
edition = "2021"
|
||||
edition = { workspace = true }
|
||||
autotests = false
|
||||
rust-version = "1.68.2"
|
||||
rust-version = "1.69.0"
|
||||
|
||||
[features]
|
||||
default = ["slasher-lmdb"]
|
||||
@@ -28,45 +28,45 @@ slasher-lmdb = ["slasher/lmdb"]
|
||||
jemalloc = ["malloc_utils/jemalloc"]
|
||||
|
||||
[dependencies]
|
||||
beacon_node = { "path" = "../beacon_node" }
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
sloggers = { version = "2.1.1", features = ["json"] }
|
||||
types = { "path" = "../consensus/types" }
|
||||
bls = { path = "../crypto/bls" }
|
||||
ethereum_hashing = "1.0.0-beta.2"
|
||||
clap = "2.33.3"
|
||||
env_logger = "0.9.0"
|
||||
environment = { path = "./environment" }
|
||||
beacon_node = { workspace = true }
|
||||
slog = { workspace = true }
|
||||
sloggers = { workspace = true }
|
||||
types = { workspace = true }
|
||||
bls = { workspace = true }
|
||||
ethereum_hashing = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
env_logger = { workspace = true }
|
||||
environment = { workspace = true }
|
||||
boot_node = { path = "../boot_node" }
|
||||
futures = "0.3.7"
|
||||
validator_client = { "path" = "../validator_client" }
|
||||
futures = { workspace = true }
|
||||
validator_client = { workspace = true }
|
||||
account_manager = { "path" = "../account_manager" }
|
||||
clap_utils = { path = "../common/clap_utils" }
|
||||
eth2_network_config = { path = "../common/eth2_network_config" }
|
||||
lighthouse_version = { path = "../common/lighthouse_version" }
|
||||
account_utils = { path = "../common/account_utils" }
|
||||
lighthouse_metrics = { path = "../common/lighthouse_metrics" }
|
||||
lazy_static = "1.4.0"
|
||||
serde = { version = "1.0.116", features = ["derive"] }
|
||||
serde_json = "1.0.59"
|
||||
serde_yaml = "0.8.13"
|
||||
task_executor = { path = "../common/task_executor" }
|
||||
malloc_utils = { path = "../common/malloc_utils" }
|
||||
directory = { path = "../common/directory" }
|
||||
unused_port = { path = "../common/unused_port" }
|
||||
clap_utils = { workspace = true }
|
||||
eth2_network_config = { workspace = true }
|
||||
lighthouse_version = { workspace = true }
|
||||
account_utils = { workspace = true }
|
||||
lighthouse_metrics = { workspace = true }
|
||||
lazy_static = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
serde_yaml = { workspace = true }
|
||||
task_executor = { workspace = true }
|
||||
malloc_utils = { workspace = true }
|
||||
directory = { workspace = true }
|
||||
unused_port = { workspace = true }
|
||||
database_manager = { path = "../database_manager" }
|
||||
slasher = { path = "../slasher" }
|
||||
slasher = { workspace = true }
|
||||
validator_manager = { path = "../validator_manager" }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.1.0"
|
||||
validator_dir = { path = "../common/validator_dir" }
|
||||
slashing_protection = { path = "../validator_client/slashing_protection" }
|
||||
lighthouse_network = { path = "../beacon_node/lighthouse_network" }
|
||||
sensitive_url = { path = "../common/sensitive_url" }
|
||||
eth1 = { path = "../beacon_node/eth1" }
|
||||
eth2 = { path = "../common/eth2" }
|
||||
beacon_processor = { path = "../beacon_node/beacon_processor" }
|
||||
tempfile = { workspace = true }
|
||||
validator_dir = { workspace = true }
|
||||
slashing_protection = { workspace = true }
|
||||
lighthouse_network = { workspace = true }
|
||||
sensitive_url = { workspace = true }
|
||||
eth1 = { workspace = true }
|
||||
eth2 = { workspace = true }
|
||||
beacon_processor = { workspace = true }
|
||||
|
||||
[[test]]
|
||||
name = "lighthouse_tests"
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
name = "environment"
|
||||
version = "0.1.2"
|
||||
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2021"
|
||||
edition = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.14.0", features = ["macros", "rt", "rt-multi-thread", "signal" ] }
|
||||
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
||||
sloggers = { version = "2.1.1", features = ["json"] }
|
||||
types = { path = "../../consensus/types" }
|
||||
eth2_config = { path = "../../common/eth2_config" }
|
||||
task_executor = { path = "../../common/task_executor" }
|
||||
eth2_network_config = { path = "../../common/eth2_network_config" }
|
||||
logging = { path = "../../common/logging" }
|
||||
slog-term = "2.6.0"
|
||||
slog-async = "2.5.0"
|
||||
futures = "0.3.7"
|
||||
tokio = { workspace = true }
|
||||
slog = { workspace = true }
|
||||
sloggers = { workspace = true }
|
||||
types = { workspace = true }
|
||||
eth2_config = { workspace = true }
|
||||
task_executor = { workspace = true }
|
||||
eth2_network_config = { workspace = true }
|
||||
logging = { workspace = true }
|
||||
slog-term = { workspace = true }
|
||||
slog-async = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
slog-json = "2.3.0"
|
||||
exit-future = "0.2.0"
|
||||
serde = "1.0.116"
|
||||
exit-future = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_derive = "1.0.116"
|
||||
|
||||
[target.'cfg(not(target_family = "unix"))'.dependencies]
|
||||
|
||||
@@ -8,6 +8,7 @@ use env_logger::{Builder, Env};
|
||||
use environment::{EnvironmentBuilder, LoggerConfig};
|
||||
use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK, HARDCODED_NET_NAMES};
|
||||
use ethereum_hashing::have_sha_extensions;
|
||||
use futures::TryFutureExt;
|
||||
use lighthouse_version::VERSION;
|
||||
use malloc_utils::configure_memory_allocator;
|
||||
use slog::{crit, info, warn};
|
||||
@@ -659,8 +660,8 @@ fn run<E: EthSpec>(
|
||||
executor.clone().spawn(
|
||||
async move {
|
||||
if let Err(e) = ProductionValidatorClient::new(context, config)
|
||||
.and_then(|mut vc| async move { vc.start_service().await })
|
||||
.await
|
||||
.and_then(|mut vc| vc.start_service())
|
||||
{
|
||||
crit!(log, "Failed to start validator client"; "reason" => e);
|
||||
// Ignore the error since it always occurs during normal operation when
|
||||
|
||||
@@ -1042,12 +1042,12 @@ fn network_port_flag_over_ipv4() {
|
||||
.run()
|
||||
.with_config(|config| {
|
||||
assert_eq!(
|
||||
config
|
||||
.network
|
||||
.listen_addrs()
|
||||
.v4()
|
||||
.map(|listen_addr| (listen_addr.udp_port, listen_addr.tcp_port)),
|
||||
Some((port, port))
|
||||
config.network.listen_addrs().v4().map(|listen_addr| (
|
||||
listen_addr.disc_port,
|
||||
listen_addr.quic_port,
|
||||
listen_addr.tcp_port
|
||||
)),
|
||||
Some((port, port + 1, port))
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -1060,22 +1060,22 @@ fn network_port_flag_over_ipv6() {
|
||||
.run()
|
||||
.with_config(|config| {
|
||||
assert_eq!(
|
||||
config
|
||||
.network
|
||||
.listen_addrs()
|
||||
.v6()
|
||||
.map(|listen_addr| (listen_addr.udp_port, listen_addr.tcp_port)),
|
||||
Some((port, port))
|
||||
config.network.listen_addrs().v6().map(|listen_addr| (
|
||||
listen_addr.disc_port,
|
||||
listen_addr.quic_port,
|
||||
listen_addr.tcp_port
|
||||
)),
|
||||
Some((port, port + 1, port))
|
||||
);
|
||||
});
|
||||
}
|
||||
#[test]
|
||||
fn network_port_and_discovery_port_flags_over_ipv4() {
|
||||
let tcp4_port = unused_tcp4_port().expect("Unable to find unused port.");
|
||||
let udp4_port = unused_udp4_port().expect("Unable to find unused port.");
|
||||
let disc4_port = unused_udp4_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
.flag("port", Some(tcp4_port.to_string().as_str()))
|
||||
.flag("discovery-port", Some(udp4_port.to_string().as_str()))
|
||||
.flag("discovery-port", Some(disc4_port.to_string().as_str()))
|
||||
.run()
|
||||
.with_config(|config| {
|
||||
assert_eq!(
|
||||
@@ -1083,19 +1083,19 @@ fn network_port_and_discovery_port_flags_over_ipv4() {
|
||||
.network
|
||||
.listen_addrs()
|
||||
.v4()
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)),
|
||||
Some((tcp4_port, udp4_port))
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)),
|
||||
Some((tcp4_port, disc4_port))
|
||||
);
|
||||
});
|
||||
}
|
||||
#[test]
|
||||
fn network_port_and_discovery_port_flags_over_ipv6() {
|
||||
let tcp6_port = unused_tcp6_port().expect("Unable to find unused port.");
|
||||
let udp6_port = unused_udp6_port().expect("Unable to find unused port.");
|
||||
let disc6_port = unused_udp6_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
.flag("listen-address", Some("::1"))
|
||||
.flag("port", Some(tcp6_port.to_string().as_str()))
|
||||
.flag("discovery-port", Some(udp6_port.to_string().as_str()))
|
||||
.flag("discovery-port", Some(disc6_port.to_string().as_str()))
|
||||
.run()
|
||||
.with_config(|config| {
|
||||
assert_eq!(
|
||||
@@ -1103,24 +1103,24 @@ fn network_port_and_discovery_port_flags_over_ipv6() {
|
||||
.network
|
||||
.listen_addrs()
|
||||
.v6()
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)),
|
||||
Some((tcp6_port, udp6_port))
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)),
|
||||
Some((tcp6_port, disc6_port))
|
||||
);
|
||||
});
|
||||
}
|
||||
#[test]
|
||||
fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() {
|
||||
let tcp4_port = unused_tcp4_port().expect("Unable to find unused port.");
|
||||
let udp4_port = unused_udp4_port().expect("Unable to find unused port.");
|
||||
let disc4_port = unused_udp4_port().expect("Unable to find unused port.");
|
||||
let tcp6_port = unused_tcp6_port().expect("Unable to find unused port.");
|
||||
let udp6_port = unused_udp6_port().expect("Unable to find unused port.");
|
||||
let disc6_port = unused_udp6_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
.flag("listen-address", Some("::1"))
|
||||
.flag("listen-address", Some("127.0.0.1"))
|
||||
.flag("port", Some(tcp4_port.to_string().as_str()))
|
||||
.flag("discovery-port", Some(udp4_port.to_string().as_str()))
|
||||
.flag("discovery-port", Some(disc4_port.to_string().as_str()))
|
||||
.flag("port6", Some(tcp6_port.to_string().as_str()))
|
||||
.flag("discovery-port6", Some(udp6_port.to_string().as_str()))
|
||||
.flag("discovery-port6", Some(disc6_port.to_string().as_str()))
|
||||
.run()
|
||||
.with_config(|config| {
|
||||
assert_eq!(
|
||||
@@ -1128,8 +1128,8 @@ fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() {
|
||||
.network
|
||||
.listen_addrs()
|
||||
.v4()
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)),
|
||||
Some((tcp4_port, udp4_port))
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)),
|
||||
Some((tcp4_port, disc4_port))
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
@@ -1137,8 +1137,47 @@ fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() {
|
||||
.network
|
||||
.listen_addrs()
|
||||
.v6()
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)),
|
||||
Some((tcp6_port, udp6_port))
|
||||
.map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)),
|
||||
Some((tcp6_port, disc6_port))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn network_port_discovery_quic_port_flags_over_ipv4_and_ipv6() {
|
||||
let tcp4_port = unused_tcp4_port().expect("Unable to find unused port.");
|
||||
let disc4_port = unused_udp4_port().expect("Unable to find unused port.");
|
||||
let quic4_port = unused_udp4_port().expect("Unable to find unused port.");
|
||||
let tcp6_port = unused_tcp6_port().expect("Unable to find unused port.");
|
||||
let disc6_port = unused_udp6_port().expect("Unable to find unused port.");
|
||||
let quic6_port = unused_udp6_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
.flag("listen-address", Some("::1"))
|
||||
.flag("listen-address", Some("127.0.0.1"))
|
||||
.flag("port", Some(tcp4_port.to_string().as_str()))
|
||||
.flag("discovery-port", Some(disc4_port.to_string().as_str()))
|
||||
.flag("quic-port", Some(quic4_port.to_string().as_str()))
|
||||
.flag("port6", Some(tcp6_port.to_string().as_str()))
|
||||
.flag("discovery-port6", Some(disc6_port.to_string().as_str()))
|
||||
.flag("quic-port6", Some(quic6_port.to_string().as_str()))
|
||||
.run()
|
||||
.with_config(|config| {
|
||||
assert_eq!(
|
||||
config.network.listen_addrs().v4().map(|listen_addr| (
|
||||
listen_addr.tcp_port,
|
||||
listen_addr.disc_port,
|
||||
listen_addr.quic_port
|
||||
)),
|
||||
Some((tcp4_port, disc4_port, quic4_port))
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
config.network.listen_addrs().v6().map(|listen_addr| (
|
||||
listen_addr.tcp_port,
|
||||
listen_addr.disc_port,
|
||||
listen_addr.quic_port
|
||||
)),
|
||||
Some((tcp6_port, disc6_port, quic6_port))
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -1150,6 +1189,14 @@ fn disable_discovery_flag() {
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| assert!(config.network.disable_discovery));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn disable_quic_flag() {
|
||||
CommandLineTest::new()
|
||||
.flag("disable-quic", None)
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| assert!(config.network.disable_quic_support));
|
||||
}
|
||||
#[test]
|
||||
fn disable_peer_scoring_flag() {
|
||||
CommandLineTest::new()
|
||||
@@ -1179,7 +1226,7 @@ fn default_backfill_rate_limiting_flag() {
|
||||
}
|
||||
#[test]
|
||||
fn default_boot_nodes() {
|
||||
let number_of_boot_nodes = 15;
|
||||
let number_of_boot_nodes = 17;
|
||||
|
||||
CommandLineTest::new()
|
||||
.run_with_zero_port()
|
||||
@@ -1256,6 +1303,14 @@ fn enr_udp_port_flag() {
|
||||
.with_config(|config| assert_eq!(config.network.enr_udp4_port, Some(port)));
|
||||
}
|
||||
#[test]
|
||||
fn enr_quic_port_flag() {
|
||||
let port = unused_udp4_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
.flag("enr-quic-port", Some(port.to_string().as_str()))
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| assert_eq!(config.network.enr_quic4_port, Some(port)));
|
||||
}
|
||||
#[test]
|
||||
fn enr_tcp_port_flag() {
|
||||
let port = unused_tcp4_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
@@ -1272,6 +1327,14 @@ fn enr_udp6_port_flag() {
|
||||
.with_config(|config| assert_eq!(config.network.enr_udp6_port, Some(port)));
|
||||
}
|
||||
#[test]
|
||||
fn enr_quic6_port_flag() {
|
||||
let port = unused_udp6_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
.flag("enr-quic6-port", Some(port.to_string().as_str()))
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| assert_eq!(config.network.enr_quic6_port, Some(port)));
|
||||
}
|
||||
#[test]
|
||||
fn enr_tcp6_port_flag() {
|
||||
let port = unused_tcp6_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
@@ -1294,7 +1357,7 @@ fn enr_match_flag_over_ipv4() {
|
||||
assert_eq!(
|
||||
config.network.listen_addrs().v4().map(|listen_addr| (
|
||||
listen_addr.addr,
|
||||
listen_addr.udp_port,
|
||||
listen_addr.disc_port,
|
||||
listen_addr.tcp_port
|
||||
)),
|
||||
Some((addr, udp4_port, tcp4_port))
|
||||
@@ -1319,7 +1382,7 @@ fn enr_match_flag_over_ipv6() {
|
||||
assert_eq!(
|
||||
config.network.listen_addrs().v6().map(|listen_addr| (
|
||||
listen_addr.addr,
|
||||
listen_addr.udp_port,
|
||||
listen_addr.disc_port,
|
||||
listen_addr.tcp_port
|
||||
)),
|
||||
Some((addr, udp6_port, tcp6_port))
|
||||
@@ -1351,7 +1414,7 @@ fn enr_match_flag_over_ipv4_and_ipv6() {
|
||||
assert_eq!(
|
||||
config.network.listen_addrs().v6().map(|listen_addr| (
|
||||
listen_addr.addr,
|
||||
listen_addr.udp_port,
|
||||
listen_addr.disc_port,
|
||||
listen_addr.tcp_port
|
||||
)),
|
||||
Some((ipv6_addr, udp6_port, tcp6_port))
|
||||
@@ -1359,7 +1422,7 @@ fn enr_match_flag_over_ipv4_and_ipv6() {
|
||||
assert_eq!(
|
||||
config.network.listen_addrs().v4().map(|listen_addr| (
|
||||
listen_addr.addr,
|
||||
listen_addr.udp_port,
|
||||
listen_addr.disc_port,
|
||||
listen_addr.tcp_port
|
||||
)),
|
||||
Some((ipv4_addr, udp4_port, tcp4_port))
|
||||
@@ -1435,6 +1498,7 @@ fn http_flag() {
|
||||
fn http_address_flag() {
|
||||
let addr = "127.0.0.99".parse::<IpAddr>().unwrap();
|
||||
CommandLineTest::new()
|
||||
.flag("http", None)
|
||||
.flag("http-address", Some("127.0.0.99"))
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| assert_eq!(config.http_api.listen_addr, addr));
|
||||
@@ -1443,6 +1507,7 @@ fn http_address_flag() {
|
||||
fn http_address_ipv6_flag() {
|
||||
let addr = "::1".parse::<IpAddr>().unwrap();
|
||||
CommandLineTest::new()
|
||||
.flag("http", None)
|
||||
.flag("http-address", Some("::1"))
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| assert_eq!(config.http_api.listen_addr, addr));
|
||||
@@ -1452,6 +1517,7 @@ fn http_port_flag() {
|
||||
let port1 = unused_tcp4_port().expect("Unable to find unused port.");
|
||||
let port2 = unused_tcp4_port().expect("Unable to find unused port.");
|
||||
CommandLineTest::new()
|
||||
.flag("http", None)
|
||||
.flag("http-port", Some(port1.to_string().as_str()))
|
||||
.flag("port", Some(port2.to_string().as_str()))
|
||||
.run()
|
||||
@@ -2342,6 +2408,18 @@ fn gui_flag() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multiple_http_enabled_flags() {
|
||||
CommandLineTest::new()
|
||||
.flag("gui", None)
|
||||
.flag("http", None)
|
||||
.flag("staking", None)
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| {
|
||||
assert!(config.http_api.enabled);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn optimistic_finalized_sync_default() {
|
||||
CommandLineTest::new()
|
||||
@@ -2454,6 +2532,7 @@ fn http_sse_capacity_multiplier_default() {
|
||||
#[test]
|
||||
fn http_sse_capacity_multiplier_override() {
|
||||
CommandLineTest::new()
|
||||
.flag("http", None)
|
||||
.flag("http-sse-capacity-multiplier", Some("10"))
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| assert_eq!(config.http_api.sse_capacity_multiplier, 10));
|
||||
@@ -2471,6 +2550,7 @@ fn http_duplicate_block_status_default() {
|
||||
#[test]
|
||||
fn http_duplicate_block_status_override() {
|
||||
CommandLineTest::new()
|
||||
.flag("http", None)
|
||||
.flag("http-duplicate-block-status", Some("301"))
|
||||
.run_with_zero_port()
|
||||
.with_config(|config| {
|
||||
|
||||
Reference in New Issue
Block a user