-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
migrate bootstrapper away from RSA #9507
Comments
|
Great, thank you for confirming.
That's a good idea, but it won't help with this issue, right? It requires people to upgrade their nodes, so it doesn't reduce the load on the RSA bootstrappers being hit by legacy nodes. If I understand correctly, all that's would be needed is spinning up a few ed25519-powered bootstrap nodes, and a config migration. That sounds like go-libp2p could drop OpenSSL support in the next release, without causing too many problems? Given the recently discovered bugs (this and this one, specifically) in the implementation, we'd like to get rid of this code path asap. |
@marten-seemann : I'm catching up on the conversation here, in libp2p/go-libp2p#1952, and in FIL slack. A couple things:
If everything will still work, then this seems like an easy decision. IPFS/Kubo/Bifrost can handle migrating the bootstrappers away from RSA on a separate timetable. (I'm supportive of the migration from RSA, but it would be nice to have as little coupling as possible here.) |
Correct.
Agreed, looking at the new profiles, it seems like dropping OpenSSL won't necessitate migrating to new bootstrappers. Migrating away from RSA (at the very least, diversifying the bootstrapper setup) is probably still a good idea. |
Checklist
Description
After benchmarking libp2p handshakes, it turns out that verifying signatures is roughly equally fast for RSA and for Ed25519 keys. Where performance differs significantly is while signing. For CPU performance, it therefore doesn't really matter which key type your peer uses, it only matter which key type you use.
The conclusion can be summarized: If you care about your CPU load, you really don't want to use an RSA host key.
This is why generating Ed25519 on
ipfs init
makes sense, and adding a warning to nudge people to migrate away from RSA (#9506) does too.libp2p planning to drop OpenSSL support
OpenSSL can be used to speed up RSA operations. There's some numbers in libp2p/go-libp2p#1686 (comment), due to a bug (libp2p/go-libp2p#1951) only the number for signing are valid.
While OpenSSL helps bring down the cost of RSA signing from 1.2ms to 0.5ms, it is still vastly more expensive than Ed25519 signing, which sits at around 22µs.
libp2p is planning to drop OpenSSL support soon (libp2p/go-libp2p#1952), since it has been creating a disproportionate amount of maintenance burden with unclear benefit. As argued above, the only benefit is that it provides is slightly reducing the amount of self-inflicted pain from using RSA keys.
Bootstrappers
The only problem with this advice ("just don't use RSA keys) is that Kubo has hardcoded peer IDs of bootstrappers, and those still use RSA keys for historic reasons. As the IPFS network is notoriously slow to upgrade to new Kubo versions, at least some of these nodes will probably need to keep running for years. As libp2p is dropping OpenSSL support, this means that these bootstrappers would not be able to update to Kubo versions that use those newer go-libp2p versions.
This problem does not occur with Hydra nodes, as those don't use hard-coded peer IDs (as far as I can tell), which should make it trivial to switch them to Ed25519, in case they were deployed with RSA.
Assuming that handshakes are a significant component of the CPU load of bootstrappers , significant savings of CPU time can be expected from switching them to Ed25519.
I don't have access to them, but it should be easy to confirm or disprove by getting a pprof. I took some pprofs from a Kubo node that I set up which runs the Accelerated DHT client, and it looks like other code paths are still more expensive, but that might not translate well to what the bootstrappers are doing.
It might be interesting to convert these CPU savings into $$$ by scaling down the hardware these nodes run on.
I'm opening this issue to explore a transition path to use a new set of bootstrap nodes that posses Ed25519 keys. One option I can think of would be to locate them on a new subdomain. We need to pay attention to keeping the DNS message size small due to libp2p/go-libp2p#1837.
Arguably, IPFS bootstrappers should live on
bootstrap.ipfs.io
, notbootstrap.libp2p.io
. New versions of Kubo would then (exclusively?) ship the list of new bootstrap nodes, which would reduce the load on the old bootstrappers as nodes upgrade. This would allow us to gradually scale down the hardware they run on, and decommission them eventually, probably after a few years.The text was updated successfully, but these errors were encountered: