-
Notifications
You must be signed in to change notification settings - Fork 446
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: mark connections with limits as transient #1890
Conversation
Some connections have resources limits imposed on them, such as circuit relay connections. When this is the case, the connection will have a `.limited` boolean property set to true. By default any attempt to run a protocol over a limited 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. Protocols can opt-in to being run over limited connections by specifying a flag during `libp2p.handle` (incoming) and `connection.openStream` (outgoing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think we should make mention of this configurability via runOnTransientConnection
in the protocol limits docs but that could be in a follow up PR.
Hmm, it needs to go in the docs somewhere but I'm not sure the limits doc is the right place - that's about how to configure your node to be DOS-resistant, this feels different. |
@maschad |
Hey @sudiptab2100 I'm not sure exactly you're referring to. If you'd like more info on setting up a Relay node you can take a look here For more background you may want to read this If you are still having issues feel free to open a discussion as this PR isn't the best place to discuss |
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 duringlibp2p.handle
(incoming) andconnection.openStream
/libp2p.dialProtocol
(outgoing).Closes #1611