Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps solana-sbpf to v0.9.0 #3830

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
};
Copy link

@LucasSte LucasSte Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a debug assert here to prevent min_sbpf_version from being greater than the max_sbpf_version.

I know we plan on enabling enable_sbpf_v3_deployment_and_execution before activating disable_sbpf_v0_execution, but any case different than that should error out (at least in debug mode).

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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling all features with let mut feature_set = FeatureSet::all_enabled(); did also activate remove_accounts_executable_flag_checks which changes the error message here.

))
);
}
Expand Down
Loading