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

Add support for transient connections #1611

Closed
maschad opened this issue Mar 3, 2023 · 1 comment · Fixed by #1890
Closed

Add support for transient connections #1611

maschad opened this issue Mar 3, 2023 · 1 comment · Fixed by #1890
Labels
need/triage Needs initial labeling and prioritization

Comments

@maschad
Copy link
Member

maschad commented Mar 3, 2023

Similar to go-libp2p we can add a flag to the ConnectionStat interface as well as an option to opt-in for opening streams on connections that will indicate whether that connection is transient and thus may be closed soon.

@maschad maschad added the need/triage Needs initial labeling and prioritization label Mar 3, 2023
@maschad
Copy link
Member Author

maschad commented Mar 14, 2023

Closing based on conversation in triage

@maschad maschad closed this as completed Mar 14, 2023
@maschad maschad reopened this Jul 25, 2023
achingbrain added a commit that referenced this issue Jul 26, 2023
Some connections have resources limits imposed on them, such as circuit relay connections.  If these limits are breached the connection will be closed by the remote.

When this is the case, the connection will have a `.transient` boolean property set to true.

By default any attempt to run a protocol over a transient connection will throw (outgoing) or be reset (incoming), this is to prevent, for example, bitswap exceeding the connection transfer limit and causing the connection to be closed by the relay server when it should be reserved for the WebRTC SDP exchange to allow incoming dials.

Protocols can opt-in to being run over transient connections by specifying a `runOnTransientConnection` flag during `libp2p.handle` (incoming) and `connection.openStream`/`libp2p.dialProtocol` (outgoing).

Closes #1611
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant