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

feat(connections): clarify state management around supported protocols #530

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions connections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and spec status.
- [State Management](#state-management)
- [Peer Metadata Storage](#peer-metadata-storage)
- [Connection Limits](#connection-limits)
- [Supported protocols](#supported-protocols)
- [Connection Lifecycle Events](#connection-lifecycle-events)
- [Hole punching](#hole-punching)
- [Future Work](#future-work)
Expand Down Expand Up @@ -325,6 +326,17 @@ Resource allocation, measurement and enforcement policies are all an active area
of discussion in the libp2p community, and implementations are free to develop
whatever prioritization system makes sense.

#### Supported protocols

A libp2p node SHOULD scope its set of supported protocols to the underlying
physical connection to a peer. It MAY only support a protocol based on properties
of a physical connection to e.g. limit the use of bandwidth-heavy protocols over
a relayed or metered connection. A libp2p node MAY offer different sets of protocols
to different peers. It MAY revoke or add the support for a protocol at any time,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe say that when that happens, it should warn us with an identify push?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure. This section of the specs is pretty ambivalent about protocols. Do we really want to introduce this here?

I like the idea but I think it would be better added to the identify spec rather than here.

for example to only offer certain services after learning its NAT status on a connection.
Therefore, libp2p nodes SHOULD NOT assume that the set of protocols on a connection
is static.

### Connection Lifecycle Events

The establishment of new connections and streams is likely to be a
Expand Down