diff --git a/program-runtime/src/invoke_context.rs b/program-runtime/src/invoke_context.rs index 6e47e2622a65fc..6f11dd058c592d 100644 --- a/program-runtime/src/invoke_context.rs +++ b/program-runtime/src/invoke_context.rs @@ -555,7 +555,7 @@ impl<'a> InvokeContext<'a> { // For now, only built-ins are invoked from here, so the VM and its Config are irrelevant. let mock_config = Config::default(); let empty_memory_mapping = - MemoryMapping::new(Vec::new(), &mock_config, SBPFVersion::V1).unwrap(); + MemoryMapping::new(Vec::new(), &mock_config, SBPFVersion::V0).unwrap(); let mut vm = EbpfVm::new( self.program_cache_for_tx_batch .environments diff --git a/programs/bpf_loader/src/syscalls/mod.rs b/programs/bpf_loader/src/syscalls/mod.rs index 4281d43054fb88..c1f60fb67e2894 100644 --- a/programs/bpf_loader/src/syscalls/mod.rs +++ b/programs/bpf_loader/src/syscalls/mod.rs @@ -306,6 +306,7 @@ pub fn create_program_runtime_environment_v1<'a>( } else { SBPFVersion::V0 }; + debug_assert!(min_sbpf_version <= max_sbpf_version); let config = Config { max_call_depth: compute_budget.max_call_depth, diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index a03674a2231424..2005cd5e23a4f1 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -12084,14 +12084,13 @@ fn test_feature_activation_loaded_programs_cache_preparation_phase() { solana_logger::setup(); // Bank Setup - let (mut genesis_config, mint_keypair) = create_genesis_config(1_000_000 * LAMPORTS_PER_SOL); - genesis_config - .accounts - .remove(&feature_set::disable_sbpf_v0_execution::id()); - genesis_config - .accounts - .remove(&feature_set::reenable_sbpf_v0_execution::id()); - let (root_bank, bank_forks) = Bank::new_with_bank_forks_for_tests(&genesis_config); + let (genesis_config, mint_keypair) = create_genesis_config(1_000_000 * LAMPORTS_PER_SOL); + let mut bank = Bank::new_for_tests(&genesis_config); + let mut feature_set = FeatureSet::all_enabled(); + feature_set.deactivate(&feature_set::disable_sbpf_v0_execution::id()); + feature_set.deactivate(&feature_set::reenable_sbpf_v0_execution::id()); + bank.feature_set = Arc::new(feature_set); + let (root_bank, bank_forks) = bank.wrap_with_bank_forks_for_tests(); // Program Setup let program_keypair = Keypair::new(); @@ -12183,7 +12182,7 @@ fn test_feature_activation_loaded_programs_cache_preparation_phase() { result_with_feature_enabled, Err(TransactionError::InstructionError( 0, - InstructionError::InvalidAccountData + InstructionError::UnsupportedProgramId )) ); }