diff --git a/programs/bpf_loader/src/syscalls/mod.rs b/programs/bpf_loader/src/syscalls/mod.rs index 2c5d8e9feed26d..26bd551976d547 100644 --- a/programs/bpf_loader/src/syscalls/mod.rs +++ b/programs/bpf_loader/src/syscalls/mod.rs @@ -21,12 +21,13 @@ use { solana_feature_set::{ self as feature_set, abort_on_invalid_curve, blake3_syscall_enabled, bpf_account_data_direct_mapping, curve25519_syscall_enabled, - disable_deploy_of_alloc_free_syscall, disable_fees_sysvar, + disable_deploy_of_alloc_free_syscall, disable_fees_sysvar, disable_sbpf_v1_execution, enable_alt_bn128_compression_syscall, enable_alt_bn128_syscall, enable_big_mod_exp_syscall, enable_get_epoch_stake_syscall, enable_partitioned_epoch_reward, enable_poseidon_syscall, error_on_syscall_bpf_function_hash_collisions, get_sysvar_syscall_enabled, - last_restart_slot_sysvar, partitioned_epoch_rewards_superfeature, reject_callx_r10, - remaining_compute_units_syscall_enabled, FeatureSet, + last_restart_slot_sysvar, partitioned_epoch_rewards_superfeature, + reenable_sbpf_v1_execution, reject_callx_r10, remaining_compute_units_syscall_enabled, + FeatureSet, }, solana_log_collector::{ic_logger_msg, ic_msg}, solana_poseidon as poseidon, @@ -300,7 +301,8 @@ pub fn create_program_runtime_environment_v1<'a>( external_internal_function_hash_collision: feature_set .is_active(&error_on_syscall_bpf_function_hash_collisions::id()), reject_callx_r10: feature_set.is_active(&reject_callx_r10::id()), - enable_sbpf_v1: true, + enable_sbpf_v1: !feature_set.is_active(&disable_sbpf_v1_execution::id()) + || feature_set.is_active(&reenable_sbpf_v1_execution::id()), enable_sbpf_v2: false, optimize_rodata: false, aligned_memory_mapping: !feature_set.is_active(&bpf_account_data_direct_mapping::id()), diff --git a/programs/bpf_loader/test_elfs/out/callx-r10-sbfv1.so b/programs/bpf_loader/test_elfs/out/callx-r10-sbfv1.so deleted file mode 100644 index cfa64553838012..00000000000000 Binary files a/programs/bpf_loader/test_elfs/out/callx-r10-sbfv1.so and /dev/null differ diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index 4df464cdfea6ff..915dfb65bf5e00 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -11917,13 +11917,15 @@ fn test_feature_activation_loaded_programs_cache_preparation_phase() { let (mut genesis_config, mint_keypair) = create_genesis_config(1_000_000 * LAMPORTS_PER_SOL); genesis_config .accounts - .remove(&feature_set::reject_callx_r10::id()); + .remove(&feature_set::disable_sbpf_v1_execution::id()); + genesis_config + .accounts + .remove(&feature_set::reenable_sbpf_v1_execution::id()); let (root_bank, bank_forks) = Bank::new_with_bank_forks_for_tests(&genesis_config); // Program Setup let program_keypair = Keypair::new(); - let program_data = - include_bytes!("../../../programs/bpf_loader/test_elfs/out/callx-r10-sbfv1.so"); + let program_data = include_bytes!("../../../programs/bpf_loader/test_elfs/out/noop_aligned.so"); let program_account = AccountSharedData::from(Account { lamports: Rent::default().minimum_balance(program_data.len()).min(1), data: program_data.to_vec(), @@ -11946,19 +11948,13 @@ fn test_feature_activation_loaded_programs_cache_preparation_phase() { // Load the program with the old environment. let transaction = Transaction::new(&signers, message.clone(), bank.last_blockhash()); let result_without_feature_enabled = bank.process_transaction(&transaction); - assert_eq!( - result_without_feature_enabled, - Err(TransactionError::InstructionError( - 0, - InstructionError::ProgramFailedToComplete - )) - ); + assert_eq!(result_without_feature_enabled, Ok(())); // Schedule feature activation to trigger a change of environment at the epoch boundary. let feature_account_balance = std::cmp::max(genesis_config.rent.minimum_balance(Feature::size_of()), 1); bank.store_account( - &feature_set::reject_callx_r10::id(), + &feature_set::disable_sbpf_v1_execution::id(), &feature::create_account(&Feature { activated_at: None }, feature_account_balance), ); @@ -12030,7 +12026,10 @@ fn test_feature_activation_loaded_programs_epoch_transition() { let (mut genesis_config, mint_keypair) = create_genesis_config(1_000_000 * LAMPORTS_PER_SOL); genesis_config .accounts - .remove(&feature_set::reject_callx_r10::id()); + .remove(&feature_set::disable_fees_sysvar::id()); + genesis_config + .accounts + .remove(&feature_set::reenable_sbpf_v1_execution::id()); let (root_bank, bank_forks) = Bank::new_with_bank_forks_for_tests(&genesis_config); // Program Setup @@ -12063,7 +12062,7 @@ fn test_feature_activation_loaded_programs_epoch_transition() { let feature_account_balance = std::cmp::max(genesis_config.rent.minimum_balance(Feature::size_of()), 1); bank.store_account( - &feature_set::reject_callx_r10::id(), + &feature_set::disable_fees_sysvar::id(), &feature::create_account(&Feature { activated_at: None }, feature_account_balance), ); @@ -12999,9 +12998,9 @@ fn test_deploy_last_epoch_slot() { let (mut genesis_config, mint_keypair) = create_genesis_config(1_000_000 * LAMPORTS_PER_SOL); genesis_config .accounts - .remove(&feature_set::reject_callx_r10::id()); + .remove(&feature_set::disable_fees_sysvar::id()); let mut bank = Bank::new_for_tests(&genesis_config); - bank.activate_feature(&feature_set::reject_callx_r10::id()); + bank.activate_feature(&feature_set::disable_fees_sysvar::id()); // go to the last slot in the epoch let (bank, bank_forks) = bank.wrap_with_bank_forks_for_tests();