Skip to content
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

revisit the PeerConnectedness event #1692

Open
marten-seemann opened this issue May 27, 2022 · 2 comments
Open

revisit the PeerConnectedness event #1692

marten-seemann opened this issue May 27, 2022 · 2 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@marten-seemann
Copy link
Contributor

We're currently defining 4 different states for the Connectedness: https://pkg.go.dev/github.com/libp2p/[email protected]/network#Connectedness, of which we're only using NotConnected and Connected.

This is confusing to users of the library, we shouldn't define states that we're not actually using.

Furthermore, we should introduce a ConnectedViaTransientConnection state, and emit that instead of Connected when we establish a transient (i.e. a connection via a relay), and emit another Connected event once we transition from a transient to a direct connection.

This came up in #1562.

cc @MarcoPolo @Stebalien

@marten-seemann marten-seemann added the kind/enhancement A net-new feature or improvement to an existing feature label May 27, 2022
@Stebalien
Copy link
Member

Yup, agreed. Although it would be nice to actually implement CannotConnect.

@marten-seemann
Copy link
Contributor Author

Agreed. From the user's perspective it's better to not define that constant, than to define it and then not to emit it. Let's make it a TODO.

@marten-seemann marten-seemann transferred this issue from libp2p/go-libp2p-core Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants