Skip to content

Commit

Permalink
builtin default cost: import core bpf migration crate
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Nov 26, 2024
1 parent 485786e commit 8f4e39a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions builtins-default-costs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ log = { workspace = true }
solana-address-lookup-table-program = { workspace = true }
solana-bpf-loader-program = { workspace = true }
solana-compute-budget-program = { workspace = true }
solana-core-bpf-migration = { workspace = true }
solana-config-program = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true, features = [
"frozen-abi",
Expand Down
28 changes: 12 additions & 16 deletions builtins-default-costs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
use {
ahash::AHashMap,
lazy_static::lazy_static,
solana_core_bpf_migration::prototypes::BUILTINS,
solana_sdk::{
address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable,
compute_budget, ed25519_program,
feature_set::{self, FeatureSet},
loader_v4,
pubkey::Pubkey,
compute_budget, ed25519_program, feature_set::FeatureSet, loader_v4, pubkey::Pubkey,
secp256k1_program,
},
};
Expand Down Expand Up @@ -39,72 +37,70 @@ lazy_static! {
solana_stake_program::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()),
core_bpf_migration_feature: BUILTINS[2].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
solana_config_program::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()),
core_bpf_migration_feature: BUILTINS[3].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
solana_vote_program::id(),
BuiltinCost {
native_cost: solana_vote_program::vote_processor::DEFAULT_COMPUTE_UNITS,
core_bpf_migration_feature: None,
core_bpf_migration_feature: BUILTINS[1].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
solana_system_program::id(),
BuiltinCost {
native_cost: solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS,
core_bpf_migration_feature: None,
core_bpf_migration_feature: BUILTINS[0].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
compute_budget::id(),
BuiltinCost {
native_cost: solana_compute_budget_program::DEFAULT_COMPUTE_UNITS,
core_bpf_migration_feature: None,
core_bpf_migration_feature: BUILTINS[7].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
address_lookup_table::program::id(),
BuiltinCost {
native_cost: solana_address_lookup_table_program::processor::DEFAULT_COMPUTE_UNITS,
core_bpf_migration_feature: Some(
feature_set::migrate_address_lookup_table_program_to_core_bpf::id(),
),
core_bpf_migration_feature: BUILTINS[8].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
bpf_loader_upgradeable::id(),
BuiltinCost {
native_cost: solana_bpf_loader_program::UPGRADEABLE_LOADER_COMPUTE_UNITS,
core_bpf_migration_feature: None,
core_bpf_migration_feature: BUILTINS[6].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
bpf_loader_deprecated::id(),
BuiltinCost {
native_cost: solana_bpf_loader_program::DEPRECATED_LOADER_COMPUTE_UNITS,
core_bpf_migration_feature: None,
core_bpf_migration_feature: BUILTINS[4].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
bpf_loader::id(),
BuiltinCost {
native_cost: solana_bpf_loader_program::DEFAULT_LOADER_COMPUTE_UNITS,
core_bpf_migration_feature: None,
core_bpf_migration_feature: BUILTINS[5].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
(
loader_v4::id(),
BuiltinCost {
native_cost: solana_loader_v4_program::DEFAULT_COMPUTE_UNITS,
core_bpf_migration_feature: None,
core_bpf_migration_feature: BUILTINS[10].core_bpf_migration_config.as_ref().map(|c| c.feature_id),
},
),
// Note: These are precompile, run directly in bank during sanitizing;
Expand Down
1 change: 1 addition & 0 deletions programs/sbf/Cargo.lock

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

1 change: 1 addition & 0 deletions 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 8f4e39a

Please sign in to comment.