Skip to content

Commit

Permalink
remove solana-sdk from builtins-default-costs (#3999)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey authored Dec 9, 2024
1 parent 6c362f6 commit c45a1eb
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

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

4 changes: 3 additions & 1 deletion builtins-default-costs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
18 changes: 10 additions & 8 deletions builtins-default-costs/benches/builtin_instruction_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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(),
Expand Down
21 changes: 10 additions & 11 deletions builtins-default-costs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};

Expand All @@ -36,28 +35,28 @@ lazy_static! {
/// https://github.com/solana-labs/solana/issues/29595.
static ref BUILTIN_INSTRUCTION_COSTS: AHashMap<Pubkey, BuiltinCost> = [
(
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,
Expand All @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion programs/sbf/Cargo.lock

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

4 changes: 3 additions & 1 deletion svm/examples/Cargo.lock

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

0 comments on commit c45a1eb

Please sign in to comment.