Skip to content

Commit

Permalink
Extract signer crates (#3087)
Browse files Browse the repository at this point in the history
* extract signer crate

* fmt

* fix bs58 std usage

* extract seed-derivable crate

* extract seed-phrase crate

* fix copy-pasted doc

* extract presigner crate

* make keypair module optional in solana-signer

* remove serde_json dep and fix test features

* remove thiserror from solana-signer

* lint

* more lint

* fix dev dep feature

* sort deps

* remove itertools from solana-signer

* move wasm impl to signer crate

* add doc_auto_cfg like in #3121

* post-rebase fix

* another post-rebase fix

* fmt

* make keypair functionality of solana-seed-phrase optional

* fix feature-gated imports

* Extract solana-keypair, move other things around

* Cleanup things that I missed

* Remove space

* Add deprecated notice

* Add deprecation notices

* Refactor SeedDerivable trait implementation

---------

Co-authored-by: Jon C <[email protected]>
  • Loading branch information
kevinheavey and joncinque authored Nov 6, 2024
1 parent 5a6f518 commit e752b38
Show file tree
Hide file tree
Showing 21 changed files with 1,054 additions and 700 deletions.
63 changes: 60 additions & 3 deletions Cargo.lock

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

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ members = [
"sdk/hash",
"sdk/inflation",
"sdk/instruction",
"sdk/keypair",
"sdk/macro",
"sdk/msg",
"sdk/native-token",
Expand All @@ -130,6 +131,7 @@ members = [
"sdk/package-metadata-macro",
"sdk/packet",
"sdk/precompile-error",
"sdk/presigner",
"sdk/program",
"sdk/program-entrypoint",
"sdk/program-error",
Expand All @@ -139,10 +141,13 @@ members = [
"sdk/pubkey",
"sdk/rent",
"sdk/sanitize",
"sdk/seed-derivable",
"sdk/seed-phrase",
"sdk/serde-varint",
"sdk/serialize-utils",
"sdk/sha256-hasher",
"sdk/signature",
"sdk/signer",
"sdk/slot-hashes",
"sdk/slot-history",
"sdk/stable-layout",
Expand Down Expand Up @@ -359,6 +364,7 @@ quinn = "0.11.4"
quinn-proto = "0.11.7"
quote = "1.0"
rand = "0.8.5"
rand0-7 = { package = "rand", version = "0.7" }
rand_chacha = "0.3.1"
rayon = "1.10.0"
reed-solomon-erasure = "6.0.0"
Expand Down Expand Up @@ -447,6 +453,7 @@ solana-hash = { path = "sdk/hash", version = "=2.2.0", default-features = false
solana-inflation = { path = "sdk/inflation", version = "=2.2.0" }
solana-inline-spl = { path = "inline-spl", version = "=2.2.0" }
solana-instruction = { path = "sdk/instruction", version = "=2.2.0", default-features = false }
solana-keypair = { path = "sdk/keypair", version = "=2.2.0" }
solana-last-restart-slot = { path = "sdk/last-restart-slot", version = "=2.2.0" }
solana-lattice-hash = { path = "lattice-hash", version = "=2.2.0" }
solana-ledger = { path = "ledger", version = "=2.2.0" }
Expand All @@ -470,6 +477,7 @@ solana-perf = { path = "perf", version = "=2.2.0" }
solana-poh = { path = "poh", version = "=2.2.0" }
solana-poseidon = { path = "poseidon", version = "=2.2.0" }
solana-precompile-error = { path = "sdk/precompile-error", version = "=2.2.0" }
solana-presigner = { path = "sdk/presigner", version = "=2.2.0" }
solana-program = { path = "sdk/program", version = "=2.2.0", default-features = false }
solana-program-error = { path = "sdk/program-error", version = "=2.2.0" }
solana-program-memory = { path = "sdk/program-memory", version = "=2.2.0" }
Expand All @@ -485,10 +493,13 @@ solana-remote-wallet = { path = "remote-wallet", version = "=2.2.0", default-fea
solana-rent = { path = "sdk/rent", version = "=2.2.0", default-features = false }
solana-reward-info = { path = "sdk/reward-info", version = "=2.2.0" }
solana-sanitize = { path = "sdk/sanitize", version = "=2.2.0" }
solana-seed-derivable = { path = "sdk/seed-derivable", version = "=2.2.0" }
solana-seed-phrase = { path = "sdk/seed-phrase", version = "=2.2.0" }
solana-serde-varint = { path = "sdk/serde-varint", version = "=2.2.0" }
solana-serialize-utils = { path = "sdk/serialize-utils", version = "=2.2.0" }
solana-sha256-hasher = { path = "sdk/sha256-hasher", version = "=2.2.0" }
solana-signature = { path = "sdk/signature", version = "=2.2.0", default-features = false }
solana-signer = { path = "sdk/signer", version = "=2.2.0" }
solana-slot-hashes = { path = "sdk/slot-hashes", version = "=2.2.0" }
solana-slot-history = { path = "sdk/slot-history", version = "=2.2.0" }
solana-time-utils = { path = "sdk/time-utils", version = "=2.2.0" }
Expand Down
59 changes: 56 additions & 3 deletions programs/sbf/Cargo.lock

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

16 changes: 11 additions & 5 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ full = [
"serde_json",
"solana-signature",
"ed25519-dalek",
"ed25519-dalek-bip32",
"libsecp256k1",
"sha3",
"solana-commitment-config",
"digest",
"solana-pubkey/rand",
"dep:solana-keypair",
"dep:solana-precompile-error",
"dep:solana-presigner",
"dep:solana-seed-derivable",
"dep:solana-seed-phrase",
"dep:solana-signer",
"dep:solana-transaction-error"
]
borsh = ["dep:borsh", "solana-program/borsh", "solana-secp256k1-recover/borsh"]
Expand Down Expand Up @@ -66,12 +70,10 @@ chrono = { workspace = true, features = ["alloc"], optional = true }
curve25519-dalek = { workspace = true, optional = true }
digest = { workspace = true, optional = true }
ed25519-dalek = { workspace = true, optional = true }
ed25519-dalek-bip32 = { workspace = true, optional = true }
generic-array = { workspace = true, features = [
"serde",
"more_lengths",
], optional = true }
hmac = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
libsecp256k1 = { workspace = true, optional = true, features = ["hmac"] }
Expand All @@ -80,10 +82,9 @@ memmap2 = { workspace = true, optional = true }
num-derive = { workspace = true }
num-traits = { workspace = true }
num_enum = { workspace = true }
pbkdf2 = { workspace = true }
qualifier_attr = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
rand0-7 = { package = "rand", version = "0.7", optional = true }
rand0-7 = { workspace = true, optional = true }
serde = { workspace = true }
serde_bytes = { workspace = true }
serde_derive = { workspace = true }
Expand All @@ -107,16 +108,20 @@ solana-frozen-abi-macro = { workspace = true, optional = true, features = [
] }
solana-inflation = { workspace = true, features = ["serde"] }
solana-instruction = { workspace = true }
solana-keypair = { workspace = true, optional = true, features = ["seed-derivable"] }
solana-native-token = { workspace = true }
solana-packet = { workspace = true, features = ["bincode", "serde"] }
solana-precompile-error = { workspace = true, optional = true }
solana-presigner = { workspace = true, optional = true }
solana-program = { workspace = true }
solana-program-memory = { workspace = true }
solana-pubkey = { workspace = true, default-features = false, features = ["std"] }
solana-reward-info = { workspace = true, features = ["serde"] }
solana-sanitize = { workspace = true }
solana-sdk-macro = { workspace = true }
solana-secp256k1-recover = { workspace = true }
solana-seed-derivable = { workspace = true, optional = true }
solana-seed-phrase = { workspace = true, optional = true }
solana-serde-varint = { workspace = true }
solana-short-vec = { workspace = true }
solana-signature = { workspace = true, features = [
Expand All @@ -125,6 +130,7 @@ solana-signature = { workspace = true, features = [
"std",
"verify",
], optional = true }
solana-signer = { workspace = true, optional = true }
solana-time-utils = { workspace = true }
solana-transaction-error = { workspace = true, features = ["serde"], optional = true }
thiserror = { workspace = true }
Expand Down
Loading

0 comments on commit e752b38

Please sign in to comment.