-
Notifications
You must be signed in to change notification settings - Fork 75
Adding QualityTransport interfaces. #121
base: master
Are you sure you want to change the base?
Conversation
There is also more additional new interface.
0b18610
to
2d4fee4
Compare
52e1ead
to
b1a91b6
Compare
We don't want to dial the same peer again and again, allowing transport to not return an expected quality means we must try to dial each time.
Except if some errors sneeked in that should be the last version of Quality Transport interfaces.
d699cc6
to
f7acec3
Compare
/cc @raulk @Stebalien (sorry for ping, I have not the right to request review). |
@Jorropo thanks for the ping and the contribution. The core team is massively sprinting to meet deadlines for some critical workstreams. It will be a while until someone can properly review these contributions. We will eventually get to it, but right now we’re swamped and I just wanted to warn you. If you need to use the Quality Transport downstream immediately, I’d like to point you at go.mod replace directives as a mechanism to map an import to a repo of your choice. |
As a general contributing guideline: for large changes like this, please wait for the design discussions to complete before jumping into implementation work unless you're actually planning on maintaining a fork indefinitely. The core libp2p team is likely to give extensive feedback and final designs rarely resemble initial proposals. |
Content
Using type casting in go-libp2p and go-libp2p-swarm this change will be seem less to users and subsystems (except maybe for more stream reset due to OnBetter events).
I chose to not go with the event bus because that would require freeing some things myself while with a simple callback I can just let the garbage collector taking care of that.
I also first though of allowing transport to returns quality only when the conn is been made but I abandoned the idea because forcing to return a score allows to check if starting this dial is gonna be beneficial (when we already have a connection) and could other dial can be canceled (e.g. QUIC returning before TCP will cancel TCP's context).
See libp2p/go-libp2p-swarm#162.
Needed by libp2p/go-libp2p-swarm#167.
This doesn't include any change to Secure interface, I'll take care of them later.