Skip to content

Commit

Permalink
Extract secp256k1-program (#3331)
Browse files Browse the repository at this point in the history
* start extracting secp256k1-instruction

* fix imports and dependencies

* fix docs

* activate solana-secp256k1-instruction/bincode in solana-sdk

* import program id from solana_sdk_ids

* rename to solana-secp256k1-program like in #3632

* update lock file after rebase

* tighten deps

* minimise solana-sdk usage in docs and tests
  • Loading branch information
kevinheavey authored Nov 20, 2024
1 parent af0ed22 commit 92068d1
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 80 deletions.
31 changes: 31 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ members = [
"sdk/reserved-account-keys",
"sdk/sanitize",
"sdk/sdk-ids",
"sdk/secp256k1-program",
"sdk/secp256r1-program",
"sdk/seed-derivable",
"sdk/seed-phrase",
Expand Down Expand Up @@ -537,6 +538,7 @@ solana-runtime-transaction = { path = "runtime-transaction", version = "=2.2.0"
solana-sdk = { path = "sdk", version = "=2.2.0" }
solana-sdk-ids = { path = "sdk/sdk-ids", version = "=2.2.0" }
solana-sdk-macro = { path = "sdk/macro", version = "=2.2.0" }
solana-secp256k1-program = { path = "sdk/secp256k1-program", version = "=2.2.0" }
solana-secp256k1-recover = { path = "curves/secp256k1-recover", version = "=2.2.0", default-features = false }
solana-send-transaction-service = { path = "send-transaction-service", version = "=2.2.0" }
solana-short-vec = { path = "sdk/short-vec", version = "=2.2.0" }
Expand Down
17 changes: 17 additions & 0 deletions programs/sbf/Cargo.lock

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

2 changes: 2 additions & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ full = [
"dep:solana-precompile-error",
"dep:solana-presigner",
"dep:solana-quic-definitions",
"dep:solana-secp256k1-program",
"dep:solana-seed-derivable",
"dep:solana-seed-phrase",
"dep:solana-signer",
Expand Down Expand Up @@ -134,6 +135,7 @@ solana-reward-info = { workspace = true, features = ["serde"] }
solana-sanitize = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-sdk-macro = { workspace = true }
solana-secp256k1-program = { workspace = true, optional = true, features = ["bincode"] }
solana-secp256k1-recover = { workspace = true }
solana-secp256r1-program = { workspace = true, default-features = false }
solana-seed-derivable = { workspace = true, optional = true }
Expand Down
55 changes: 55 additions & 0 deletions sdk/secp256k1-program/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[package]
name = "solana-secp256k1-program"
description = "Instructions for the Solana Secp256k1 native program."
documentation = "https://docs.rs/solana-secp256k1-program"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
bincode = { workspace = true, optional = true }
digest = { workspace = true }
libsecp256k1 = { workspace = true, features = ["hmac"] }
serde = { workspace = true, optional = true }
serde_derive = { workspace = true, optional = true }
sha3 = { workspace = true }
solana-feature-set = { workspace = true, optional = true }
solana-instruction = { workspace = true, features = ["std"], optional = true }
solana-precompile-error = { workspace = true, optional = true }
solana-sdk-ids = { workspace = true, optional = true }

[dev-dependencies]
anyhow = { workspace = true }
hex = { workspace = true }
rand0-7 = { workspace = true }
solana-account-info = { workspace = true }
solana-hash = { workspace = true }
solana-keccak-hasher = { workspace = true }
solana-keypair = { workspace = true }
solana-logger = { workspace = true }
solana-msg = { workspace = true }
solana-program-error = { workspace = true }
solana-sdk = { path = ".." }
solana-secp256k1-program = { path = ".", features = ["dev-context-only-utils"] }
solana-signer = { workspace = true }
solana-sysvar = { workspace = true }

[features]
bincode = [
"dep:bincode",
"dep:solana-feature-set",
"dep:solana-instruction",
"dep:solana-precompile-error",
"dep:solana-sdk-ids",
"serde",
]
dev-context-only-utils = ["bincode"]
serde = ["dep:serde", "dep:serde_derive"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
all-features = true
rustdoc-args = ["--cfg=docsrs"]
Loading

0 comments on commit 92068d1

Please sign in to comment.