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

swarm: fix recursive resolving of DNS multiaddrs #2564

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

marten-seemann
Copy link
Contributor

No description provided.

@marten-seemann marten-seemann linked an issue Sep 10, 2023 that may be closed by this pull request
@marten-seemann marten-seemann marked this pull request as draft September 11, 2023 13:40
@marten-seemann
Copy link
Contributor Author

The code works, but I should add a test case before we merge this.

Copy link
Member

@sukunrt sukunrt left a comment

Choose a reason for hiding this comment

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

This change looks fine to me. But should https://github.com/libp2p/go-libp2p/blob/master/p2p/transport/websocket/websocket.go#L139 ignore dnsaddr addresses since the actual host will be obtained after resolving the dnsaddr

@dennis-tra
Copy link
Contributor

dennis-tra commented Sep 12, 2023

Just smoked-tested it with boomo and can also confirm that it works:

boomo_up{otel_scope_name="github.com/plprobelab/boomo",otel_scope_version="",peer="QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",transport="ws"} 1
boomo_up{otel_scope_name="github.com/plprobelab/boomo",otel_scope_version="",peer="QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",transport="ws"} 0
boomo_up{otel_scope_name="github.com/plprobelab/boomo",otel_scope_version="",peer="QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",transport="ws"} 0
boomo_up{otel_scope_name="github.com/plprobelab/boomo",otel_scope_version="",peer="QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",transport="ws"} 1
boomo_up{otel_scope_name="github.com/plprobelab/boomo",otel_scope_version="",peer="QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",transport="ws"} 1

(see the 1 at the end of the prometheus metric - at least for 3/5 bootstrappers). I guess QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa isn't working because rust doesn't support ws? QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ is only configured with tcp.

@marten-seemann marten-seemann marked this pull request as ready for review October 25, 2023 08:44
@marten-seemann
Copy link
Contributor Author

I added a test case, and linked the original issue.

p2p/net/swarm/swarm_dial_test.go Outdated Show resolved Hide resolved
@marten-seemann marten-seemann merged commit 81d5c0c into master Oct 25, 2023
11 checks passed
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.

DNSAddr does not respect transport-specific DNS resolution
3 participants