-
Notifications
You must be signed in to change notification settings - Fork 1.2k
swarm_test: support more transports for GenSwarm #3130
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
Conversation
cc8e5fa to
29f2fa4
Compare
MarcoPolo
left a comment
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.
one question, but otherwise looks good.
p2p/net/swarm/testing/testing.go
Outdated
| } | ||
| for _, a := range s.ListenAddresses() { | ||
| if _, err := a.ValueForProtocol(ma.P_QUIC_V1); err == nil { | ||
| quicListenAddr = a |
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 not obvious to me why you want to share this address with all the other transports. Can you explain? Also what happens if ListenAddresses contains a different address for WebTransport?
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.
You're right. We should replicate how the basic host works which just listens on port 0.
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.
The intention was to be maximially similar to how people use this in production. That can be handled separately.
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.
6e684b7 to
2c1efe2
Compare
guillaumemichel
left a comment
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.
Depending on how disruptive this is to users, we can decide on whether to merge or drop this.
I don't see how it could break existing users to support more transports in tests. Worst case failing tests may flag bugs in webrtc and webtransport.
This adds support for
/webtransportand/webrtc-directto 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 #3075Depending on how disruptive this is to users, we can decide on whether to merge or drop this.