Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Treat transient connections as opt-in when opening new streams #236

Merged
merged 5 commits into from Feb 17, 2021

Conversation

vyzo
Copy link
Contributor

@vyzo vyzo commented Feb 3, 2021

This adds support for transient connections with opt-in semantics; when the best connection to a peer is transient, then only open a stream if the user is prepared to deal with it and has specified the relevant context option.

Rationale: many protocols may not be prepared to deal with transient connections; this makes it explicit opt-in to protect them and also eliminate interference with connection upgrade attempts.

depends on libp2p/go-libp2p-core#175

TODO

  • Release & update deps.

@aarshkshah1992
Copy link
Collaborator

@vyzo

We still need the code to mark limited Relay connections as Transient. How and where in the code do you plan to do that without leaking the idea of limited Relays to the Swarm ?

@vyzo
Copy link
Contributor Author

vyzo commented Feb 4, 2021

The relay dialer/listener constructs the Conn object, so it can mark itself when it knows it's transient.
No need to leak into the swarm code at all!

@vyzo
Copy link
Contributor Author

vyzo commented Feb 4, 2021

retract that, the swarm creates the stat object -- we need a mechanism to pass stuff from the transport all the way up to the swarm.

@vyzo
Copy link
Contributor Author

vyzo commented Feb 4, 2021

added threading of stat if available from the transport conn.

Copy link
Collaborator

@aarshkshah1992 aarshkshah1992 left a comment

Choose a reason for hiding this comment

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

Lgtm. Need to propagate & update deps before merge.

@aarshkshah1992
Copy link
Collaborator

@vyzo

Should I go ahead and merge this ?

@vyzo
Copy link
Contributor Author

vyzo commented Feb 17, 2021

waiting for travis, I will merge and cut release.

@vyzo vyzo merged commit 92b2212 into master Feb 17, 2021
@vyzo vyzo deleted the feat/transient-conns branch February 17, 2021 09:53
@Stebalien Stebalien mentioned this pull request May 11, 2021
27 tasks
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants