Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of libp2p dependency in sc-authority-discovery #5842

Open
wants to merge 116 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
51f9a34
Removed libp2p dependancy from sc_network_sync
ndkazu Jul 8, 2024
b4e3f5a
Preparing an alternative to libp2p dependant OutBoundFailure
ndkazu Jul 9, 2024
fa242e5
Merge branch 'master' into libp2p
ndkazu Jul 9, 2024
6a1fcf1
Agnostic sc-network-sync
ndkazu Jul 10, 2024
b20e332
Merge branch 'paritytech:master' into libp2p
ndkazu Jul 10, 2024
fdac723
Merge branch 'master' into libp2p
ndkazu Jul 15, 2024
b33728b
Update substrate/client/network/src/request_responses.rs
ndkazu Jul 16, 2024
d8fbc30
Remove crate libp2p from sc-authority-discovery
ndkazu Jul 16, 2024
86d50af
Merge branch 'libp2p' of github.com:ndkazu/polkadot-sdk into libp2p
ndkazu Jul 16, 2024
2f09ebd
Removed event
ndkazu Jul 17, 2024
d0e2084
Add a custom InboundFailure
ndkazu Jul 17, 2024
3f7e5ad
Removed the variant Network
ndkazu Jul 18, 2024
6dd1bd3
Changed the type of
ndkazu Jul 20, 2024
97a5453
Merge branch 'master' into libp2p
ndkazu Jul 20, 2024
12db7fa
Merge branch 'master' into libp2p
ndkazu Jul 22, 2024
02f0085
Merge branch 'paritytech:master' into libp2p
ndkazu Jul 24, 2024
372f9fc
Replaced Network2 by Network, and added comments to enums
ndkazu Jul 24, 2024
28830fe
Replaced Network2 by Network
ndkazu Jul 24, 2024
f02b17c
Removed Event0, Need to remove ToSwarm dependance to libp2p
ndkazu Jul 26, 2024
ccbc94a
Merge branch 'paritytech:master' into libp2p
ndkazu Aug 3, 2024
7229689
Merge branch 'master' into libp2p
ndkazu Sep 2, 2024
8609e59
Merge branch 'paritytech:master' into libp2p
ndkazu Sep 3, 2024
54c54c5
Ready for review
ndkazu Sep 3, 2024
ae006e1
First corrections
ndkazu Sep 5, 2024
a52c9d4
Second round of corrections
ndkazu Sep 5, 2024
73860e6
cargo +nightly fmt
ndkazu Sep 5, 2024
7ed1124
Merge branch 'master' into libp2p
ndkazu Sep 6, 2024
db03bc5
Revert "cargo +nightly fmt"
ndkazu Sep 7, 2024
3dd3834
Merge branch 'master' into libp2p
ndkazu Sep 7, 2024
f194e5f
".git/.scripts/commands/fmt/fmt.sh"
Sep 9, 2024
6ac72b3
Removed all #[error(dial-failure)]
ndkazu Sep 9, 2024
104b1c4
Merge branch 'master' into libp2p
ndkazu Sep 9, 2024
e056e0e
Merge branch 'master' into libp2p
ndkazu Sep 11, 2024
53ea246
Replaced CustomOutboundFailure by OutboundFailure
ndkazu Sep 12, 2024
65c732e
Merge branch 'master' into libp2p
ndkazu Sep 12, 2024
da7adc3
first round of corrections
ndkazu Sep 13, 2024
7c916bc
Merge branch 'master' into libp2p
ndkazu Sep 13, 2024
aab8614
Reverted where it was necessary
ndkazu Sep 13, 2024
812734c
corrections
ndkazu Sep 13, 2024
35e884e
Merge branch 'master' into libp2p
ndkazu Sep 13, 2024
0062a74
Merge branch 'master' into libp2p
ndkazu Sep 13, 2024
dd08c06
Merge branch 'master' into libp2p
ndkazu Sep 13, 2024
cc0c400
Merge branch 'master' into libp2p
ndkazu Sep 14, 2024
67fe210
Created a prdoc
ndkazu Sep 16, 2024
c608293
Merge branch 'master' into libp2p
ndkazu Sep 16, 2024
a74ebd0
Merge branch 'master' into libp2p
ndkazu Sep 17, 2024
73d4005
implemented From<...> for OutbounFailure & InboundFailure
ndkazu Sep 17, 2024
2fcf160
Reverted changes unrelated to the purpose of the PR
ndkazu Sep 17, 2024
c2abf70
more revert
ndkazu Sep 17, 2024
9c8248b
Merge branch 'master' into libp2p
ndkazu Sep 17, 2024
34cdc57
".git/.scripts/commands/fmt/fmt.sh"
Sep 17, 2024
1ee40e1
Added newline at EOF
ndkazu Sep 17, 2024
a354c2e
Further corrections
ndkazu Sep 17, 2024
abc6f68
correcting format
ndkazu Sep 17, 2024
dfcc689
more format correction
ndkazu Sep 17, 2024
7bb250f
removed space
ndkazu Sep 17, 2024
ba729b5
".git/.scripts/commands/fmt/fmt.sh"
Sep 17, 2024
c969d26
Latest review corrections
ndkazu Sep 17, 2024
e226706
Manual Formatting
ndkazu Sep 17, 2024
f1e0164
Correct newline at EOF in prdoc
dmitry-markin Sep 18, 2024
27c8e13
Merge branch 'master' into libp2p
lexnv Sep 18, 2024
f578962
Merge branch 'paritytech:master' into libp2p
ndkazu Sep 18, 2024
6a3a045
Merge branch 'paritytech:master' into libp2p
ndkazu Sep 24, 2024
f44b2eb
Merge branch 'paritytech:master' into libp2p
ndkazu Sep 25, 2024
b0e1fd1
Starting
ndkazu Sep 25, 2024
f4c798f
Merge branch 'libp2p' of github.com:ndkazu/polkadot-sdk into libp2p
ndkazu Sep 25, 2024
141fbbc
Preparing new types
ndkazu Sep 26, 2024
887c877
Merge branch 'paritytech:master' into libp2p
ndkazu Sep 26, 2024
086c976
libp2p still used in tests
ndkazu Sep 26, 2024
73b46ed
Merge branch 'master' into libp2p
ndkazu Sep 26, 2024
5c02af7
some corrections
ndkazu Sep 27, 2024
b13248f
License
ndkazu Sep 27, 2024
0ec6f2d
Merge branch 'master' into libp2p
ndkazu Sep 27, 2024
a1ed269
Fix clippy
ndkazu Sep 27, 2024
c0baae5
PRdoc
ndkazu Sep 28, 2024
c944af9
PRdoc
ndkazu Sep 28, 2024
bc2e56e
PRdoc
ndkazu Sep 28, 2024
1efb0b2
Removed libp2p from sc-authority-discovery
ndkazu Sep 28, 2024
f9e5edb
Removed libp2p from sc-authority-discovery
ndkazu Sep 28, 2024
568c1e6
Removed libp2p from sc-authority-discovery
ndkazu Sep 28, 2024
48fe9b4
Merge branch 'master' into libp2p
ndkazu Sep 28, 2024
f48a4e2
Merge branch 'master' into libp2p
ndkazu Sep 29, 2024
03e10b5
Merge branch 'master' into libp2p
ndkazu Sep 30, 2024
e3cc477
Merge branch 'master' into libp2p
ndkazu Sep 30, 2024
6052d78
cargo clippy
ndkazu Sep 30, 2024
f3cf4df
Clippy
ndkazu Sep 30, 2024
ddde1b1
Removed all libp2p dependency from sc-authority-discovery
ndkazu Oct 1, 2024
5b2d95e
Merge branch 'master' into libp2p
ndkazu Oct 1, 2024
128ae48
clippy
ndkazu Oct 1, 2024
75cdda4
Fix tests in sc-network
ndkazu Oct 1, 2024
008674c
".git/.scripts/commands/fmt/fmt.sh"
Oct 1, 2024
5f72326
Fixed prdoc
ndkazu Oct 1, 2024
bce2179
Merge branch 'libp2p' of github.com:ndkazu/polkadot-sdk into libp2p
ndkazu Oct 1, 2024
6ef6230
Merge branch 'master' into libp2p
ndkazu Oct 1, 2024
c2f1686
Merge branch 'master' into libp2p
ndkazu Oct 2, 2024
25e12d1
Merge branch 'master' into libp2p
ndkazu Oct 3, 2024
a22a330
Merge branch 'master' into libp2p
ndkazu Oct 4, 2024
afa7659
Merge branch 'master' into libp2p
ndkazu Oct 5, 2024
61926d7
Merge branch 'master' into libp2p
ndkazu Oct 6, 2024
d764d23
Merge branch 'master' into libp2p
ndkazu Oct 7, 2024
c96ace5
Update substrate/client/network/types/src/rec.rs
ndkazu Oct 7, 2024
a3210f5
Applied review corrections
ndkazu Oct 7, 2024
8b13128
Merge branch 'master' into libp2p
ndkazu Oct 7, 2024
0d5912e
Merge branch 'master' into libp2p
ndkazu Oct 8, 2024
d210aa5
Merge branch 'master' into libp2p
ndkazu Oct 9, 2024
c16b692
Merge branch 'master' into libp2p
ndkazu Oct 10, 2024
d59014a
Merge branch 'master' into libp2p
ndkazu Oct 13, 2024
010bbb8
Merge branch 'master' into libp2p
ndkazu Oct 16, 2024
42f5080
Merge branch 'master' into libp2p
ndkazu Oct 18, 2024
d5adbd7
Merge branch 'master' into libp2p
ndkazu Oct 22, 2024
e18a331
Merge branch 'master' into libp2p
ndkazu Oct 25, 2024
fc34928
Merge branch 'master' into libp2p
ndkazu Oct 29, 2024
0df8b33
changed file name from rec.rs to kad.rs
ndkazu Nov 2, 2024
596fcf9
Removed unnecessary into() and libp2p
ndkazu Nov 2, 2024
3ab3460
Removed unneeded conversions
ndkazu Nov 4, 2024
e7e5ccd
Started work on litep2p/mod.rs
ndkazu Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.lock

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

18 changes: 18 additions & 0 deletions prdoc/pr_5842.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Get rid of libp2p dependency in sc-authority-discovery

doc:
- audience: Node Dev
description: |
Removes `libp2p` types in authority-discovery, and replace them with network backend agnostic types from `sc-network-types`.
The `sc-network` interface is therefore updated accordingly.

crates:
- name: sc-network
bump: patch
- name: sc-network-types
bump: patch
- name: sc-authority-discovery
bump: patch
1 change: 0 additions & 1 deletion substrate/client/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ codec = { workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
ip_network = { workspace = true }
libp2p = { features = ["ed25519", "kad"], workspace = true }
multihash = { workspace = true }
linked_hash_set = { workspace = true }
log = { workspace = true, default-features = true }
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/authority-discovery/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{
};

use futures::{channel::mpsc::channel, executor::LocalPool, task::LocalSpawn};
use libp2p::identity::ed25519;
use sc_network_types::ed25519;
use std::{collections::HashSet, sync::Arc};

use sc_network::{multiaddr::Protocol, Multiaddr, PeerId};
Expand Down
56 changes: 34 additions & 22 deletions substrate/client/authority-discovery/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ use futures::{channel::mpsc, future, stream::Fuse, FutureExt, Stream, StreamExt}
use addr_cache::AddrCache;
use codec::{Decode, Encode};
use ip_network::IpNetwork;
use libp2p::kad::{PeerRecord, Record};
use linked_hash_set::LinkedHashSet;
use sc_network_types::kad::{Key, PeerRecord, Record};

use log::{debug, error, trace};
use prometheus_endpoint::{register, Counter, CounterVec, Gauge, Opts, U64};
Expand Down Expand Up @@ -592,7 +592,7 @@ where
metrics.dht_event_received.with_label_values(&["value_not_found"]).inc();
}

if self.in_flight_lookups.remove(&hash).is_some() {
if self.in_flight_lookups.remove::<KademliaKey>(&hash.to_vec().into()).is_some() {
ndkazu marked this conversation as resolved.
Show resolved Hide resolved
debug!(target: LOG_TARGET, "Value for hash '{:?}' not found on Dht.", hash)
} else {
debug!(
Expand All @@ -602,7 +602,7 @@ where
}
},
DhtEvent::ValuePut(hash) => {
if !self.latest_published_kad_keys.contains(&hash) {
if !self.latest_published_kad_keys.contains::<KademliaKey>(&hash.to_vec().into()) {
return;
}

Expand All @@ -618,7 +618,7 @@ where
debug!(target: LOG_TARGET, "Successfully put hash '{:?}' on Dht.", hash)
},
DhtEvent::ValuePutFailed(hash) => {
if !self.latest_published_kad_keys.contains(&hash) {
if !self.latest_published_kad_keys.contains::<KademliaKey>(&hash.to_vec().into()) {
// Not a value we have published or received multiple times.
return;
}
Expand Down Expand Up @@ -646,7 +646,7 @@ where

async fn handle_put_record_requested(
&mut self,
record_key: KademliaKey,
record_key: Key,
record_value: Vec<u8>,
publisher: Option<PeerId>,
expires: Option<std::time::Instant>,
Expand All @@ -656,7 +656,7 @@ where
// Make sure we don't ever work with an outdated set of authorities
// and that we do not update known_authorithies too often.
let best_hash = self.client.best_hash().await?;
if !self.known_authorities.contains_key(&record_key) &&
if !self.known_authorities.contains_key::<KademliaKey>(&record_key.to_vec().into()) &&
self.authorities_queried_at
.map(|authorities_queried_at| authorities_queried_at != best_hash)
.unwrap_or(true)
Expand All @@ -677,8 +677,10 @@ where
self.authorities_queried_at = Some(best_hash);
}

let authority_id =
self.known_authorities.get(&record_key).ok_or(Error::UnknownAuthority)?;
let authority_id = self
.known_authorities
.get::<KademliaKey>(&record_key.to_vec().into())
.ok_or(Error::UnknownAuthority)?;
let signed_record =
Self::check_record_signed_with_authority_id(record_value.as_slice(), authority_id)?;
self.check_record_signed_with_network_key(
Expand All @@ -697,7 +699,8 @@ where
})
.unwrap_or_default(); // 0 is a sane default for records that do not have creation time present.

let current_record_info = self.last_known_records.get(&record_key);
let current_record_info =
self.last_known_records.get::<KademliaKey>(&record_key.to_vec().into());
// If record creation time is older than the current record creation time,
// we don't store it since we want to give higher priority to newer records.
if let Some(current_record_info) = current_record_info {
Expand All @@ -712,7 +715,12 @@ where
}
}

self.network.store_record(record_key, record_value, Some(publisher), expires);
self.network.store_record(
record_key.to_vec().into(),
record_value,
Some(publisher),
expires,
);
Ok(())
}

Expand Down Expand Up @@ -766,15 +774,19 @@ where
// Ensure `values` is not empty and all its keys equal.
let remote_key = peer_record.record.key.clone();

let authority_id: AuthorityId =
if let Some(authority_id) = self.in_flight_lookups.remove(&remote_key) {
self.known_lookups.insert(remote_key.clone(), authority_id.clone());
authority_id
} else if let Some(authority_id) = self.known_lookups.get(&remote_key) {
authority_id.clone()
} else {
return Err(Error::ReceivingUnexpectedRecord);
};
let authority_id: AuthorityId = if let Some(authority_id) =
self.in_flight_lookups.remove::<KademliaKey>(&remote_key.to_vec().into())
{
self.known_lookups
.insert(remote_key.clone().to_vec().into(), authority_id.clone());
authority_id
} else if let Some(authority_id) =
self.known_lookups.get::<KademliaKey>(&remote_key.to_vec().into())
{
authority_id.clone()
} else {
return Err(Error::ReceivingUnexpectedRecord);
};

let local_peer_id = self.network.local_peer_id();

Expand Down Expand Up @@ -835,7 +847,7 @@ where

let addr_cache_needs_update = self.handle_new_record(
&authority_id,
remote_key.clone(),
remote_key.clone().to_vec().into(),
RecordInfo {
creation_time: records_creation_time,
peers_with_record: answering_peer_id.into_iter().collect(),
Expand Down Expand Up @@ -870,7 +882,7 @@ where
if new_record.creation_time > current_record_info.creation_time {
let peers_that_need_updating = current_record_info.peers_with_record.clone();
self.network.put_record_to(
new_record.record.clone(),
new_record.record.clone().into(),
peers_that_need_updating.clone(),
// If this is empty it means we received the answer from our node local
// storage, so we need to update that as well.
Expand Down Expand Up @@ -907,7 +919,7 @@ where
authority_id, new_record.creation_time, current_record_info.creation_time,
);
self.network.put_record_to(
current_record_info.record.clone(),
current_record_info.record.clone().into(),
new_record.peers_with_record.clone(),
// If this is empty it means we received the answer from our node local
// storage, so we need to update that as well.
Expand Down
14 changes: 7 additions & 7 deletions substrate/client/authority-discovery/src/worker/schema/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ mod schema_v2 {

use super::*;
use codec::Encode;
use libp2p::identity::Keypair;
use prost::Message;
use sc_network::{Multiaddr, PeerId};
use sc_network_types::ed25519::Keypair;

#[test]
fn v2_decodes_v1() {
Expand Down Expand Up @@ -61,7 +61,7 @@ fn v2_decodes_v1() {

#[test]
fn v1_decodes_v2() {
let peer_secret = Keypair::generate_ed25519();
let peer_secret = Keypair::generate();
let peer_public = peer_secret.public();
let peer_id = peer_public.to_peer_id();
let multiaddress: Multiaddr =
Expand All @@ -73,7 +73,7 @@ fn v1_decodes_v2() {
let record_v2 = schema_v2::AuthorityRecord { addresses: vec_addresses.clone() };
let mut vec_record_v2 = vec![];
record_v2.encode(&mut vec_record_v2).unwrap();
let vec_peer_public = peer_public.encode_protobuf();
let vec_peer_public = peer_public.to_bytes().to_vec();
let peer_signature_v2 =
PeerSignature { public_key: vec_peer_public, signature: vec_peer_signature };
let signed_record_v2 = SignedAuthorityRecord {
Expand All @@ -97,7 +97,7 @@ fn v1_decodes_v2() {

#[test]
fn v1_decodes_v3() {
let peer_secret = Keypair::generate_ed25519();
let peer_secret = Keypair::generate();
let peer_public = peer_secret.public();
let peer_id = peer_public.to_peer_id();
let multiaddress: Multiaddr =
Expand All @@ -112,7 +112,7 @@ fn v1_decodes_v3() {
};
let mut vec_record_v3 = vec![];
record_v3.encode(&mut vec_record_v3).unwrap();
let vec_peer_public = peer_public.encode_protobuf();
let vec_peer_public = peer_public.to_bytes().to_vec();
let peer_signature_v3 =
PeerSignature { public_key: vec_peer_public, signature: vec_peer_signature };
let signed_record_v3 = SignedAuthorityRecord {
Expand All @@ -136,7 +136,7 @@ fn v1_decodes_v3() {

#[test]
fn v3_decodes_v2() {
let peer_secret = Keypair::generate_ed25519();
let peer_secret = Keypair::generate();
let peer_public = peer_secret.public();
let peer_id = peer_public.to_peer_id();
let multiaddress: Multiaddr =
Expand All @@ -148,7 +148,7 @@ fn v3_decodes_v2() {
let record_v2 = schema_v2::AuthorityRecord { addresses: vec_addresses.clone() };
let mut vec_record_v2 = vec![];
record_v2.encode(&mut vec_record_v2).unwrap();
let vec_peer_public = peer_public.encode_protobuf();
let vec_peer_public = peer_public.to_bytes().to_vec();
let peer_signature_v2 =
schema_v2::PeerSignature { public_key: vec_peer_public, signature: vec_peer_signature };
let signed_record_v2 = schema_v2::SignedAuthorityRecord {
Expand Down
14 changes: 8 additions & 6 deletions substrate/client/authority-discovery/src/worker/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ use futures::{
sink::SinkExt,
task::LocalSpawn,
};
use libp2p::{identity::SigningError, kad::record::Key as KademliaKey};
use prometheus_endpoint::prometheus::default_registry;

use sc_client_api::HeaderBackend;
use sc_network::{service::signature::Keypair, Signature};
use sc_network::{
service::signature::{Keypair, SigningError},
PublicKey, Signature,
};
use sc_network_types::{
multiaddr::{Multiaddr, Protocol},
kad::Key as KademliaKey,
PeerId,
};
use sp_api::{ApiRef, ProvideRuntimeApi};
Expand Down Expand Up @@ -167,7 +169,7 @@ impl NetworkSigner for TestNetwork {
fn sign_with_local_identity(
&self,
msg: Vec<u8>,
) -> std::result::Result<Signature, SigningError> {
) -> std::result::Result<Signature, sc_network::service::signature::SigningError> {
Signature::sign_message(msg, &self.identity)
}

Expand All @@ -178,8 +180,8 @@ impl NetworkSigner for TestNetwork {
signature: &Vec<u8>,
message: &Vec<u8>,
) -> std::result::Result<bool, String> {
let public_key = libp2p::identity::PublicKey::try_decode_protobuf(&public_key)
.map_err(|error| error.to_string())?;
let public_key =
PublicKey::try_decode_protobuf(&public_key).map_err(|error| error.to_string())?;
let peer_id: PeerId = peer_id.into();
let remote: PeerId = public_key.to_peer_id().into();

Expand Down
15 changes: 10 additions & 5 deletions substrate/client/network/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,23 @@ impl From<DiscoveryOut> for BehaviourOut {
},
DiscoveryOut::Discovered(peer_id) => BehaviourOut::Discovered(peer_id),
DiscoveryOut::ValueFound(results, duration) =>
BehaviourOut::Dht(DhtEvent::ValueFound(results), Some(duration)),
BehaviourOut::Dht(DhtEvent::ValueFound(results.into()), Some(duration)),
DiscoveryOut::ValueNotFound(key, duration) =>
BehaviourOut::Dht(DhtEvent::ValueNotFound(key), Some(duration)),
BehaviourOut::Dht(DhtEvent::ValueNotFound(key.to_vec().into()), Some(duration)),
DiscoveryOut::ValuePut(key, duration) =>
BehaviourOut::Dht(DhtEvent::ValuePut(key), Some(duration)),
BehaviourOut::Dht(DhtEvent::ValuePut(key.to_vec().into()), Some(duration)),
DiscoveryOut::PutRecordRequest(record_key, record_value, publisher, expires) =>
BehaviourOut::Dht(
DhtEvent::PutRecordRequest(record_key, record_value, publisher, expires),
DhtEvent::PutRecordRequest(
record_key.to_vec().into(),
record_value,
publisher,
expires,
),
None,
),
DiscoveryOut::ValuePutFailed(key, duration) =>
BehaviourOut::Dht(DhtEvent::ValuePutFailed(key), Some(duration)),
BehaviourOut::Dht(DhtEvent::ValuePutFailed(key.to_vec().into()), Some(duration)),
DiscoveryOut::RandomKademliaStarted => BehaviourOut::RandomKademliaStarted,
}
}
Expand Down
8 changes: 4 additions & 4 deletions substrate/client/network/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
use crate::types::ProtocolName;

use bytes::Bytes;
use libp2p::{
kad::{record::Key, PeerRecord},
PeerId,
};

use sc_network_common::role::ObservedRole;
use sc_network_types::{
kad::{Key, PeerRecord},
PeerId,
};

/// Events generated by DHT as a response to get_value and put_value requests.
#[derive(Debug, Clone)]
Expand Down
Loading
Loading