-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Bump ed25519-dalek to 2.0.0 #32836
Bump ed25519-dalek to 2.0.0 #32836
Conversation
Cargo.toml
Outdated
@@ -180,7 +180,7 @@ dir-diff = "0.3.2" | |||
dirs-next = "2.0.0" | |||
dlopen2 = "0.5.0" | |||
eager = "0.1.0" | |||
ed25519-dalek = "=1.0.1" | |||
ed25519-dalek = "2" |
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.
These versions should likely be updated to include minor and update too.
let signing_key = ed25519_dalek::SigningKey::from(extended.secret_key.to_bytes()); | ||
Ok(Keypair(signing_key)) |
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.
Is this a correct conversion?
@@ -22,15 +22,15 @@ use { | |||
/// A vanilla Ed25519 key pair | |||
#[wasm_bindgen] | |||
#[derive(Debug)] | |||
pub struct Keypair(ed25519_dalek::Keypair); | |||
pub struct Keypair(ed25519_dalek::SigningKey); |
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.
these aren't the same size. seems like as good a time as any to abandon Keypair
's crappy interface
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.
these aren't the same size.
Ah, good point. Will the different size be an issue? IOW, is that an API-breaking change for the SDK?
Edit: Looking at the code again, it appears to me that the old ed25519_dalek::Keypair
1 and the new ed25519_dalek::SigningKey
2 are the same size.
seems like as good a time as any to abandon
Keypair
's crappy interface
Gotcha. This code and ideal usage is new for me; what would be the right interface for us here?
Footnotes
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.
fyi, i'm working in an alternative direction. sneak peek
diff --git a/sdk/src/signer/keypair.rs b/sdk/src/signer/keypair.rs
index c1e0803a6b..f247df3329 100644
--- a/sdk/src/signer/keypair.rs
+++ b/sdk/src/signer/keypair.rs
@@ -1,4 +1,5 @@
#![cfg(feature = "full")]
+#![deprecated(since = "1.17.0", note = "it's time")]
use {
crate::{
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.
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.
i have a side pr that restricts the Keypair
APIs similarly to dalek 2.0. i think these will be sufficient for 1.16.
i'm planning to totally deprecate the Keypair
type from 1.17 forward and shift all interfaces to generics on our Signer
trait. there are a few potential complications here due to existing overly constrained APIs, but i don't believe they're widely used
@@ -180,7 +180,7 @@ dir-diff = "0.3.2" | |||
dirs-next = "2.0.0" | |||
dlopen2 = "0.5.0" | |||
eager = "0.1.0" | |||
ed25519-dalek = "=1.0.1" | |||
ed25519-dalek = "2.0.0" | |||
ed25519-dalek-bip32 = "0.2.0" |
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.
ed25519-dalek-bip32 = "0.2.0" | |
ed25519-dalek-bip32 = "0.3.0" |
fyi ed25519-dalek-bip32
just bumped out 0.3.0 release aligned to new API as well 🥳
@@ -60,8 +59,8 @@ impl Keypair { | |||
} | |||
|
|||
/// Gets this `Keypair`'s SecretKey | |||
pub fn secret(&self) -> &ed25519_dalek::SecretKey { | |||
&self.0.secret | |||
pub fn secret(&self) -> ed25519_dalek::SecretKey { |
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.
I think this is a backward incompatible change, because ed25519_dalek::SecretKey
is changing its version from 1.0.1
to 2.x
.
Maybe it is OK here, but a similar change in PubKey
for the borsh
derivation from 0.9
to 0.10
created a lot of issues.
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.
Yep, it is an API-breaking change.
This PR is not likely going to be merged, it's me exploring all the mess that needs to happen to update the ed25519_dalek
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.
Let me know if you want to discuss the transition.
I was helping Leo with the borsh compatibility issue.
@@ -29,9 +29,9 @@ pub struct Ed25519SignatureOffsets { | |||
message_instruction_index: u16, // index of instruction data to get message data | |||
} | |||
|
|||
pub fn new_ed25519_instruction(keypair: &ed25519_dalek::Keypair, message: &[u8]) -> Instruction { | |||
pub fn new_ed25519_instruction(keypair: &ed25519_dalek::SigningKey, message: &[u8]) -> Instruction { |
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 might be a backward incompatible change as well.
Even if SigningKey
is the same as Keypair
, previous version was using ed25519_dalek
version 1.0.1
, and it would be considered compatible with the same time from 2.x
, if version dependencies are using the default SemVer constraints.
Whats the latest on this? Working on SIMD-0048 which is currently still affected by all the |
planning to replace the direct exposure of dependency implementation with traits and generics. deprioritized until 1.17 branch is cut because we need to break/deprecate some api. in the meantime it's not clear exactly what's in your way. can you make progress based on the information above? |
Ah gotcha. Yeah will have to see if we can work around it. I think the main culprit is just the |
we'll cut 1.17 once mb is safely on 1.16. that's a bit blocked atm due to a stubborn memory corruption issue that a handful of nodes have exhibited upon upgrading. once that's resolved, we'll resume the cluster upgrade and 1.17 can be cut approximately two epochs after 1.16 has supermajority adoption |
Heyo, just wanted to check in on this again @t-nelson . The |
Problem
Summary of Changes
Upgrade
ed25519-dalek
to 2.0.0.