Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-payload-processing

This commit is contained in:
Eitan Seri- Levi
2026-02-12 14:18:46 -08:00
21 changed files with 136 additions and 107 deletions

View File

@@ -19,7 +19,7 @@ alloy-primitives = { workspace = true }
bitvec = { workspace = true }
bls = { workspace = true }
educe = { workspace = true }
eth2 = { workspace = true, features = ["lighthouse"] }
eth2 = { workspace = true, features = ["lighthouse", "network"] }
eth2_network_config = { workspace = true }
ethereum_hashing = { workspace = true }
ethereum_serde_utils = { workspace = true }

View File

@@ -1683,7 +1683,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let validator_index = *validator_index as usize;
committee_cache.get_attestation_duties(validator_index)
})
.collect();
.collect::<Result<Vec<_>, _>>()?;
Ok((duties, dependent_root))
},

View File

@@ -2,6 +2,7 @@ use crate::data_availability_checker::{AvailableBlock, AvailableBlockData};
use crate::{BeaconChainError as Error, metrics};
use parking_lot::RwLock;
use proto_array::Block as ProtoBlock;
use safe_arith::SafeArith;
use std::sync::Arc;
use tracing::instrument;
use types::*;
@@ -59,12 +60,13 @@ impl CommitteeLengths {
slots_per_epoch,
committees_per_slot,
committee_index as usize,
);
)?;
let epoch_committee_count = committees_per_slot.safe_mul(slots_per_epoch)?;
let range = compute_committee_range_in_epoch(
epoch_committee_count(committees_per_slot, slots_per_epoch),
epoch_committee_count,
index_in_epoch,
self.active_validator_indices_len,
)
)?
.ok_or(Error::EarlyAttesterCacheError)?;
range

View File

@@ -13,7 +13,7 @@ arc-swap = "1.6.0"
bls = { workspace = true }
builder_client = { path = "../builder_client" }
bytes = { workspace = true }
eth2 = { workspace = true, features = ["events", "lighthouse"] }
eth2 = { workspace = true, features = ["events", "lighthouse", "network"] }
ethereum_serde_utils = { workspace = true }
ethereum_ssz = { workspace = true }
fixed_bytes = { workspace = true }

View File

@@ -14,7 +14,7 @@ bytes = { workspace = true }
context_deserialize = { workspace = true }
directory = { workspace = true }
either = { workspace = true }
eth2 = { workspace = true, features = ["lighthouse"] }
eth2 = { workspace = true, features = ["lighthouse", "network"] }
ethereum_serde_utils = { workspace = true }
ethereum_ssz = { workspace = true }
execution_layer = { workspace = true }

View File

@@ -2140,12 +2140,9 @@ pub fn serve<T: BeaconChainTypes>(
let discovery_addresses = enr.multiaddr_p2p_udp();
Ok(api_types::GenericResponse::from(api_types::IdentityData {
peer_id: network_globals.local_peer_id().to_base58(),
enr: enr.to_base64(),
p2p_addresses: p2p_addresses.iter().map(|a| a.to_string()).collect(),
discovery_addresses: discovery_addresses
.iter()
.map(|a| a.to_string())
.collect(),
enr,
p2p_addresses,
discovery_addresses,
metadata: utils::from_meta_data::<T::EthSpec>(
&network_globals.local_metadata,
&chain.spec,

View File

@@ -2855,19 +2855,9 @@ impl ApiTester {
let expected = IdentityData {
peer_id: self.local_enr.peer_id().to_string(),
enr: self.local_enr.to_base64(),
p2p_addresses: self
.local_enr
.multiaddr_p2p_tcp()
.iter()
.map(|a| a.to_string())
.collect(),
discovery_addresses: self
.local_enr
.multiaddr_p2p_udp()
.iter()
.map(|a| a.to_string())
.collect(),
enr: self.local_enr.clone(),
p2p_addresses: self.local_enr.multiaddr_p2p_tcp(),
discovery_addresses: self.local_enr.multiaddr_p2p_udp(),
metadata: MetaData::V2(MetaDataV2 {
seq_number: 0,
attnets: "0x0000000000000000".to_string(),
@@ -2896,7 +2886,7 @@ impl ApiTester {
pub async fn test_get_node_peers_by_id(self) -> Self {
let result = self
.client
.get_node_peers_by_id(&self.external_peer_id.to_string())
.get_node_peers_by_id(self.external_peer_id)
.await
.unwrap()
.data;

View File

@@ -200,11 +200,23 @@ pub fn build_enr<E: EthSpec>(
builder.ip6(*ip);
}
if let Some(udp4_port) = config.enr_udp4_port {
// If the ENR port is not set, and we are listening over that ip version, use the listening
// discovery port instead.
if let Some(udp4_port) = config.enr_udp4_port.or_else(|| {
config
.listen_addrs()
.v4()
.and_then(|v4_addr| v4_addr.disc_port.try_into().ok())
}) {
builder.udp4(udp4_port.get());
}
if let Some(udp6_port) = config.enr_udp6_port {
if let Some(udp6_port) = config.enr_udp6_port.or_else(|| {
config
.listen_addrs()
.v6()
.and_then(|v6_addr| v6_addr.disc_port.try_into().ok())
}) {
builder.udp6(udp6_port.get());
}