Skip to content

Commit

Permalink
Extract feature-set crate (anza-xyz#2172)
Browse files Browse the repository at this point in the history
* extract feature-set crate

* update feature_set dependents

* re-export with deprecation notice

* fix path after rebase

* fmt

* fmt after rebase

* fixes after rebase

* unused import

* fix import

* unused import

* post-rebase fixes

* fix path

* missing frozen-abi support

* update lock file

* use workspace lints

* fix paths

* fix import

* remove unused import

* remove unused deps

* consolidate imports

* add back dep (not unused after all)
  • Loading branch information
kevinheavey authored and ray-kast committed Nov 27, 2024
1 parent abcf6a7 commit d5bdc7f
Show file tree
Hide file tree
Showing 105 changed files with 488 additions and 381 deletions.
36 changes: 36 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 @@ -107,6 +107,7 @@ members = [
"sdk/clock",
"sdk/decode-error",
"sdk/derivation-path",
"sdk/feature-set",
"sdk/gen-headers",
"sdk/hash",
"sdk/macro",
Expand Down Expand Up @@ -388,6 +389,7 @@ solana-derivation-path = { path = "sdk/derivation-path", version = "=2.1.0" }
solana-download-utils = { path = "download-utils", version = "=2.1.0" }
solana-entry = { path = "entry", version = "=2.1.0" }
solana-faucet = { path = "faucet", version = "=2.1.0" }
solana-feature-set = { path = "sdk/feature-set", version = "=2.1.0" }
solana-fee = { path = "fee", version = "=2.1.0" }
solana-frozen-abi = { path = "frozen-abi", version = "=2.1.0" }
solana-frozen-abi-macro = { path = "frozen-abi/macro", version = "=2.1.0" }
Expand Down
1 change: 1 addition & 0 deletions banks-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ crossbeam-channel = { workspace = true }
futures = { workspace = true }
solana-banks-interface = { workspace = true }
solana-client = { workspace = true }
solana-feature-set = { workspace = true }
solana-runtime = { workspace = true }
solana-sdk = { workspace = true }
solana-send-transaction-service = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions banks-server/src/banks_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use {
TransactionSimulationDetails, TransactionStatus,
},
solana_client::connection_cache::ConnectionCache,
solana_feature_set::{move_precompile_verification_to_svm, FeatureSet},
solana_runtime::{
bank::{Bank, TransactionSimulationResult},
bank_forks::BankForks,
Expand All @@ -17,7 +18,6 @@ use {
account::Account,
clock::Slot,
commitment_config::CommitmentLevel,
feature_set::{self, FeatureSet},
hash::Hash,
message::{Message, SanitizedMessage},
pubkey::Pubkey,
Expand Down Expand Up @@ -165,7 +165,7 @@ fn verify_transaction(
transaction.verify()?;

let move_precompile_verification_to_svm =
feature_set.is_active(&feature_set::move_precompile_verification_to_svm::id());
feature_set.is_active(&move_precompile_verification_to_svm::id());
if !move_precompile_verification_to_svm {
transaction.verify_precompiles(feature_set)?;
}
Expand Down
1 change: 1 addition & 0 deletions bench-tps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ thiserror = { workspace = true }

[dev-dependencies]
serial_test = { workspace = true }
solana-feature-set = { workspace = true }
solana-local-cluster = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-test-validator = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion bench-tps/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1224,10 +1224,10 @@ pub fn fund_keypairs<T: 'static + TpsClient + Send + Sync + ?Sized>(
mod tests {
use {
super::*,
solana_feature_set::FeatureSet,
solana_runtime::{bank::Bank, bank_client::BankClient, bank_forks::BankForks},
solana_sdk::{
commitment_config::CommitmentConfig,
feature_set::FeatureSet,
fee_calculator::FeeRateGovernor,
genesis_config::{create_genesis_config, GenesisConfig},
native_token::sol_to_lamports,
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ solana-compute-budget = { workspace = true }
solana-config-program = { workspace = true }
solana-connection-cache = { workspace = true }
solana-decode-error = { workspace = true }
solana-feature-set = { workspace = true }
solana-loader-v4-program = { workspace = true }
solana-logger = { workspace = true }
solana-program-runtime = { workspace = true }
Expand Down
7 changes: 4 additions & 3 deletions cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use {
clock::{self, Clock, Slot},
commitment_config::CommitmentConfig,
epoch_schedule::Epoch,
feature_set,
hash::Hash,
message::Message,
native_token::lamports_to_sol,
Expand Down Expand Up @@ -1898,8 +1897,10 @@ pub fn process_show_stakes(
let stake_history = from_account(&stake_history_account).ok_or_else(|| {
CliError::RpcRequestError("Failed to deserialize stake history".to_string())
})?;
let new_rate_activation_epoch =
get_feature_activation_epoch(rpc_client, &feature_set::reduce_stake_warmup_cooldown::id())?;
let new_rate_activation_epoch = get_feature_activation_epoch(
rpc_client,
&solana_feature_set::reduce_stake_warmup_cooldown::id(),
)?;
stake_account_progress_bar.finish_and_clear();

let mut stake_accounts: Vec<CliKeyedStakeState> = vec![];
Expand Down
2 changes: 1 addition & 1 deletion cli/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use {
input_validators::*, keypair::*,
},
solana_cli_output::{cli_version::CliVersion, QuietDisplay, VerboseDisplay},
solana_feature_set::FEATURE_NAMES,
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_rpc_client::rpc_client::RpcClient,
solana_rpc_client_api::{
Expand All @@ -25,7 +26,6 @@ use {
clock::Slot,
epoch_schedule::EpochSchedule,
feature::{self, Feature},
feature_set::FEATURE_NAMES,
genesis_config::ClusterType,
message::Message,
pubkey::Pubkey,
Expand Down
2 changes: 1 addition & 1 deletion cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ use {
tpu_client::{TpuClient, TpuClientConfig},
},
solana_compute_budget::compute_budget::ComputeBudget,
solana_feature_set::{FeatureSet, FEATURE_NAMES},
solana_program_runtime::invoke_context::InvokeContext,
solana_rbpf::{elf::Executable, verifier::RequisiteVerifier},
solana_remote_wallet::remote_wallet::RemoteWalletManager,
Expand All @@ -58,7 +59,6 @@ use {
bpf_loader_upgradeable::{self, get_program_data_address, UpgradeableLoaderState},
commitment_config::CommitmentConfig,
compute_budget,
feature_set::{FeatureSet, FEATURE_NAMES},
instruction::{Instruction, InstructionError},
message::Message,
packet::PACKET_DATA_SIZE,
Expand Down
3 changes: 1 addition & 2 deletions cli/src/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ use {
clock::{Clock, UnixTimestamp, SECONDS_PER_DAY},
commitment_config::CommitmentConfig,
epoch_schedule::EpochSchedule,
feature_set,
message::Message,
native_token::Sol,
pubkey::Pubkey,
Expand Down Expand Up @@ -2567,7 +2566,7 @@ pub fn process_show_stake_account(
})?;
let new_rate_activation_epoch = get_feature_activation_epoch(
rpc_client,
&feature_set::reduce_stake_warmup_cooldown::id(),
&solana_feature_set::reduce_stake_warmup_cooldown::id(),
)?;

let mut state = build_stake_state(
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use {
},
solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
solana_faucet::faucet::run_local_faucet,
solana_feature_set::enable_alt_bn128_syscall,
solana_rpc::rpc::JsonRpcConfig,
solana_rpc_client::rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient},
solana_rpc_client_api::config::RpcTransactionConfig,
Expand All @@ -23,7 +24,6 @@ use {
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
commitment_config::CommitmentConfig,
compute_budget::{self, ComputeBudgetInstruction},
feature_set::enable_alt_bn128_syscall,
fee_calculator::FeeRateGovernor,
pubkey::Pubkey,
rent::Rent,
Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ solana-compute-budget = { workspace = true }
solana-connection-cache = { workspace = true }
solana-cost-model = { workspace = true }
solana-entry = { workspace = true }
solana-feature-set = { workspace = true }
solana-fee = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true }
solana-frozen-abi-macro = { workspace = true, optional = true }
Expand Down
Loading

0 comments on commit d5bdc7f

Please sign in to comment.