Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Dec 17, 2024
1 parent 4c3ccdd commit 6942356
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions programs/bpf_loader/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
17 changes: 8 additions & 9 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
))
);
}
Expand Down

0 comments on commit 6942356

Please sign in to comment.