Skip to content

Commit

Permalink
chore: remove dcutr
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Jul 23, 2024
1 parent cd5f8d4 commit a48b800
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 64 deletions.
40 changes: 3 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sn_networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ libp2p = { version = "0.53", features = [
"request-response",
"cbor",
"identify",
"dcutr",
"tcp",
"relay",
"noise",
Expand Down
2 changes: 0 additions & 2 deletions sn_networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ pub(super) struct NodeBehaviour {
pub(super) upnp: libp2p::swarm::behaviour::toggle::Toggle<libp2p::upnp::tokio::Behaviour>,
pub(super) relay_client: libp2p::relay::client::Behaviour,
pub(super) relay_server: libp2p::relay::Behaviour,
pub(super) dcutr: libp2p::dcutr::Behaviour,
pub(super) kademlia: kad::Behaviour<UnifiedRecordStore>,
pub(super) request_response: request_response::cbor::Behaviour<Request, Response>,
}
Expand Down Expand Up @@ -583,7 +582,6 @@ impl NetworkBuilder {
identify,
#[cfg(feature = "local-discovery")]
mdns,
dcutr: libp2p::dcutr::Behaviour::new(peer_id),
};

#[cfg(not(target_arch = "wasm32"))]
Expand Down
6 changes: 0 additions & 6 deletions sn_networking/src/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub(super) enum NodeEvent {
#[cfg(feature = "local-discovery")]
Mdns(Box<mdns::Event>),
Identify(Box<libp2p::identify::Event>),
Dcutr(Box<libp2p::dcutr::Event>),
RelayClient(Box<libp2p::relay::client::Event>),
RelayServer(Box<libp2p::relay::Event>),
Void(void::Void),
Expand Down Expand Up @@ -79,11 +78,6 @@ impl From<libp2p::identify::Event> for NodeEvent {
NodeEvent::Identify(Box::new(event))
}
}
impl From<libp2p::dcutr::Event> for NodeEvent {
fn from(event: libp2p::dcutr::Event) -> Self {
NodeEvent::Dcutr(Box::new(event))
}
}
impl From<libp2p::relay::client::Event> for NodeEvent {
fn from(event: libp2p::relay::client::Event) -> Self {
NodeEvent::RelayClient(Box::new(event))
Expand Down
12 changes: 0 additions & 12 deletions sn_networking/src/event/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,6 @@ impl SwarmDriver {
event_string = "kad_event";
self.handle_kad_event(kad_event)?;
}
SwarmEvent::Behaviour(NodeEvent::Dcutr(event)) => {
#[cfg(feature = "open-metrics")]
if let Some(metrics) = &self.network_metrics {
metrics.record(&(*event));
}

event_string = "dcutr_event";
info!(
"Dcutr with remote peer: {:?} is: {:?}",
event.remote_peer_id, event.result
);
}
SwarmEvent::Behaviour(NodeEvent::RelayClient(event)) => {
event_string = "relay_client_event";

Expand Down
6 changes: 0 additions & 6 deletions sn_networking/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ impl Recorder<libp2p::kad::Event> for NetworkMetrics {
}
}

impl Recorder<libp2p::dcutr::Event> for NetworkMetrics {
fn record(&self, event: &libp2p::dcutr::Event) {
self.libp2p_metrics.record(event)
}
}

impl Recorder<libp2p::relay::Event> for NetworkMetrics {
fn record(&self, event: &libp2p::relay::Event) {
self.libp2p_metrics.record(event)
Expand Down

0 comments on commit a48b800

Please sign in to comment.