Skip to content
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

SIMD-0075: Precompile for Secp256r1 #3152

Merged
merged 75 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
226eeef
feat: secp256r1 precompile
0xRigel Oct 13, 2024
4c753ff
add: num_signatures == 0 check from SIMD-0152
0xRigel Oct 13, 2024
b0ec063
rm: unnecessary comment
0xRigel Oct 13, 2024
6d9d46e
fix: legacy numeric constant
0xRigel Oct 13, 2024
943bd7c
Merge branch 'master' into secp256r1-precompile
0xRigel Oct 15, 2024
f74009a
CI/fix: compilation for wasm32 target
0xRigel Oct 15, 2024
46e15a1
Merge branch 'master' into secp256r1-precompile
0xRigel Oct 15, 2024
6011adf
Merge branch 'secp256r1-precompile' of https://github.com/iceomatic/a…
0xRigel Oct 15, 2024
bc83ba6
Merge branch 'master' into secp256r1-precompile
0xRigel Oct 16, 2024
86a25ea
Extract secp256r1 crate
0xRigel Oct 16, 2024
2598735
rm: unnecessary import
0xRigel Oct 16, 2024
eb3c492
update: sbf/Cargo.lock
0xRigel Oct 16, 2024
4d5b213
rm: unnecesary re-exports
0xRigel Oct 16, 2024
337433c
add: secp256r1 precompile to docs
0xRigel Oct 16, 2024
eeb5023
add: docs/description to sdk/program/src/lib.rs
0xRigel Oct 16, 2024
4b257a0
fix: alpha sort deps
0xRigel Oct 23, 2024
372be6c
fixes
0xRigel Oct 23, 2024
30dbde6
docs fixes
0xRigel Oct 23, 2024
2d64c1f
add: solana-instruction std feature to deps
0xRigel Oct 23, 2024
efe084b
Merge branch 'master' into secp256r1-precompile
0xRigel Oct 23, 2024
e266020
fix: lockfile from rebase
0xRigel Oct 23, 2024
4cd7bc0
fix: target architecture
0xRigel Oct 23, 2024
ce302a7
fix: workflow for client_target android
0xRigel Oct 23, 2024
897eace
add: sudo to workflow perl install
0xRigel Oct 24, 2024
c6c2249
fix: Cargo toml workspace member
0xRigel Oct 24, 2024
930db7c
Merge branch 'master' into secp256r1-precompile
0xRigel Oct 24, 2024
3df67bb
Merge branch 'secp256r1-precompile' of https://github.com/0xRigel/aga…
0xRigel Oct 24, 2024
3a73e79
modify: ranlib path in client-targets.yaml
0xRigel Oct 24, 2024
52fb88a
fix: secp256r1/Cargo.toml formatting
0xRigel Oct 24, 2024
632118c
add: openssl feature
0xRigel Oct 31, 2024
5437fc5
fixes
0xRigel Oct 31, 2024
fdf7673
add: precompile signature range error
0xRigel Nov 1, 2024
d3d24ea
more adjustments
0xRigel Nov 1, 2024
cbc7219
change: feature id
0xRigel Nov 2, 2024
3659bd0
Merge remote-tracking branch 'origin/master' into secp256r1-precompile
0xRigel Nov 6, 2024
0d2f171
fix: cargo format
0xRigel Nov 6, 2024
7e8a3ea
Revert "add: precompile signature range error"
0xRigel Nov 6, 2024
f27ce17
Merge branch 'anza-xyz:master' into secp256r1-precompile
0xRigel Nov 6, 2024
64291f6
Merge branch 'master' into secp256r1-precompile
0xRigel Nov 6, 2024
b44c02f
fix: cargo sanity
0xRigel Nov 6, 2024
8629123
Merge branch 'master' into secp256r1-precompile
0xRigel Nov 6, 2024
26649ff
fix: client target openssl dep
0xRigel Nov 6, 2024
e539f5c
fix: 31 byte r,s support in new_secp256r1_instruction
0xRigel Nov 6, 2024
fd7bbb6
update: Cargo.lock
0xRigel Nov 6, 2024
1522fcc
fix: unchecked math in new_secp256r1_instruction
0xRigel Nov 6, 2024
7f54c62
Merge branch 'master' into secp256r1-precompile
0xRigel Nov 6, 2024
a765f92
fixes & increased test coverage
0xRigel Nov 7, 2024
51ed60e
Merge branch 'master' into secp256r1-precompile
0xRigel Nov 7, 2024
f0cfecd
Merge branch 'master' into secp256r1-precompile
0xRigel Nov 7, 2024
6b92a71
Merge branch 'secp256r1-precompile' of https://github.com/0xRigel/aga…
0xRigel Nov 7, 2024
5c66b50
add: solana-sdk/openssl to all release binaries
0xRigel Nov 13, 2024
38dbbf5
update: comment to make openssl feature more clear
0xRigel Nov 13, 2024
7c2941d
add: solana-sdk/openssl feature to dependencies
0xRigel Nov 13, 2024
86710f8
add: solana-sdk/openssl feature to dependencies
0xRigel Nov 13, 2024
818af19
merge: master into secp256r1-precompile
0xRigel Nov 13, 2024
0d1815a
Merge branch 'master' into secp256r1-precompile
0xRigel Nov 13, 2024
99f22fa
fix: test-validator formatting
0xRigel Nov 13, 2024
81350f7
Revert "add: solana-sdk/openssl to all release binaries"
0xRigel Nov 14, 2024
5fc3feb
add: reserved key for secp256r1 program
0xRigel Nov 14, 2024
cc04f9f
modify: client-targets.yaml
0xRigel Nov 14, 2024
42f9402
modify: client/Cargo.toml solana-sdk dep
0xRigel Nov 14, 2024
d6120fd
modify: ledger-tool/Cargo.toml solana-sdk
0xRigel Nov 14, 2024
bd263bb
modify: test-validator/Cargo.toml solana-sdk dep
0xRigel Nov 14, 2024
a2a400d
modify: validator/Cargo.toml solana-sdk dep
0xRigel Nov 14, 2024
cbb6b61
change: openssl feature to openssl-vendored
0xRigel Nov 14, 2024
cc7af13
remove: solana-sdk dep from sdk/program
0xRigel Nov 14, 2024
ddb07fb
refactor: secp256r1 directory name
0xRigel Nov 14, 2024
bd138d2
fmt
0xRigel Nov 14, 2024
3174739
cargo.lock files
0xRigel Nov 14, 2024
e134144
revert: rustc-demangle bump
0xRigel Nov 15, 2024
df11363
Merge upstream master and resolve conflicts
0xRigel Nov 15, 2024
55cb982
cargo lock sanity
0xRigel Nov 15, 2024
517ae86
Merge remote-tracking branch 'upstream/master' into secp256r1-precompile
0xRigel Nov 15, 2024
63d86f0
fix: faulty feature-set merge
0xRigel Nov 15, 2024
265f392
fix: reserved keys pending feature id
0xRigel Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ full = [
"ed25519-dalek",
"ed25519-dalek-bip32",
"libsecp256k1",
"openssl",
"sha3",
"digest",
]
Expand All @@ -45,6 +46,7 @@ frozen-abi = [
"solana-short-vec/frozen-abi",
"solana-signature/frozen-abi"
]
openssl = ["dep:openssl"]

[dependencies]
bincode = { workspace = true }
Expand Down Expand Up @@ -72,6 +74,7 @@ memmap2 = { workspace = true, optional = true }
num-derive = { workspace = true }
num-traits = { workspace = true }
num_enum = { workspace = true }
openssl = { workspace = true, optional = true }
pbkdf2 = { workspace = true }
qualifier_attr = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
Expand Down
5 changes: 5 additions & 0 deletions sdk/feature-set/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,10 @@ pub mod reenable_sbpf_v1_execution {
solana_program::declare_id!("TestFeature21111111111111111111111111111111");
}

pub mod enable_secp256r1_precompile {
solana_program::declare_id!("GkVUbiefEqFzzLcArWgNG7r3BCs551UUjdH2hVE5ns3E");
}

lazy_static! {
/// Map of feature identifiers to user-visible description
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
Expand Down Expand Up @@ -1083,6 +1087,7 @@ lazy_static! {
(partitioned_epoch_rewards_superfeature::id(), "replaces enable_partitioned_epoch_reward to enable partitioned rewards at epoch boundary SIMD-0118"),
(disable_sbpf_v1_execution::id(), "Disables execution of SBPFv1 programs"),
(reenable_sbpf_v1_execution::id(), "Re-enables execution of SBPFv1 programs"),
(enable_secp256r1_precompile::id(), "Enable secp256r1 precompile SIMD-0075"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down
4 changes: 3 additions & 1 deletion sdk/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ pub mod program_error;
pub mod program_stubs;
pub mod program_utils;
pub mod secp256k1_program;
pub mod secp256r1_program;
pub mod slot_hashes;
pub mod slot_history;
pub mod stable_layout;
Expand Down Expand Up @@ -564,7 +565,7 @@ pub mod sdk_ids {
crate::{
address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable,
config, ed25519_program, feature, incinerator, loader_v4, secp256k1_program,
solana_program::pubkey::Pubkey, stake, system_program, sysvar, vote,
secp256r1_program, solana_program::pubkey::Pubkey, stake, system_program, sysvar, vote,
},
lazy_static::lazy_static,
};
Expand All @@ -574,6 +575,7 @@ pub mod sdk_ids {
let mut sdk_ids = vec![
ed25519_program::id(),
secp256k1_program::id(),
secp256r1_program::id(),
0xRigel marked this conversation as resolved.
Show resolved Hide resolved
system_program::id(),
sysvar::id(),
bpf_loader::id(),
Expand Down
5 changes: 5 additions & 0 deletions sdk/program/src/secp256r1_program.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! The [secp256r1 native program][np].
//!
//! [np]:

crate::declare_id!("Secp256r1SigVerify1111111111111111111111111");
5 changes: 3 additions & 2 deletions sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ pub use solana_program::{
epoch_rewards, epoch_schedule, fee_calculator, impl_sysvar_get, incinerator, instruction,
keccak, lamports, loader_instruction, loader_upgradeable_instruction, loader_v4,
loader_v4_instruction, message, msg, native_token, nonce, program, program_error,
program_option, program_pack, rent, secp256k1_program, serialize_utils, slot_hashes,
slot_history, stable_layout, stake, stake_history, syscalls, system_instruction,
program_option, program_pack, rent, secp256k1_program, secp256r1_program, serialize_utils,
slot_hashes, slot_history, stable_layout, stake, stake_history, syscalls, system_instruction,
system_program, sysvar, unchecked_div_by_const, vote,
};
#[cfg(feature = "borsh")]
Expand Down Expand Up @@ -95,6 +95,7 @@ pub mod reward_info;
pub mod reward_type;
pub mod rpc_port;
pub mod secp256k1_instruction;
pub mod secp256r1_instruction;
0xRigel marked this conversation as resolved.
Show resolved Hide resolved
pub mod shred_version;
pub mod signature;
pub mod signer;
Expand Down
5 changes: 5 additions & 0 deletions sdk/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ lazy_static! {
None, // always enabled
crate::ed25519_instruction::verify,
),
Precompile::new(
crate::secp256r1_program::id(),
Pubkey::try_from("GkVUbiefEqFzzLcArWgNG7r3BCs551UUjdH2hVE5ns3E").ok(),
0xRigel marked this conversation as resolved.
Show resolved Hide resolved
crate::secp256r1_instruction::verify,
)
];
}

Expand Down
Loading