Skip to content

Commit c16dcb3

Browse files
build(deps): bump solana-ed25519-program from 2.2.2 to 2.2.3 (solana-labs#6315)
* build(deps): bump solana-ed25519-program from 2.2.2 to 2.2.3 Bumps [solana-ed25519-program](https://github.com/anza-xyz/solana-sdk) from 2.2.2 to 2.2.3. - [Release notes](https://github.com/anza-xyz/solana-sdk/releases) - [Commits](https://github.com/anza-xyz/solana-sdk/compare/[email protected]@v2.2.3) --- updated-dependencies: - dependency-name: solana-ed25519-program dependency-version: 2.2.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update all Cargo files * new_ed25519_instruction -> new_ed25519_instruction_with_signature --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: yihau <[email protected]>
1 parent 7be24c2 commit c16dcb3

File tree

9 files changed

+41
-18
lines changed

9 files changed

+41
-18
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ solana-decode-error = "2.2.1"
426426
solana-define-syscall = "2.3.0"
427427
solana-derivation-path = "2.2.1"
428428
solana-download-utils = { path = "download-utils", version = "=2.3.0" }
429-
solana-ed25519-program = "2.2.2"
429+
solana-ed25519-program = "2.2.3"
430430
solana-entry = { path = "entry", version = "=2.3.0" }
431431
solana-program-entrypoint = "2.2.1"
432432
solana-epoch-info = "2.2.1"

precompiles/benches/ed25519_instructions.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ extern crate test;
44
use {
55
agave_feature_set::FeatureSet,
66
agave_precompiles::ed25519::verify,
7+
ed25519_dalek::ed25519::signature::Signer,
78
rand0_7::{thread_rng, Rng},
8-
solana_ed25519_program::new_ed25519_instruction,
9+
solana_ed25519_program::new_ed25519_instruction_with_signature,
910
solana_instruction::Instruction,
1011
test::Bencher,
1112
};
@@ -20,7 +21,9 @@ fn create_test_instructions(message_length: u16) -> Vec<Instruction> {
2021
let mut rng = thread_rng();
2122
let privkey = ed25519_dalek::Keypair::generate(&mut rng);
2223
let message: Vec<u8> = (0..message_length).map(|_| rng.gen_range(0, 255)).collect();
23-
new_ed25519_instruction(&privkey, &message)
24+
let signature = privkey.sign(&message).to_bytes();
25+
let pubkey = privkey.public.to_bytes();
26+
new_ed25519_instruction_with_signature(&message, &signature, &pubkey)
2427
})
2528
.collect()
2629
}

precompiles/src/ed25519.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub mod tests {
121121
hex,
122122
rand0_7::{thread_rng, Rng},
123123
solana_ed25519_program::{
124-
new_ed25519_instruction, offsets_to_ed25519_instruction, DATA_START,
124+
new_ed25519_instruction_with_signature, offsets_to_ed25519_instruction, DATA_START,
125125
},
126126
solana_instruction::Instruction,
127127
std::vec,
@@ -341,7 +341,10 @@ pub mod tests {
341341

342342
let privkey = ed25519_dalek::Keypair::generate(&mut thread_rng());
343343
let message_arr = b"hello";
344-
let mut instruction = new_ed25519_instruction(&privkey, message_arr);
344+
let signature = privkey.sign(message_arr).to_bytes();
345+
let pubkey = privkey.public.to_bytes();
346+
let mut instruction =
347+
new_ed25519_instruction_with_signature(message_arr, &signature, &pubkey);
345348
let feature_set = FeatureSet::all_enabled();
346349

347350
assert!(test_verify_with_alignment(
@@ -446,7 +449,9 @@ pub mod tests {
446449
// sig created via ed25519_dalek: both pass
447450
let privkey = ed25519_dalek::Keypair::generate(&mut thread_rng());
448451
let message_arr = b"hello";
449-
let instruction = new_ed25519_instruction(&privkey, message_arr);
452+
let signature = privkey.sign(message_arr).to_bytes();
453+
let pubkey = privkey.public.to_bytes();
454+
let instruction = new_ed25519_instruction_with_signature(message_arr, &signature, &pubkey);
450455

451456
let feature_set = FeatureSet::default();
452457
assert!(test_verify_with_alignment(

programs/ed25519-tests/tests/process_transaction.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use {
2-
assert_matches::assert_matches, solana_ed25519_program::new_ed25519_instruction,
2+
assert_matches::assert_matches, ed25519_dalek::ed25519::signature::Signer as EdSigner,
3+
solana_ed25519_program::new_ed25519_instruction_with_signature,
34
solana_instruction::error::InstructionError, solana_precompile_error::PrecompileError,
45
solana_program_test::*, solana_signer::Signer, solana_transaction::Transaction,
56
solana_transaction_error::TransactionError,
@@ -29,7 +30,9 @@ async fn test_success() {
2930

3031
let privkey = generate_keypair();
3132
let message_arr = b"hello";
32-
let instruction = new_ed25519_instruction(&privkey, message_arr);
33+
let signature = privkey.sign(message_arr).to_bytes();
34+
let pubkey = privkey.public.to_bytes();
35+
let instruction = new_ed25519_instruction_with_signature(message_arr, &signature, &pubkey);
3336

3437
let transaction = Transaction::new_signed_with_payer(
3538
&[instruction],
@@ -51,7 +54,9 @@ async fn test_failure() {
5154

5255
let privkey = generate_keypair();
5356
let message_arr = b"hello";
54-
let mut instruction = new_ed25519_instruction(&privkey, message_arr);
57+
let signature = privkey.sign(message_arr).to_bytes();
58+
let pubkey = privkey.public.to_bytes();
59+
let mut instruction = new_ed25519_instruction_with_signature(message_arr, &signature, &pubkey);
5560

5661
instruction.data[0] += 1;
5762

programs/sbf/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/src/bank/tests.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use {
2424
agave_transaction_view::static_account_keys_frame::MAX_STATIC_ACCOUNTS_PER_PACKET,
2525
assert_matches::assert_matches,
2626
crossbeam_channel::{bounded, unbounded},
27+
ed25519_dalek::ed25519::signature::Signer as EdSigner,
2728
itertools::Itertools,
2829
rand::Rng,
2930
rayon::{ThreadPool, ThreadPoolBuilder},
@@ -10342,7 +10343,13 @@ fn test_call_precomiled_program() {
1034210343
ed25519_dalek::Keypair { secret, public }
1034310344
};
1034410345
let message_arr = b"hello";
10345-
let instruction = solana_ed25519_program::new_ed25519_instruction(&privkey, message_arr);
10346+
let signature = privkey.sign(message_arr).to_bytes();
10347+
let pubkey = privkey.public.to_bytes();
10348+
let instruction = solana_ed25519_program::new_ed25519_instruction_with_signature(
10349+
message_arr,
10350+
&signature,
10351+
&pubkey,
10352+
);
1034610353
let tx = Transaction::new_signed_with_payer(
1034710354
&[instruction],
1034810355
Some(&mint_keypair.pubkey()),

svm/examples/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

svm/src/message_processor.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ mod tests {
101101
use {
102102
super::*,
103103
agave_reserved_account_keys::ReservedAccountKeys,
104+
ed25519_dalek::ed25519::signature::Signer,
104105
openssl::{
105106
ec::{EcGroup, EcKey},
106107
nid::Nid,
@@ -110,7 +111,7 @@ mod tests {
110111
Account, AccountSharedData, ReadableAccount, WritableAccount,
111112
DUMMY_INHERITABLE_ACCOUNT_FIELDS,
112113
},
113-
solana_ed25519_program::new_ed25519_instruction,
114+
solana_ed25519_program::new_ed25519_instruction_with_signature,
114115
solana_hash::Hash,
115116
solana_instruction::{error::InstructionError, AccountMeta, Instruction},
116117
solana_message::{AccountKeys, Message, SanitizedMessage},
@@ -603,7 +604,9 @@ mod tests {
603604

604605
fn ed25519_instruction_for_test() -> Instruction {
605606
let secret_key = ed25519_dalek::Keypair::generate(&mut thread_rng());
606-
new_ed25519_instruction(&secret_key, b"hello")
607+
let signature = secret_key.sign(b"hello").to_bytes();
608+
let pubkey = secret_key.public.to_bytes();
609+
new_ed25519_instruction_with_signature(b"hello", &signature, &pubkey)
607610
}
608611

609612
fn secp256r1_instruction_for_test() -> Instruction {

0 commit comments

Comments
 (0)