-
Notifications
You must be signed in to change notification settings - Fork 950
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
core/: Introduce rsa
feature flag to avoid ring
dependency
#2860
Conversation
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.
Generally, I am happy to land this change. Please see inline comments :)
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.
Thank you for doing all the version updates and changelog entries!
One more question and I'd like to have @mxinden's review on this as well before we merge it.
One more note on this, I am pretty sure |
|
rsa
feature flag to avoid ring
dependency
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.
Thanks!
One more note regarding using the new dep
syntax.
@@ -120,6 +120,7 @@ impl Protocol<X25519> for X25519 { | |||
Ok(PublicKey(X25519(pk))) | |||
} | |||
|
|||
#[allow(irrefutable_let_patterns)] |
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.
This is unfortunate :/
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.
Yes, but I don't know how to change this without a massive rewrite :(
Thanks for adopting the suggestions so quickly. Just waiting for @mxinden now :) |
rsa
feature flag to avoid ring
dependencyrsa
feature flag to avoid ring
dependency
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.
Thanks for the patch and thanks for following this all the way through, updating the many versions 🙏.
This looks good to me apart from one thing.
The libp2p-core
feature secp256k1
is passed through to libp2p
. In addition the secp256k1
is part of the libp2p
default
feature.
According to the libp2p specification:
Implementations MUST support Ed25519. Implementations SHOULD support RSA if they wish to interoperate with the mainline IPFS DHT and the default IPFS bootstrap nodes. Implementations MAY support Secp256k1 and ECDSA, but nodes using those keys may not be able to connect to all other nodes.
https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#key-types
I read this as rsa
taking a higher priority as secp256k1
. Thus I suggest passing the rsa
feature through libp2p
and adding rsa
to the default
feature on libp2p
. That would as well remove the breaking change, i.e. the removal of default support for decoding rsa
keys.
@GamePad64 @thomaseizinger does the above reasoning make sense?
Yes, this makes sense to me :) Added |
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.
@mxinden That sounds good to me.
It is a breaking change regardless though. A user depending on the crate with disabled default features will not get RSA support whereas previously, they did.
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.
Thanks for the follow-ups!
👍 I will point this out in the release notes on #2869. |
🎉 first pull request running the interop tests #2835 //CC @laurentsenta. |
…p#2860) - Introduce `rsa` feature flag to `libp2p-core`. - Expose `rsa` feature in `libp2p`. - Add `rsa` feature to `libp2p` `default`.
Description
I've tried to build libp2p for router, running mips cpu, but the build has failed because of ring dependency. Ring is used mainly for RSA in libp2p-code, so I've made rsa as an optional feature
Links to any relevant issues
#1396
#1975
Open Questions
Change checklist