|
4 | 4 | ahash::{AHashMap, AHashSet}, |
5 | 5 | solana_epoch_schedule::EpochSchedule, |
6 | 6 | solana_hash::Hash, |
7 | | - solana_program_runtime::invoke_context::RuntimeFeatures, |
8 | 7 | solana_pubkey::Pubkey, |
9 | 8 | solana_sha256_hasher::Hasher, |
| 9 | + solana_svm_feature_set::SVMFeatureSet, |
10 | 10 | std::sync::LazyLock, |
11 | 11 | }; |
12 | 12 |
|
@@ -100,62 +100,58 @@ impl FeatureSet { |
100 | 100 | .map(|slot| epoch_schedule.get_epoch(slot)) |
101 | 101 | } |
102 | 102 |
|
103 | | - pub fn runtime_features(&self) -> RuntimeFeatures { |
104 | | - RuntimeFeatures { |
105 | | - lift_cpi_caller_restriction: self.activated_slot(&lift_cpi_caller_restriction::id()), |
| 103 | + pub fn runtime_features(&self) -> SVMFeatureSet { |
| 104 | + SVMFeatureSet { |
| 105 | + lift_cpi_caller_restriction: self.is_active(&lift_cpi_caller_restriction::id()), |
106 | 106 | move_precompile_verification_to_svm: self |
107 | | - .activated_slot(&move_precompile_verification_to_svm::id()), |
| 107 | + .is_active(&move_precompile_verification_to_svm::id()), |
108 | 108 | remove_accounts_executable_flag_checks: self |
109 | | - .activated_slot(&remove_accounts_executable_flag_checks::id()), |
110 | | - bpf_account_data_direct_mapping: self |
111 | | - .activated_slot(&bpf_account_data_direct_mapping::id()), |
| 109 | + .is_active(&remove_accounts_executable_flag_checks::id()), |
| 110 | + bpf_account_data_direct_mapping: self.is_active(&bpf_account_data_direct_mapping::id()), |
112 | 111 | enable_bpf_loader_set_authority_checked_ix: self |
113 | | - .activated_slot(&enable_bpf_loader_set_authority_checked_ix::id()), |
114 | | - enable_loader_v4: self.activated_slot(&enable_loader_v4::id()), |
115 | | - deplete_cu_meter_on_vm_failure: self |
116 | | - .activated_slot(&deplete_cu_meter_on_vm_failure::id()), |
117 | | - abort_on_invalid_curve: self.activated_slot(&abort_on_invalid_curve::id()), |
118 | | - blake3_syscall_enabled: self.activated_slot(&blake3_syscall_enabled::id()), |
119 | | - curve25519_syscall_enabled: self.activated_slot(&curve25519_syscall_enabled::id()), |
| 112 | + .is_active(&enable_bpf_loader_set_authority_checked_ix::id()), |
| 113 | + enable_loader_v4: self.is_active(&enable_loader_v4::id()), |
| 114 | + deplete_cu_meter_on_vm_failure: self.is_active(&deplete_cu_meter_on_vm_failure::id()), |
| 115 | + abort_on_invalid_curve: self.is_active(&abort_on_invalid_curve::id()), |
| 116 | + blake3_syscall_enabled: self.is_active(&blake3_syscall_enabled::id()), |
| 117 | + curve25519_syscall_enabled: self.is_active(&curve25519_syscall_enabled::id()), |
120 | 118 | disable_deploy_of_alloc_free_syscall: self |
121 | | - .activated_slot(&disable_deploy_of_alloc_free_syscall::id()), |
122 | | - disable_fees_sysvar: self.activated_slot(&disable_fees_sysvar::id()), |
123 | | - disable_sbpf_v0_execution: self.activated_slot(&disable_sbpf_v0_execution::id()), |
| 119 | + .is_active(&disable_deploy_of_alloc_free_syscall::id()), |
| 120 | + disable_fees_sysvar: self.is_active(&disable_fees_sysvar::id()), |
| 121 | + disable_sbpf_v0_execution: self.is_active(&disable_sbpf_v0_execution::id()), |
124 | 122 | enable_alt_bn128_compression_syscall: self |
125 | | - .activated_slot(&enable_alt_bn128_compression_syscall::id()), |
126 | | - enable_alt_bn128_syscall: self.activated_slot(&enable_alt_bn128_syscall::id()), |
127 | | - enable_big_mod_exp_syscall: self.activated_slot(&enable_big_mod_exp_syscall::id()), |
128 | | - enable_get_epoch_stake_syscall: self |
129 | | - .activated_slot(&enable_get_epoch_stake_syscall::id()), |
130 | | - enable_poseidon_syscall: self.activated_slot(&enable_poseidon_syscall::id()), |
| 123 | + .is_active(&enable_alt_bn128_compression_syscall::id()), |
| 124 | + enable_alt_bn128_syscall: self.is_active(&enable_alt_bn128_syscall::id()), |
| 125 | + enable_big_mod_exp_syscall: self.is_active(&enable_big_mod_exp_syscall::id()), |
| 126 | + enable_get_epoch_stake_syscall: self.is_active(&enable_get_epoch_stake_syscall::id()), |
| 127 | + enable_poseidon_syscall: self.is_active(&enable_poseidon_syscall::id()), |
131 | 128 | enable_sbpf_v1_deployment_and_execution: self |
132 | | - .activated_slot(&enable_sbpf_v1_deployment_and_execution::id()), |
| 129 | + .is_active(&enable_sbpf_v1_deployment_and_execution::id()), |
133 | 130 | enable_sbpf_v2_deployment_and_execution: self |
134 | | - .activated_slot(&enable_sbpf_v2_deployment_and_execution::id()), |
| 131 | + .is_active(&enable_sbpf_v2_deployment_and_execution::id()), |
135 | 132 | enable_sbpf_v3_deployment_and_execution: self |
136 | | - .activated_slot(&enable_sbpf_v3_deployment_and_execution::id()), |
137 | | - get_sysvar_syscall_enabled: self.activated_slot(&get_sysvar_syscall_enabled::id()), |
138 | | - last_restart_slot_sysvar: self.activated_slot(&last_restart_slot_sysvar::id()), |
139 | | - reenable_sbpf_v0_execution: self.activated_slot(&reenable_sbpf_v0_execution::id()), |
| 133 | + .is_active(&enable_sbpf_v3_deployment_and_execution::id()), |
| 134 | + get_sysvar_syscall_enabled: self.is_active(&get_sysvar_syscall_enabled::id()), |
| 135 | + last_restart_slot_sysvar: self.is_active(&last_restart_slot_sysvar::id()), |
| 136 | + reenable_sbpf_v0_execution: self.is_active(&reenable_sbpf_v0_execution::id()), |
140 | 137 | remaining_compute_units_syscall_enabled: self |
141 | | - .activated_slot(&remaining_compute_units_syscall_enabled::id()), |
| 138 | + .is_active(&remaining_compute_units_syscall_enabled::id()), |
142 | 139 | remove_bpf_loader_incorrect_program_id: self |
143 | | - .activated_slot(&remove_bpf_loader_incorrect_program_id::id()), |
| 140 | + .is_active(&remove_bpf_loader_incorrect_program_id::id()), |
144 | 141 | move_stake_and_move_lamports_ixs: self |
145 | | - .activated_slot(&move_stake_and_move_lamports_ixs::id()), |
| 142 | + .is_active(&move_stake_and_move_lamports_ixs::id()), |
146 | 143 | stake_raise_minimum_delegation_to_1_sol: self |
147 | | - .activated_slot(&stake_raise_minimum_delegation_to_1_sol::id()), |
148 | | - deprecate_legacy_vote_ixs: self.activated_slot(&deprecate_legacy_vote_ixs::id()), |
| 144 | + .is_active(&stake_raise_minimum_delegation_to_1_sol::id()), |
| 145 | + deprecate_legacy_vote_ixs: self.is_active(&deprecate_legacy_vote_ixs::id()), |
149 | 146 | mask_out_rent_epoch_in_vm_serialization: self |
150 | | - .activated_slot(&mask_out_rent_epoch_in_vm_serialization::id()), |
| 147 | + .is_active(&mask_out_rent_epoch_in_vm_serialization::id()), |
151 | 148 | simplify_alt_bn128_syscall_error_codes: self |
152 | | - .activated_slot(&simplify_alt_bn128_syscall_error_codes::id()), |
| 149 | + .is_active(&simplify_alt_bn128_syscall_error_codes::id()), |
153 | 150 | fix_alt_bn128_multiplication_input_length: self |
154 | | - .activated_slot(&fix_alt_bn128_multiplication_input_length::id()), |
155 | | - loosen_cpi_size_restriction: self.activated_slot(&loosen_cpi_size_restriction::id()), |
156 | | - increase_tx_account_lock_limit: self |
157 | | - .activated_slot(&increase_tx_account_lock_limit::id()), |
158 | | - disable_rent_fees_collection: self.activated_slot(&disable_rent_fees_collection::id()), |
| 151 | + .is_active(&fix_alt_bn128_multiplication_input_length::id()), |
| 152 | + loosen_cpi_size_restriction: self.is_active(&loosen_cpi_size_restriction::id()), |
| 153 | + increase_tx_account_lock_limit: self.is_active(&increase_tx_account_lock_limit::id()), |
| 154 | + disable_rent_fees_collection: self.is_active(&disable_rent_fees_collection::id()), |
159 | 155 | } |
160 | 156 | } |
161 | 157 | } |
|
0 commit comments