mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Altair networking (#2300)
## Issue Addressed Resolves #2278 ## Proposed Changes Implements the networking components for the Altair hard fork https://github.com/ethereum/eth2.0-specs/blob/dev/specs/altair/p2p-interface.md ## Additional Info This PR acts as the base branch for networking changes and tracks https://github.com/sigp/lighthouse/pull/2279 . Changes to gossip, rpc and discovery can be separate PRs to be merged here for ease of review. Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
@@ -1380,23 +1380,27 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
let enr = network_globals.local_enr();
|
||||
let p2p_addresses = enr.multiaddr_p2p_tcp();
|
||||
let discovery_addresses = enr.multiaddr_p2p_udp();
|
||||
let meta_data = network_globals.local_metadata.read();
|
||||
Ok(api_types::GenericResponse::from(api_types::IdentityData {
|
||||
peer_id: network_globals.local_peer_id().to_base58(),
|
||||
enr,
|
||||
p2p_addresses,
|
||||
discovery_addresses,
|
||||
metadata: api_types::MetaData {
|
||||
seq_number: network_globals.local_metadata.read().seq_number,
|
||||
seq_number: *meta_data.seq_number(),
|
||||
attnets: format!(
|
||||
"0x{}",
|
||||
hex::encode(meta_data.attnets().clone().into_bytes()),
|
||||
),
|
||||
syncnets: format!(
|
||||
"0x{}",
|
||||
hex::encode(
|
||||
network_globals
|
||||
.local_metadata
|
||||
.read()
|
||||
.attnets
|
||||
.clone()
|
||||
meta_data
|
||||
.syncnets()
|
||||
.map(|x| x.clone())
|
||||
.unwrap_or_default()
|
||||
.into_bytes()
|
||||
),
|
||||
)
|
||||
),
|
||||
},
|
||||
}))
|
||||
@@ -1896,7 +1900,7 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
|
||||
publish_network_message(
|
||||
&network_tx,
|
||||
NetworkMessage::Subscribe {
|
||||
NetworkMessage::AttestationSubscribe {
|
||||
subscriptions: vec![subscription],
|
||||
},
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user