Skip to content

Commit

Permalink
Removes the feature reject_callx_r10 from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Sep 11, 2024
1 parent d22d5b7 commit 4efa301
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
10 changes: 6 additions & 4 deletions programs/bpf_loader/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()),
Expand Down
Binary file not shown.
29 changes: 14 additions & 15 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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),
);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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),
);

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 4efa301

Please sign in to comment.