forked from anza-xyz/agave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk: Extract hash and hasher crates (anza-xyz#2015)
* extract hash and hasher crates and re-export their contents in solana_program::hash * make bytemuck and serde optional, and activate features in solana-program * fix frozen-abi support * fix import * update lock file * cargo sort * fix wasm_bindgen import * typo * fmt * make the inner field of Hash pub(crate) again because otherwise wasm_bindgen breaks * move program/src/wasm/hash.rs contents to solana-hash crate * update lock file * remove duplicate frozen-abi stuff * fix specialization stuff * delete tmp tests * update BlockhashQueue digest * Revert "update BlockhashQueue digest" This reverts commit 591302b. * update expected digests after confirming that the change is merely from moving the Hash struct and not a real ABI change * update another digest * update digests in sdk and program * update digests in runtime * update VoteTransaction digest * conditionally activate solana-hash/borsh in solana-program * move js-sys dep under cfg(target_arch = "wasm32") * remove thiserror from hash crate * remove solana-program dependency from merkle-tree * make solana-hash no_std by default * fmt * fmt after rebase * make std feature default * make sha2 an optional dep when target_os = "solana", because it's unlikely to be used in that case * fmt * make rustc_version optional * update lock file * fix frozen-abi lint * another lint fix * add comment about sha2 removal * avoid Vec in FromStr Co-authored-by: Jon C <[email protected]> * put Hash::new_unique behind #[cfg(feature = "dev-context-only-utils")] * move tests from solana-hasher to solana-hash * rename solana-hasher to solana-sha256-hasher * fmt * make conditional import more consistent Co-authored-by: Jon C <[email protected]> * don't use std feature of bs58 in solana-hash * undo putting new_unique behind dev-context-only-utils * missing feature * rename to write_as_base58 and reorder params Co-authored-by: Jon C <[email protected]> * update write_as_base58 usage * fix feature activation for tests * remove part of doc that no longer makes sense Co-authored-by: Jon C <[email protected]> --------- Co-authored-by: Jon C <[email protected]>
- Loading branch information
Showing
32 changed files
with
521 additions
and
326 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[package] | ||
name = "solana-hash" | ||
description = "Solana wrapper for the 32-byte output of a hashing algorithm." | ||
documentation = "https://docs.rs/solana-hash" | ||
version = { workspace = true } | ||
authors = { workspace = true } | ||
repository = { workspace = true } | ||
homepage = { workspace = true } | ||
license = { workspace = true } | ||
edition = { workspace = true } | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
borsh = { workspace = true, optional = true } | ||
bs58 = { workspace = true, default-features = false } | ||
bytemuck = { workspace = true, optional = true } | ||
bytemuck_derive = { workspace = true, optional = true } | ||
serde = { workspace = true, optional = true } | ||
serde_derive = { workspace = true, optional = true } | ||
solana-atomic-u64 = { workspace = true } | ||
solana-frozen-abi = { workspace = true, optional = true } | ||
solana-frozen-abi-macro = { workspace = true, optional = true } | ||
solana-sanitize = { workspace = true } | ||
|
||
[dev-dependencies] | ||
solana-hash = { path = ".", features = ["dev-context-only-utils"] } | ||
|
||
[target.'cfg(target_arch = "wasm32")'.dependencies] | ||
js-sys = { workspace = true } | ||
wasm-bindgen = { workspace = true } | ||
|
||
[build-dependencies] | ||
rustc_version = { workspace = true, optional = true } | ||
|
||
[features] | ||
borsh = ["dep:borsh", "std"] | ||
bytemuck = ["dep:bytemuck", "dep:bytemuck_derive"] | ||
default = ["std"] | ||
dev-context-only-utils = ["bs58/alloc"] | ||
frozen-abi = [ | ||
"dep:rustc_version", | ||
"dep:solana-frozen-abi", | ||
"dep:solana-frozen-abi-macro", | ||
"std" | ||
] | ||
serde = ["dep:serde", "dep:serde_derive"] | ||
std = [] | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../frozen-abi/build.rs |
Oops, something went wrong.