-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support upgrades on libp2p_quic::GenTransport #5818
Comments
Actually, I'm unsure even |
How exactly do you use your custom keys in the network? Just to verify that the remote peer is a authenticated peer in the network (i.e. to check if a connection should be established or not), or as an identifier for peers in the network? |
The latter. Yes, in the sense PeerIds are bytes and you can put whatever you want there. Referring to the examples/common practice, if you use noise, the long-lived Ed25519 key used with noise becomes your PeerId. My key isn't Ed25519 so I cannot use it directly with noise. I need to define my own security upgrade, whereas noise returns the long-lived Ed25519 key as its PeerId, I return my key. https://github.com/serai-dex/serai/blob/next/coordinator/p2p/libp2p/src/authenticate.rs for my literal upgrade. I use this with allow-block-list, populated with PeerIds of this form. I'm sure I could alternatively use a construction on top of identify, or my own behavior, yet then I can't identify peers by their keys without defining, maintaining, and passing around an additional mapping for the translation. This was by far the most ergonomic solution. |
Description
Support
InboundConnectionUpgrade, OutboundConnectionUpgrade
, onlibp2p_quic::GenTransport
.Motivation
I have an
InboundConnectionUpgrade
andOutboundConnectionUpgrade
to replace the encryption layer'sPeerId
s with my own long-lived identity keys (unsupported by libp2p, hence the need for the custom middleware). While tcp lets me provide such upgrades, quic doesn't, with the quote:I spent a few hours seeing if I could manually wrap
GenTransport
, or compose withand_then
, to achieve the desired effects but I was unable as libp2p-quic yieldsConnection
, notStream
to these locations. I'd have to further wrapConnection
into my own which applies upgrades while manually callingpoll_inbound
/poll_outbound
. While I am debating doing that, having just spent a notable amount of time attempting to do this and wanting to be successful, I don't feel I should have to. I should be able to just provide arbitrary connection upgrades. QUIC may be great and not need upgrades, but that doesn't mean it should be limited as to not support upgrades.Requirements
Open questions
No response
Are you planning to do it yourself in a pull request?
No, as I don't believe I have the proper expertise
The text was updated successfully, but these errors were encountered: