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

Swarm cleanup following libp2p upgrade to v0.39.1 #473

Merged
merged 3 commits into from
Aug 23, 2021

Conversation

CHr15F0x
Copy link
Contributor

@CHr15F0x CHr15F0x commented Aug 23, 2021

This is a follow up of #472. There are two changes introduced:

  • remove eq_greedy as Multiaddr in SwarmApi::pending_{addresses, connections} contains p2p, align conversions accordingly (136496f),
  • explicitly use MultiaddrWithPeerId in SwarmApi::pending_{addresses, connections} (3b6f695).

The former (136496f) works fine without the latter (3b6f695), however I am leaning more towards keeping both changes. Encoding the information about peer id presence/absence in Multiaddr in type instead of relying on comments and expect()s improves readability and developer experience.

Please let me know what your thoughts are.

…erId

Enforce internal represenatation for `SwarmApi::pending_{addresses, connections}` to explicitly show that all multiaddrs include peer IDs by using `MultiaddrWithPeerId`.
Copy link
Collaborator

@koivunej koivunej left a comment

Choose a reason for hiding this comment

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

Looking good! I think there's further simplification possible by using direct dials with a .../p2p/PeerId multiaddr, but this is good enough for now.

Windows test failure is again ... the transient one. Should really look into what is happening there.

bors r+

@mxinden
Copy link

mxinden commented Aug 23, 2021

I am leaning more towards keeping both changes. Encoding the information about peer id presence/absence in Multiaddr in type instead of relying on comments and expect()s improves readability and developer experience.

👍

I think it is even worth exploring including the change above (and thus enforcing more than just multiaddr syntax at the type level) in https://github.com/multiformats/rust-multiaddr directly.

@bors
Copy link
Contributor

bors bot commented Aug 23, 2021

Build succeeded:

@bors bors bot merged commit 111f116 into rs-ipfs:master Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants