diff --git a/programs/bpf_loader/src/syscalls.rs b/programs/bpf_loader/src/syscalls.rs index 8799fdec73..847fe820ca 100644 --- a/programs/bpf_loader/src/syscalls.rs +++ b/programs/bpf_loader/src/syscalls.rs @@ -23,7 +23,7 @@ use solana_sdk::{ feature_set::{ blake3_syscall_enabled, close_upgradeable_program_accounts, disable_fees_sysvar, enforce_aligned_host_addrs, libsecp256k1_0_5_upgrade_enabled, mem_overlap_fix, - memory_ops_syscalls, secp256k1_recover_syscall_enabled, + secp256k1_recover_syscall_enabled, }, hash::{Hasher, HASH_BYTES}, ic_msg, @@ -158,12 +158,10 @@ pub fn register_syscalls( syscall_registry .register_syscall_by_name(b"sol_get_rent_sysvar", SyscallGetRentSysvar::call)?; - if invoke_context.is_feature_active(&memory_ops_syscalls::id()) { - syscall_registry.register_syscall_by_name(b"sol_memcpy_", SyscallMemcpy::call)?; - syscall_registry.register_syscall_by_name(b"sol_memmove_", SyscallMemmove::call)?; - syscall_registry.register_syscall_by_name(b"sol_memcmp_", SyscallMemcmp::call)?; - syscall_registry.register_syscall_by_name(b"sol_memset_", SyscallMemset::call)?; - } + syscall_registry.register_syscall_by_name(b"sol_memcpy_", SyscallMemcpy::call)?; + syscall_registry.register_syscall_by_name(b"sol_memmove_", SyscallMemmove::call)?; + syscall_registry.register_syscall_by_name(b"sol_memcmp_", SyscallMemcmp::call)?; + syscall_registry.register_syscall_by_name(b"sol_memset_", SyscallMemset::call)?; // Cross-program invocation syscalls syscall_registry @@ -290,43 +288,40 @@ pub fn bind_syscall_context_objects<'a>( None, )?; - bind_feature_gated_syscall_context_object!( - vm, - invoke_context.is_feature_active(&memory_ops_syscalls::id()), + vm.bind_syscall_context_object( Box::new(SyscallMemcpy { cost: invoke_context.get_compute_budget().cpi_bytes_per_unit, compute_meter: invoke_context.get_compute_meter(), loader_id, mem_overlap_fix: invoke_context.is_feature_active(&mem_overlap_fix::id()), }), - ); - bind_feature_gated_syscall_context_object!( - vm, - invoke_context.is_feature_active(&memory_ops_syscalls::id()), + None, + )?; + vm.bind_syscall_context_object( Box::new(SyscallMemmove { cost: invoke_context.get_compute_budget().cpi_bytes_per_unit, compute_meter: invoke_context.get_compute_meter(), loader_id, }), - ); - bind_feature_gated_syscall_context_object!( - vm, - invoke_context.is_feature_active(&memory_ops_syscalls::id()), + None, + )?; + vm.bind_syscall_context_object( Box::new(SyscallMemcmp { cost: invoke_context.get_compute_budget().cpi_bytes_per_unit, compute_meter: invoke_context.get_compute_meter(), loader_id, }), - ); - bind_feature_gated_syscall_context_object!( - vm, - invoke_context.is_feature_active(&memory_ops_syscalls::id()), + None, + )?; + vm.bind_syscall_context_object( Box::new(SyscallMemset { cost: invoke_context.get_compute_budget().cpi_bytes_per_unit, compute_meter: invoke_context.get_compute_meter(), loader_id, }), - ); + None, + )?; + bind_feature_gated_syscall_context_object!( vm, invoke_context.is_feature_active(&blake3_syscall_enabled::id()), diff --git a/programs/config/src/config_processor.rs b/programs/config/src/config_processor.rs index a7ac27313a..f7c1a94dbb 100644 --- a/programs/config/src/config_processor.rs +++ b/programs/config/src/config_processor.rs @@ -24,9 +24,7 @@ pub fn process_instruction( let config_keyed_account = &mut keyed_account_at_index(keyed_accounts, 0)?; let current_data: ConfigKeys = { let config_account = config_keyed_account.try_account_ref_mut()?; - if invoke_context.is_feature_active(&feature_set::check_program_owner::id()) - && config_account.owner() != &crate::id() - { + if config_account.owner() != &crate::id() { return Err(InstructionError::InvalidAccountOwner); } diff --git a/programs/stake/src/stake_instruction.rs b/programs/stake/src/stake_instruction.rs index 68ee87da8c..62cb6f2591 100644 --- a/programs/stake/src/stake_instruction.rs +++ b/programs/stake/src/stake_instruction.rs @@ -38,11 +38,7 @@ pub fn process_instruction( let me = &keyed_account_at_index(keyed_accounts, 0)?; if me.owner()? != id() { - if invoke_context.is_feature_active(&feature_set::check_program_owner::id()) { - return Err(InstructionError::InvalidAccountOwner); - } else { - return Err(InstructionError::IncorrectProgramId); - } + return Err(InstructionError::InvalidAccountOwner); } match limited_deserialize(data)? { diff --git a/programs/vote/src/vote_instruction.rs b/programs/vote/src/vote_instruction.rs index f8aa30ebb4..a653c60d48 100644 --- a/programs/vote/src/vote_instruction.rs +++ b/programs/vote/src/vote_instruction.rs @@ -321,9 +321,7 @@ pub fn process_instruction( let me = &mut keyed_account_at_index(keyed_accounts, 0)?; - if invoke_context.is_feature_active(&feature_set::check_program_owner::id()) - && me.owner()? != id() - { + if me.owner()? != id() { return Err(InstructionError::InvalidAccountOwner); } diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index 3eac2d635a..692e42b1c1 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -247,9 +247,7 @@ impl Accounts { payer_index = Some(i); } - if solana_sdk::sysvar::instructions::check_id(key) - && feature_set.is_active(&feature_set::instructions_sysvar_enabled::id()) - { + if solana_sdk::sysvar::instructions::check_id(key) { if message.is_writable(i) { return Err(TransactionError::InvalidAccountIndex); } diff --git a/runtime/src/message_processor.rs b/runtime/src/message_processor.rs index dcb7257ed0..06d1828cc7 100644 --- a/runtime/src/message_processor.rs +++ b/runtime/src/message_processor.rs @@ -10,8 +10,7 @@ use solana_sdk::{ account::{AccountSharedData, ReadableAccount, WritableAccount}, compute_budget::ComputeBudget, feature_set::{ - instructions_sysvar_enabled, neon_evm_compute_budget, tx_wide_compute_cap, - updated_verify_policy, FeatureSet, + neon_evm_compute_budget, tx_wide_compute_cap, updated_verify_policy, FeatureSet, }, fee_calculator::FeeCalculator, hash::Hash, @@ -477,16 +476,14 @@ impl MessageProcessor { ) -> Result<(), InstructionError> { // Fixup the special instructions key if present // before the account pre-values are taken care of - if feature_set.is_active(&instructions_sysvar_enabled::id()) { - for (pubkey, accont) in accounts.iter().take(message.account_keys.len()) { - if instructions::check_id(pubkey) { - let mut mut_account_ref = accont.borrow_mut(); - instructions::store_current_index( - mut_account_ref.data_as_mut_slice(), - instruction_index as u16, - ); - break; - } + for (pubkey, accont) in accounts.iter().take(message.account_keys.len()) { + if instructions::check_id(pubkey) { + let mut mut_account_ref = accont.borrow_mut(); + instructions::store_current_index( + mut_account_ref.data_as_mut_slice(), + instruction_index as u16, + ); + break; } } diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index 82263bec61..2df00522df 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -26,10 +26,6 @@ use solana_sdk::{ }; use std::collections::{HashMap, HashSet}; -pub mod instructions_sysvar_enabled { - solana_sdk::declare_id!("EnvhHCLvg55P7PDtbvR1NwuTuAeodqpusV3MR5QEK8gs"); -} - pub mod deprecate_rewards_sysvar { solana_sdk::declare_id!("GaBtBJvmS4Arjj5W1NmFcyvPjsHN38UGYDq2MDwbs9Qu"); } @@ -87,10 +83,6 @@ pub mod check_init_vote_data { solana_sdk::declare_id!("3ccR6QpxGYsAbWyfevEtBNGfWV4xBffxRj2tD6A9i39F"); } -pub mod check_program_owner { - solana_sdk::declare_id!("5XnbR5Es9YXEARRuP6mdvoxiW3hx5atNNeBmwVd8P3QD"); -} - pub mod enforce_aligned_host_addrs { solana_sdk::declare_id!("6Qob9Z4RwGdf599FDVCqsjuKjR8ZFR3oVs2ByRLWBsua"); } @@ -99,10 +91,6 @@ pub mod stake_program_v4 { solana_sdk::declare_id!("Dc7djyhP9aLfdq2zktpvskeAjpG56msCU1yexpxXiWZb"); } -pub mod memory_ops_syscalls { - solana_sdk::declare_id!("ENQi37wsVhTvFz2gUiZAAbqFEWGN2jwFsqdEDTE8A4MU"); -} - pub mod secp256k1_recover_syscall_enabled { solana_sdk::declare_id!("6RvdSWHh8oh72Dp7wMTS2DBkf3fRPtChfNrAo3cZZoXJ"); } @@ -202,8 +190,7 @@ pub mod close_upgradeable_program_accounts { lazy_static! { /// Map of feature identifiers to user-visible description pub static ref FEATURE_NAMES: HashMap = [ - (instructions_sysvar_enabled::id(), "instructions sysvar"), - (deprecate_rewards_sysvar::id(), "deprecate unused rewards sysvar"), + (deprecate_rewards_sysvar::id(), "deprecate unused rewards sysvar"), (pico_inflation::id(), "pico inflation"), (full_inflation::devnet_and_testnet::id(), "full inflation on devnet and testnet"), (spl_token_v2_multisig_fix::id(), "spl-token multisig fix"), @@ -216,10 +203,8 @@ lazy_static! { (full_inflation::mainnet::certusone::vote::id(), "community vote allowing Certus One to enable full inflation"), (warp_timestamp_again::id(), "warp timestamp again, adjust bounding to 25% fast 80% slow #15204"), (check_init_vote_data::id(), "check initialized Vote data"), - (check_program_owner::id(), "limit programs to operating on accounts owned by itself"), (enforce_aligned_host_addrs::id(), "enforce aligned host addresses"), (stake_program_v4::id(), "solana_stake_program v4"), - (memory_ops_syscalls::id(), "add syscalls for memory operations"), (secp256k1_recover_syscall_enabled::id(), "secp256k1_recover syscall"), (add_missing_program_error_mappings::id(), "add missing program error mappings"), (system_transfer_zero_check::id(), "perform all checks for transfers of 0 lamports"),