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

chore: support ping with multiple multiaddresses and close stream #3154

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

richard-ramos
Copy link
Member

Description

We've noticed before in status-go that sometimes multiaddresses that use dns names fail due to the ISP dns or the nameservers not being available. A change was done before in status-go to instead of having a single multiaddress per storenode, to have multiple multiaddresses: one with the dns and another one with the IP address.

As such, when go-waku does a ping, it does it by creating a PeerInfo (a go-libp2p structure) which contains these multiaddresses and then go-libp2p would use its own heurisitc to determine which multiaddress to use when pinging.

Looking at nim-libp2p, switch.dial supports multiple addresses too, so this PR modifies part of the nwaku code to make it possible to ping a peer with multiple multiaddresses

It also fixes a stream that was left open.

Copy link

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3154

Built from fae900a

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

Amazing! Thanks so much!

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for it! 💯
Aside note: interesting if we could avoid dialing and disconnecting on every ping. Sth to consider as potential optimization.

@richard-ramos richard-ramos merged commit 3665991 into master Oct 28, 2024
10 of 11 checks passed
@richard-ramos richard-ramos deleted the chore/ping branch October 28, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants