-
Notifications
You must be signed in to change notification settings - Fork 165
Conversation
the value can be still used for debugging/logging when developing but the match isn't worth to keep up.
mainly leaving the multiple connections case to panic.
the original random listening address is still in place.
I've managed to install a compatible compilation environment for the root crate in Windows by:
At least We should have a guide for "hacking on windows". |
This comment has been minimized.
This comment has been minimized.
background here is the almost always happening failures on ci-windows, which don't seem to be locally reproducable.
This comment has been minimized.
This comment has been minimized.
perhaps roundtrip_times is more readable.
peer will be removed from connected_peers through the networkbehaviour callbacks.
the initial implementation didn't actually wait for anything other than asking the swarm to start listening, but now the await will complete only after a listening address has actually been bound. this required some nasty matching on the multiaddr protocol parts which will hopefully ever be used by test code but ... it works now, at least a bit better.
Marked my few comments outdated as I just couldn't see the reason for the windows CI failures which went away by modifying the assert message and came back in the 0.19 update. The underlying issue was that the adding of listening addresses is not immediate and I tried to cheat on the first pass of |
this needed to be implemented in a `&mut self` method not to get a double borrow issue with direct `self: Pin<&mut Self>` usage and is prettier than getting the splittable `&mut self` in the giant match.
let target = libp2p::build_multiaddr!(Ip4([127, 0, 0, 1]), Tcp(0u16)); | ||
|
||
let first = node.add_listening_address(target.clone()); | ||
let second = node.add_listening_address(target.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra clone
The macos tests are hanging now twice in row; need to wait a timeout. If this is ok, I'll remove the additional clone and merge unless the macos hang can be avoided. It should timeout in ~45min and give access to the output. |
match self.connected_peers.get_mut(&peer_id) { | ||
None => { | ||
debug!(" requeueing send event to {}", peer_id.to_base58()); | ||
debug!(" requeueing send event to {}", peer_id); | ||
// FIXME: I wonder if this should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this FIXME
a bit more descriptive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is quickly spiralling out of control as I couldn't remember once again how much there is to do with the listening addresses :) If there are any more functionality which should be added regarding the "added for testing" feature let's handle those on separate issues and PRs. |
At least the macos issue cleared up, waiting for windows and ignoring the doctest failure as transient. |
Fixes #168. Mostly just the api (rename) changes, however in
src/p2p/swarm.rs
the multiple connections per peerid were a bit more tricky. I initially implemented by panicing on another connection, then added a test case, then wrangled the bookkeeping to work. The test case required the listening address modifying API which is something we've needed either way.This was originally upgrading to 0.18.0|1 but 0.19 was released in the meantime so I upgraded directly to that while searching for a solution "why doesn't connection closing to banned peer invoke networkbehaviour methods". It didn't have them but I should file a bug as soon as I can confirm it.
No failures on conformance.
TODO: