Mallory - Single commit

This commit is contained in:
Age Manning
2025-05-12 15:23:29 +10:00
parent b35854b71f
commit 2b9aed4020
21 changed files with 679 additions and 184 deletions

View File

@@ -5,7 +5,7 @@ mod metrics;
mod nat;
mod network_beacon_processor;
mod persisted_dht;
mod router;
pub mod router;
mod status;
mod subnet_service;
mod sync;

View File

@@ -314,6 +314,7 @@ impl<T: BeaconChainTypes> Router<T> {
Response::LightClientBootstrap(_)
| Response::LightClientOptimisticUpdate(_)
| Response::LightClientFinalityUpdate(_)
| Response::Ping(_)
| Response::LightClientUpdatesByRange(_) => unreachable!(),
}
}

View File

@@ -266,6 +266,8 @@ impl<T: BeaconChainTypes> NetworkService<T> {
debug!(fork_name = ?fork_context.current_fork(), "Current fork");
let keypair = lighthouse_network::load_private_key(&config);
// construct the libp2p service context
let service_context = Context {
config: config.clone(),
@@ -273,6 +275,8 @@ impl<T: BeaconChainTypes> NetworkService<T> {
fork_context: fork_context.clone(),
chain_spec: beacon_chain.spec.clone(),
libp2p_registry,
keypair,
incoming_connections: None,
};
// launch libp2p service
@@ -283,6 +287,7 @@ impl<T: BeaconChainTypes> NetworkService<T> {
.data_availability_checker
.custody_context()
.custody_group_count_at_head(&beacon_chain.spec),
None,
)
.await?;
@@ -487,6 +492,11 @@ impl<T: BeaconChainTypes> NetworkService<T> {
shutdown_sender: &mut Sender<ShutdownReason>,
) {
match ev {
// mallory event
NetworkEvent::MallorySwarmEvent(_) => {}
// mallory event
NetworkEvent::IdentifyReceived(_) => {}
NetworkEvent::PeerConnectedOutgoing(peer_id) => {
self.send_to_router(RouterMessage::StatusPeer(peer_id));
}