-
Notifications
You must be signed in to change notification settings - Fork 1.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
use private network key instead of protector interface as a libp2p.Option #795
Comments
@raulk @Stebalien @Kubuxu @yusefnapora Furthermore, I noticed that go-libp2p-pnet contained a lot of code for serializing / deserializing a PSK from a file. This doesn't work any more as The transport constructor in go-libp2p-quic-transport now already takes a PSK, but doesn't use it yet (it returns an error, since private networks are not yet supported). How exactly we protect QUIC connections is independent of this refactoring, and I'll track this in a different issue. What do you think? Does that make sense? |
Per the discussion in ipfs/kubo#6914, let's leave the decoding logic in libp2p somewhere. We could leave it in go-libp2p-pnet or move it into go-libp2p itself. Really, it probably belongs in go-libp2p-pnet. Unfortunately, I think you're on the right track here and doing this the right way is going to be unavoidably very API breaking. We can't accept both a key and a pre-built protector. |
I restored the PSKv1 decoding logic in go-libp2p-pnet (see libp2p/go-libp2p-pnet#32). To be honest, I'm not sure if we gain a lot from this - it's still a breaking API change, since we remove the Therefore, by making this change, we now force people to change their code to use the newly exposed (and immediately deprecated) |
The issue isn't breaking things, the issue is that nobody wants to depend on go-ipfs itself to decode their existing private network keys. If we find that we need to keep it around, we can move it to go-libp2p or even go-libp2p-core (or we can just un-deprecate it). |
That makes sense. Why don’t me move it to -core and not deprecate it now? |
Mumble punting decisions down the road. You're right, we should just do that. |
@Stebalien Great. Just move decoding to go-libp2p-core and updated all the PRs. |
This looks all ready but I'd like to merge, release go-libp2p-core, and update everything all at once. Unfortunately, releasing go-libp2p-core is currently blocked on some peerstore questions that should be resolved imminently. |
This issue summarizes a Slack discussion with @raulk, @Stebalien and @yusefnapora.
The current design of the private network feature requires users to pass a
pnet.Protector
as alibp2p.Option
:go-libp2p-pnet is currently the only implementation of the protector. This implementation encrypts the underlying TCP connection using Salsa20.
The
pnet.Protector
interfaces looks like this:This interface assumes that every connection is running on top of a
net.Conn
, which is not the case with QUIC.By using the private key currently used to construct the
pnet.Protector
in thelibp2p.Option
, we can allow different transports to apply their own protection logic. This could be achieved by changing it ito:Tracking PRs
The text was updated successfully, but these errors were encountered: