From 46032b24c7238ce5389c20bc0465f581248c095f Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Fri, 15 Nov 2024 23:16:57 +0400 Subject: [PATCH] fix secp256r1-program id location (#3663) fix secp256r1_program id location --- Cargo.lock | 3 +-- programs/sbf/Cargo.lock | 3 +-- sdk/reserved-account-keys/Cargo.toml | 1 - sdk/reserved-account-keys/src/lib.rs | 5 ++--- sdk/sdk-ids/src/lib.rs | 4 ++++ sdk/secp256r1-program/Cargo.toml | 2 +- sdk/secp256r1-program/src/lib.rs | 3 +-- svm/examples/Cargo.lock | 3 +-- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a1d5b6f2e253a..28e55d0e91a667 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8035,7 +8035,6 @@ dependencies = [ "solana-program", "solana-pubkey", "solana-sdk-ids", - "solana-secp256r1-program", ] [[package]] @@ -8458,8 +8457,8 @@ dependencies = [ "solana-instruction", "solana-logger", "solana-precompile-error", - "solana-pubkey", "solana-sdk", + "solana-sdk-ids", ] [[package]] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 732621b2d2071e..6a6436d26a1aa6 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -6357,7 +6357,6 @@ dependencies = [ "solana-feature-set", "solana-pubkey", "solana-sdk-ids", - "solana-secp256r1-program", ] [[package]] @@ -7183,7 +7182,7 @@ dependencies = [ "solana-feature-set", "solana-instruction", "solana-precompile-error", - "solana-pubkey", + "solana-sdk-ids", ] [[package]] diff --git a/sdk/reserved-account-keys/Cargo.toml b/sdk/reserved-account-keys/Cargo.toml index 86c63085c432f8..d42aaa74c2780b 100644 --- a/sdk/reserved-account-keys/Cargo.toml +++ b/sdk/reserved-account-keys/Cargo.toml @@ -20,7 +20,6 @@ solana-frozen-abi-macro = { workspace = true, optional = true, features = [ ] } solana-pubkey = { workspace = true, default-features = false } solana-sdk-ids = { workspace = true } -solana-secp256r1-program = { workspace = true } [dev-dependencies] solana-program = { path = "../program" } diff --git a/sdk/reserved-account-keys/src/lib.rs b/sdk/reserved-account-keys/src/lib.rs index 993c8f6e74390a..4a735f79e9d1a9 100644 --- a/sdk/reserved-account-keys/src/lib.rs +++ b/sdk/reserved-account-keys/src/lib.rs @@ -10,10 +10,9 @@ use { solana_sdk_ids::{ address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, compute_budget, config, ed25519_program, feature, loader_v4, native_loader, - secp256k1_program, stake, system_program, sysvar, vote, zk_elgamal_proof_program, - zk_token_proof_program, + secp256k1_program, secp256r1_program, stake, system_program, sysvar, vote, + zk_elgamal_proof_program, zk_token_proof_program, }, - solana_secp256r1_program as secp256r1_program, std::collections::{HashMap, HashSet}, }; diff --git a/sdk/sdk-ids/src/lib.rs b/sdk/sdk-ids/src/lib.rs index b63265b61af20c..28241d637b6dd0 100644 --- a/sdk/sdk-ids/src/lib.rs +++ b/sdk/sdk-ids/src/lib.rs @@ -44,6 +44,10 @@ pub mod secp256k1_program { solana_pubkey::declare_id!("KeccakSecp256k11111111111111111111111111111"); } +pub mod secp256r1_program { + solana_pubkey::declare_id!("Secp256r1SigVerify1111111111111111111111111"); +} + pub mod stake { pub mod config { solana_pubkey::declare_deprecated_id!("StakeConfig11111111111111111111111111111111"); diff --git a/sdk/secp256r1-program/Cargo.toml b/sdk/secp256r1-program/Cargo.toml index 941bda03285f6a..a59a4e37e7901b 100644 --- a/sdk/secp256r1-program/Cargo.toml +++ b/sdk/secp256r1-program/Cargo.toml @@ -13,7 +13,7 @@ edition = { workspace = true } bytemuck = { workspace = true, features = ["derive"] } solana-feature-set = { workspace = true } solana-precompile-error = { workspace = true } -solana-pubkey = { workspace = true } +solana-sdk-ids = { workspace = true } [target.'cfg(all(not(target_arch = "wasm32"), not(target_os = "solana")))'.dependencies] solana-instruction = { workspace = true, features = ["std"] } diff --git a/sdk/secp256r1-program/src/lib.rs b/sdk/secp256r1-program/src/lib.rs index 334cbb78c4515c..51e752c1fee531 100644 --- a/sdk/secp256r1-program/src/lib.rs +++ b/sdk/secp256r1-program/src/lib.rs @@ -9,9 +9,8 @@ //! This property can be problematic for developers who assume each signature is unique. Without enforcing //! low-S values, the same message and key can produce two different valid signatures, potentially breaking //! replay protection schemes that rely on signature uniqueness. -solana_pubkey::declare_id!("Secp256r1SigVerify1111111111111111111111111"); - use bytemuck::{Pod, Zeroable}; +pub use solana_sdk_ids::secp256r1_program::{check_id, id, ID}; #[derive(Default, Debug, Copy, Clone, Zeroable, Pod, Eq, PartialEq)] #[repr(C)] diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index f821a2ca9588a6..1d2078c1437945 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -6178,7 +6178,6 @@ dependencies = [ "solana-feature-set", "solana-pubkey", "solana-sdk-ids", - "solana-secp256r1-program", ] [[package]] @@ -6519,7 +6518,7 @@ dependencies = [ "solana-feature-set", "solana-instruction", "solana-precompile-error", - "solana-pubkey", + "solana-sdk-ids", ] [[package]]