Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ check-cfg = [
]

[workspace.dependencies]
ahash = "0.8.11"
ahash = { version = "0.8.11", default-features = false }
anyhow = "1.0.96"
arbitrary = "1.4.1"
ark-bn254 = "0.4.0"
Expand Down
9 changes: 7 additions & 2 deletions feature-set/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ license = { workspace = true }
edition = { workspace = true }

[dependencies]
ahash = { workspace = true }
lazy_static = { workspace = true }
solana-epoch-schedule = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true, features = [
Expand All @@ -19,8 +18,14 @@ solana-frozen-abi = { workspace = true, optional = true, features = [
solana-frozen-abi-macro = { workspace = true, optional = true, features = [
"frozen-abi",
] }
solana-hash = { workspace = true }
solana-pubkey = { workspace = true }

[target.'cfg(target_os = "solana")'.dependencies]
ahash = { workspace = true, default-features = false, features = ["std", "no-rng"] }

[target.'cfg(not(target_os = "solana"))'.dependencies]
ahash = { workspace = true, default-features = true }
solana-hash = { workspace = true }
solana-sha256-hasher = { workspace = true }
Comment on lines +28 to 29
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you explain why solana-hash and sha256-hasher are moved under the not(solana) scope?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nvm i see now below - the generated ID only needed for validator.


[features]
Expand Down
9 changes: 5 additions & 4 deletions feature-set/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ use {
ahash::{AHashMap, AHashSet},
lazy_static::lazy_static,
solana_epoch_schedule::EpochSchedule,
solana_hash::Hash,
solana_pubkey::Pubkey,
solana_sha256_hasher::Hasher,
};

pub mod deprecate_rewards_sysvar {
Expand Down Expand Up @@ -1190,10 +1188,13 @@ lazy_static! {
.iter()
.cloned()
.collect();
}

#[cfg(not(target_os = "solana"))]
lazy_static! {
/// Unique identifier of the current software's feature set
pub static ref ID: Hash = {
let mut hasher = Hasher::default();
pub static ref ID: solana_hash::Hash = {
let mut hasher = solana_sha256_hasher::Hasher::default();
let mut feature_ids = FEATURE_NAMES.keys().collect::<Vec<_>>();
feature_ids.sort();
for feature in feature_ids {
Expand Down