Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Update libp2p to v0.43.0 #499

Merged
merged 27 commits into from
Apr 1, 2022
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f601b8d
fix: update libp2p and renamed the changed types
rand0m-cloud Mar 18, 2022
c3a48c9
fix: updated libp2p in the bitswap crate
rand0m-cloud Mar 18, 2022
4e5ff4d
more libp2p updating
rand0m-cloud Mar 18, 2022
918d4d8
more updating of types
rand0m-cloud Mar 18, 2022
c1a5bba
some updates to pubsub
rand0m-cloud Mar 18, 2022
7e9da72
fix the pubsub network behaviour action type
rand0m-cloud Mar 18, 2022
085be77
replaced todo placeholders
rand0m-cloud Mar 18, 2022
e4002d6
re-add connection closed and established
rand0m-cloud Mar 18, 2022
a996922
added change to changelog
rand0m-cloud Mar 18, 2022
bdf977c
enable event_process for BehaviourEvent
rand0m-cloud Mar 18, 2022
93b31b3
chore: clean up type signature
rand0m-cloud Mar 18, 2022
25c8d58
fix: removed unneeded BehaviourEvent struct
rand0m-cloud Mar 18, 2022
3b59193
temp fix: changed field order to workaround bug in libp2p
rand0m-cloud Mar 18, 2022
31262b5
chore: more updating to libp2p
rand0m-cloud Mar 18, 2022
6c6fc3d
fix: update libp2p and renamed the changed types
rand0m-cloud Mar 18, 2022
77291ee
fix(swarm-test): add biased to tokio::select for non-random behavior
rand0m-cloud Mar 18, 2022
888e6f1
wip: re-add code fragment to handle dial failure
rand0m-cloud Mar 18, 2022
72ff95d
fix(swarm): corrected dial failure logic
rand0m-cloud Mar 21, 2022
1cee67d
fix: corrected faulty Vec::retain logic and updated WrongPeerId test
rand0m-cloud Mar 21, 2022
897c16f
fix: apply review suggestions and fix clippy lints
rand0m-cloud Mar 24, 2022
d4d3def
fix(pubsub): tell Floodsub about the peers we want to hear from
rand0m-cloud Mar 25, 2022
87a4114
ci(win): use windows-2019 image
koivunej Mar 30, 2022
82453e5
fix(build): stop building while writing an error
koivunej Mar 30, 2022
277954b
test(pubsub): disjoint topics as new test case
koivunej Apr 1, 2022
50ad10f
test(pubsub): simplify, comment
koivunej Apr 1, 2022
081a598
test(conf): ignore pubsub tests on windows for now
koivunej Apr 1, 2022
bf7a807
doc(p2p): add fixme for possible issue
koivunej Apr 1, 2022
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
Prev Previous commit
Next Next commit
fix: apply review suggestions and fix clippy lints
  • Loading branch information
rand0m-cloud authored and koivunej committed Apr 1, 2022
commit 897c16fe2214271d06d36622d7afde14466423c1
34 changes: 18 additions & 16 deletions src/p2p/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ impl NetworkBehaviour for SwarmApi {
_handler: Self::ConnectionHandler,
error: &DialError,
) {
// TODO: there might be additional connections we should attempt
// (i.e) a new MultiAddr was found after sending the existing ones
// off to dial
if let Some(peer_id) = peer_id {
match self.pending_connections.entry(peer_id) {
Entry::Occupied(mut oe) => {
Expand All @@ -342,23 +345,17 @@ impl NetworkBehaviour for SwarmApi {
for (addr, error) in multiaddrs {
let addr = MultiaddrWithPeerId::try_from(addr.clone())
.expect("to recieve an MultiAddrWithPeerId from DialError");
self.connect_registry
.finish_subscription(addr.into(), Err(error.to_string()));
}

let peer_ids = multiaddrs
.into_iter()
.map(|(addr, _err)| {
MultiaddrWithPeerId::try_from(addr.clone()).unwrap()
})
.collect::<Vec<_>>();
self.connect_registry.finish_subscription(
addr.clone().into(),
Err(error.to_string()),
);

addresses.retain(|peer_id| !peer_ids.iter().any(|id| peer_id == id));
if let Some(pos) = addresses.iter().position(|a| *a == addr) {
addresses.swap_remove(pos);
}
}
}
DialError::WrongPeerId {
obtained: _,
endpoint: _,
} => {
DialError::WrongPeerId { .. } => {
for addr in addresses.iter() {
self.connect_registry.finish_subscription(
addr.clone().into(),
Expand All @@ -368,7 +365,12 @@ impl NetworkBehaviour for SwarmApi {

addresses.clear();
}
err => trace!("unhandled DialError {}", err),
error => {
warn!(
?error,
"unexpected DialError; some futures might never complete"
);
}
}

if addresses.is_empty() {
Copy link
Collaborator

@koivunej koivunej Mar 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should test this as well, wondering about the lack of new dial attempt.

Expand Down