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

Move secp256k1_recover to its own crate #1656

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

kevinheavey
Copy link

Problem

libsecp256k1 is a heavy dependency and the use case is niche

Summary of Changes

Moves secp256k1_recover out of solana-program and into its own crate

@kevinheavey
Copy link
Author

kevinheavey commented Jun 8, 2024

The circular dependency check is failing but the premise of the check is wrong. It's complaining about the recommended way to activate a feature in tests: https://stackoverflow.com/questions/68618789/is-it-possible-to-enable-a-rust-feature-only-in-test

Update: turns out I don't need that to make the tests pass so we can worry about it another time

@kevinheavey
Copy link
Author

Coverage failure means nothing to me: /solana/scripts/../ci/intercept.sh: command failed; please see /dev/null in artifacts

@@ -44,7 +44,6 @@ define_syscall!(fn sol_create_program_address(seeds_addr: *const u8, seeds_len:
define_syscall!(fn sol_try_find_program_address(seeds_addr: *const u8, seeds_len: u64, program_id_addr: *const u8, address_bytes_addr: *const u8, bump_seed_addr: *const u8) -> u64);
define_syscall!(fn sol_sha256(vals: *const u8, val_len: u64, hash_result: *mut u8) -> u64);
define_syscall!(fn sol_keccak256(vals: *const u8, val_len: u64, hash_result: *mut u8) -> u64);
define_syscall!(fn sol_secp256k1_recover(hash: *const u8, recovery_id: u64, signature: *const u8, result: *mut u8) -> u64);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I defined it manually in the secp256k1-recover crate to avoid depending on solana-program in that crate:

#[cfg(target_os = "solana")]
extern "C" {
    pub fn sol_secp256k1_recover(
        hash: *const u8,
        recovery_id: u64,
        signature: *const u8,
        result: *mut u8,
    ) -> u64;
}

@kevinheavey kevinheavey force-pushed the move-secp256k1 branch 4 times, most recently from 1f560f1 to 0d42f21 Compare June 20, 2024 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants