-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
addrsmanager: extract out addressing logic from basichost #3075
base: master
Are you sure you want to change the base?
Conversation
d54166d
to
3dbd24d
Compare
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
closes: #3057 rest of the work is in: #3075 Co-authored-by: wlynxg <[email protected]>
closes: #3057 rest of the work is in: #3075 Co-authored-by: wlynxg <[email protected]>
e45fe9e
to
5fcce02
Compare
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.
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 ```
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
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.
A couple small things, but looks good
for _, addr := range resolved { | ||
dst = append(dst, a.observedAddrsManager.ObservedAddrsFor(addr)...) | ||
} | ||
return dst |
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.
Should we unique this? Do we expect duplicated from the unspecified and resolved addrs?
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.
It's done eventually in the main loop. Limited the observed addrs to 5 per listen address.
Can you expand a bit on what you mean here please? |
I'm not filtering the return value from observed addrs manager and nat manager for nils. |
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?