addrsmanager: extract out addressing logic from basichost#3075
Merged
addrsmanager: extract out addressing logic from basichost#3075
Conversation
d54166d to
3dbd24d
Compare
4 tasks
5896f14 to
a9e6585
Compare
2b114a2 to
762a43e
Compare
The goal is to keep modifying it and removing the dependency on basichost by relying on events. At that point, we can expose this as a separate service usable by both basic and blank hosts
a9e6585 to
e3367f1
Compare
d77303e to
e45fe9e
Compare
This was referenced Dec 8, 2024
e45fe9e to
5fcce02
Compare
sukunrt
added a commit
that referenced
this pull request
Dec 30, 2024
Ideally, we should rewrite this to have the same semantics, opt into transports not opt out, as `libp2p.New`. But I need webtransport and webrtc support to write address inference tests for #3075 Depending on how disruptive this is to users, we can decide on whether to merge or drop this.
sukunrt
added a commit
that referenced
this pull request
Dec 30, 2024
This adds support for `/webtransport` andn `/webrtc-direct` to GenSwarm. Ideally, we should rewrite this to have the same semantics, opt into transports not opt out, as `libp2p.New`. But I need webtransport and webrtc support to write address inference tests for #3075 Depending on how disruptive this is to users, we can decide on whether to merge or drop this.
58eceee to
d27d90e
Compare
This was pretty expensive before: ``` goos: linux goarch: amd64 pkg: github.com/libp2p/go-libp2p cpu: AMD Ryzen 7 7840U w/ Radeon 780M Graphics BenchmarkAllAddrs-16 16737 122245 ns/op 21240 B/op 218 allocs/op ``` after: ``` goos: linux goarch: amd64 pkg: github.com/libp2p/go-libp2p cpu: AMD Ryzen 7 7840U w/ Radeon 780M Graphics BenchmarkAllAddrs-16 11103236 105.7 ns/op 192 B/op 1 allocs/op ```
sukunrt
added a commit
that referenced
this pull request
Feb 19, 2025
This adds support for `/webtransport` andn `/webrtc-direct` to GenSwarm. Ideally, we should rewrite this to have the same semantics, opt into transports not opt out, as `libp2p.New`. But I need webtransport and webrtc support to write address inference tests for #3075 Depending on how disruptive this is to users, we can decide on whether to merge or drop this.
f5e3777 to
a5c5d2a
Compare
c5d38c1 to
16a95f3
Compare
6af4cd8 to
88725a1
Compare
88725a1 to
9905a33
Compare
d06ff0c to
f232cfe
Compare
MarcoPolo
reviewed
Feb 25, 2025
MarcoPolo
approved these changes
Feb 25, 2025
Collaborator
MarcoPolo
left a comment
There was a problem hiding this comment.
A couple small things, but looks good
| for _, addr := range resolved { | ||
| dst = append(dst, a.observedAddrsManager.ObservedAddrsFor(addr)...) | ||
| } | ||
| return dst |
Collaborator
There was a problem hiding this comment.
Should we unique this? Do we expect duplicated from the unspecified and resolved addrs?
Member
Author
There was a problem hiding this comment.
It's done eventually in the main loop. Limited the observed addrs to 5 per listen address.
Collaborator
Can you expand a bit on what you mean here please? |
Member
Author
I'm not filtering the return value from observed addrs manager and nat manager for nils. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal is to keep modifying it and removing the dependency on basichost by relying on events. At that point, we can expose this as a separate service usable by both basic and blank hosts
Part of #2229
NOTE: There's no fuzzing here. I am thinking of fuzzing the external facing components like observed address manager etc, as opposed to fuzzing something here. @MarcoPolo Do you think we should be defensive and parse return values form each of those components here and filter for nil etc?