Add network feature to eth2 (#8558)

This reverts some of the changes from #8524 by adding back the typed network endpoints with an optional `network` feature. Without the `network` feature, these endpoints (and associated dependencies) will not be built.

This means the `enr`, `multiaddr` and `libp2p-identity` dependencies have returned but are now optional


Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
Mac L
2026-02-13 00:51:26 +04:00
committed by GitHub
parent 96bc5617d0
commit 036ba1f221
9 changed files with 31 additions and 28 deletions

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,