From c45a1eb8d33390f249f97140064f0a40bb4dfb64 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Mon, 9 Dec 2024 13:58:49 +0400 Subject: [PATCH] remove solana-sdk from builtins-default-costs (#3999) --- Cargo.lock | 4 +++- builtins-default-costs/Cargo.toml | 4 +++- .../benches/builtin_instruction_costs.rs | 18 +++++++++------- builtins-default-costs/src/lib.rs | 21 +++++++++---------- programs/sbf/Cargo.lock | 4 +++- svm/examples/Cargo.lock | 4 +++- 6 files changed, 32 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b3a119838d3e3..ecc65cdbe1faf7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6282,9 +6282,11 @@ dependencies = [ "solana-bpf-loader-program", "solana-compute-budget-program", "solana-config-program", + "solana-feature-set", "solana-frozen-abi", "solana-loader-v4-program", - "solana-sdk", + "solana-pubkey", + "solana-sdk-ids", "solana-stake-program", "solana-system-program", "solana-vote-program", diff --git a/builtins-default-costs/Cargo.toml b/builtins-default-costs/Cargo.toml index bdd29a267280b5..9c0a1e0753a799 100644 --- a/builtins-default-costs/Cargo.toml +++ b/builtins-default-costs/Cargo.toml @@ -17,11 +17,13 @@ solana-address-lookup-table-program = { workspace = true } solana-bpf-loader-program = { workspace = true } solana-compute-budget-program = { workspace = true } solana-config-program = { workspace = true } +solana-feature-set = { workspace = true } solana-frozen-abi = { workspace = true, optional = true, features = [ "frozen-abi", ] } solana-loader-v4-program = { workspace = true } -solana-sdk = { workspace = true } +solana-pubkey = { workspace = true } +solana-sdk-ids = { workspace = true } solana-stake-program = { workspace = true } solana-system-program = { workspace = true } solana-vote-program = { workspace = true } diff --git a/builtins-default-costs/benches/builtin_instruction_costs.rs b/builtins-default-costs/benches/builtin_instruction_costs.rs index 4aeee4b51c8f78..71618852be5ef5 100644 --- a/builtins-default-costs/benches/builtin_instruction_costs.rs +++ b/builtins-default-costs/benches/builtin_instruction_costs.rs @@ -3,10 +3,12 @@ extern crate test; use { rand::Rng, solana_builtins_default_costs::get_builtin_instruction_cost, - solana_sdk::{ + solana_feature_set::FeatureSet, + solana_pubkey::Pubkey, + solana_sdk_ids::{ address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, - compute_budget, ed25519_program, feature_set::FeatureSet, loader_v4, pubkey::Pubkey, - secp256k1_program, + compute_budget, config, ed25519_program, loader_v4, secp256k1_program, stake, + system_program, vote, }, test::Bencher, }; @@ -20,12 +22,12 @@ const NUM_TRANSACTIONS_PER_ITER: usize = 1024; fn setup(all_features_enabled: bool) -> BenchSetup { let pubkeys: [Pubkey; 12] = [ - solana_stake_program::id(), - solana_config_program::id(), - solana_vote_program::id(), - solana_system_program::id(), + stake::id(), + config::id(), + vote::id(), + system_program::id(), compute_budget::id(), - address_lookup_table::program::id(), + address_lookup_table::id(), bpf_loader_upgradeable::id(), bpf_loader_deprecated::id(), bpf_loader::id(), diff --git a/builtins-default-costs/src/lib.rs b/builtins-default-costs/src/lib.rs index 2e167c667cc84d..3150e799c42969 100644 --- a/builtins-default-costs/src/lib.rs +++ b/builtins-default-costs/src/lib.rs @@ -3,13 +3,12 @@ use { ahash::AHashMap, lazy_static::lazy_static, - solana_sdk::{ + solana_feature_set::{self as feature_set, FeatureSet}, + solana_pubkey::Pubkey, + solana_sdk_ids::{ address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, - compute_budget, ed25519_program, - feature_set::{self, FeatureSet}, - loader_v4, - pubkey::Pubkey, - secp256k1_program, + compute_budget, config, ed25519_program, loader_v4, secp256k1_program, stake, + system_program, vote, }, }; @@ -36,28 +35,28 @@ lazy_static! { /// https://github.com/solana-labs/solana/issues/29595. static ref BUILTIN_INSTRUCTION_COSTS: AHashMap = [ ( - solana_stake_program::id(), + stake::id(), BuiltinCost { native_cost: solana_stake_program::stake_instruction::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: Some(feature_set::migrate_stake_program_to_core_bpf::id()), }, ), ( - solana_config_program::id(), + config::id(), BuiltinCost { native_cost: solana_config_program::config_processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: Some(feature_set::migrate_config_program_to_core_bpf::id()), }, ), ( - solana_vote_program::id(), + vote::id(), BuiltinCost { native_cost: solana_vote_program::vote_processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: None, }, ), ( - solana_system_program::id(), + system_program::id(), BuiltinCost { native_cost: solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: None, @@ -71,7 +70,7 @@ lazy_static! { }, ), ( - address_lookup_table::program::id(), + address_lookup_table::id(), BuiltinCost { native_cost: solana_address_lookup_table_program::processor::DEFAULT_COMPUTE_UNITS, core_bpf_migration_feature: Some( diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 29d9aa591f4948..ab6585e21f4c92 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5168,8 +5168,10 @@ dependencies = [ "solana-bpf-loader-program", "solana-compute-budget-program", "solana-config-program", + "solana-feature-set", "solana-loader-v4-program", - "solana-sdk", + "solana-pubkey", + "solana-sdk-ids", "solana-stake-program", "solana-system-program", "solana-vote-program", diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index b3c445209bb16c..9a72be80f1c225 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -5019,8 +5019,10 @@ dependencies = [ "solana-bpf-loader-program", "solana-compute-budget-program", "solana-config-program", + "solana-feature-set", "solana-loader-v4-program", - "solana-sdk", + "solana-pubkey", + "solana-sdk-ids", "solana-stake-program", "solana-system-program", "solana-vote-program",