@@ -161,6 +161,172 @@ impl FeatureSet {
161
161
}
162
162
}
163
163
164
+ impl From < & SVMFeatureSet > for FeatureSet {
165
+ fn from ( svm_features : & SVMFeatureSet ) -> Self {
166
+ let mut active = AHashMap :: new ( ) ;
167
+ let mut inactive = AHashSet :: from_iter ( ( * FEATURE_NAMES ) . keys ( ) . cloned ( ) ) ;
168
+
169
+ let mut activate_if = |enabled : & bool , feature_id : Pubkey | {
170
+ if * enabled {
171
+ inactive. remove ( & feature_id) ;
172
+ active. insert ( feature_id, 0 ) ;
173
+ }
174
+ } ;
175
+
176
+ let SVMFeatureSet {
177
+ move_precompile_verification_to_svm,
178
+ stricter_abi_and_runtime_constraints,
179
+ enable_bpf_loader_set_authority_checked_ix,
180
+ enable_loader_v4,
181
+ deplete_cu_meter_on_vm_failure,
182
+ abort_on_invalid_curve,
183
+ blake3_syscall_enabled,
184
+ curve25519_syscall_enabled,
185
+ disable_deploy_of_alloc_free_syscall,
186
+ disable_fees_sysvar,
187
+ disable_sbpf_v0_execution,
188
+ enable_alt_bn128_compression_syscall,
189
+ enable_alt_bn128_syscall,
190
+ enable_big_mod_exp_syscall,
191
+ enable_get_epoch_stake_syscall,
192
+ enable_poseidon_syscall,
193
+ enable_sbpf_v1_deployment_and_execution,
194
+ enable_sbpf_v2_deployment_and_execution,
195
+ enable_sbpf_v3_deployment_and_execution,
196
+ get_sysvar_syscall_enabled,
197
+ last_restart_slot_sysvar,
198
+ reenable_sbpf_v0_execution,
199
+ remaining_compute_units_syscall_enabled,
200
+ remove_bpf_loader_incorrect_program_id,
201
+ move_stake_and_move_lamports_ixs,
202
+ stake_raise_minimum_delegation_to_1_sol,
203
+ deprecate_legacy_vote_ixs,
204
+ mask_out_rent_epoch_in_vm_serialization,
205
+ simplify_alt_bn128_syscall_error_codes,
206
+ fix_alt_bn128_multiplication_input_length,
207
+ loosen_cpi_size_restriction,
208
+ increase_tx_account_lock_limit,
209
+ enable_extend_program_checked,
210
+ formalize_loaded_transaction_data_size,
211
+ disable_zk_elgamal_proof_program,
212
+ reenable_zk_elgamal_proof_program,
213
+ raise_cpi_nesting_limit_to_8,
214
+ } = svm_features;
215
+
216
+ activate_if (
217
+ move_precompile_verification_to_svm,
218
+ move_precompile_verification_to_svm:: id ( ) ,
219
+ ) ;
220
+ activate_if (
221
+ stricter_abi_and_runtime_constraints,
222
+ stricter_abi_and_runtime_constraints:: id ( ) ,
223
+ ) ;
224
+ activate_if (
225
+ enable_bpf_loader_set_authority_checked_ix,
226
+ enable_bpf_loader_set_authority_checked_ix:: id ( ) ,
227
+ ) ;
228
+ activate_if ( enable_loader_v4, enable_loader_v4:: id ( ) ) ;
229
+ activate_if (
230
+ deplete_cu_meter_on_vm_failure,
231
+ deplete_cu_meter_on_vm_failure:: id ( ) ,
232
+ ) ;
233
+ activate_if ( abort_on_invalid_curve, abort_on_invalid_curve:: id ( ) ) ;
234
+ activate_if ( blake3_syscall_enabled, blake3_syscall_enabled:: id ( ) ) ;
235
+ activate_if ( curve25519_syscall_enabled, curve25519_syscall_enabled:: id ( ) ) ;
236
+ activate_if (
237
+ disable_deploy_of_alloc_free_syscall,
238
+ disable_deploy_of_alloc_free_syscall:: id ( ) ,
239
+ ) ;
240
+ activate_if ( disable_fees_sysvar, disable_fees_sysvar:: id ( ) ) ;
241
+ activate_if ( disable_sbpf_v0_execution, disable_sbpf_v0_execution:: id ( ) ) ;
242
+ activate_if (
243
+ enable_alt_bn128_compression_syscall,
244
+ enable_alt_bn128_compression_syscall:: id ( ) ,
245
+ ) ;
246
+ activate_if ( enable_alt_bn128_syscall, enable_alt_bn128_syscall:: id ( ) ) ;
247
+ activate_if ( enable_big_mod_exp_syscall, enable_big_mod_exp_syscall:: id ( ) ) ;
248
+ activate_if (
249
+ enable_get_epoch_stake_syscall,
250
+ enable_get_epoch_stake_syscall:: id ( ) ,
251
+ ) ;
252
+ activate_if ( enable_poseidon_syscall, enable_poseidon_syscall:: id ( ) ) ;
253
+ activate_if (
254
+ enable_sbpf_v1_deployment_and_execution,
255
+ enable_sbpf_v1_deployment_and_execution:: id ( ) ,
256
+ ) ;
257
+ activate_if (
258
+ enable_sbpf_v2_deployment_and_execution,
259
+ enable_sbpf_v2_deployment_and_execution:: id ( ) ,
260
+ ) ;
261
+ activate_if (
262
+ enable_sbpf_v3_deployment_and_execution,
263
+ enable_sbpf_v3_deployment_and_execution:: id ( ) ,
264
+ ) ;
265
+ activate_if ( get_sysvar_syscall_enabled, get_sysvar_syscall_enabled:: id ( ) ) ;
266
+ activate_if ( last_restart_slot_sysvar, last_restart_slot_sysvar:: id ( ) ) ;
267
+ activate_if ( reenable_sbpf_v0_execution, reenable_sbpf_v0_execution:: id ( ) ) ;
268
+ activate_if (
269
+ remaining_compute_units_syscall_enabled,
270
+ remaining_compute_units_syscall_enabled:: id ( ) ,
271
+ ) ;
272
+ activate_if (
273
+ remove_bpf_loader_incorrect_program_id,
274
+ remove_bpf_loader_incorrect_program_id:: id ( ) ,
275
+ ) ;
276
+ activate_if (
277
+ move_stake_and_move_lamports_ixs,
278
+ move_stake_and_move_lamports_ixs:: id ( ) ,
279
+ ) ;
280
+ activate_if (
281
+ stake_raise_minimum_delegation_to_1_sol,
282
+ stake_raise_minimum_delegation_to_1_sol:: id ( ) ,
283
+ ) ;
284
+ activate_if ( deprecate_legacy_vote_ixs, deprecate_legacy_vote_ixs:: id ( ) ) ;
285
+ activate_if (
286
+ mask_out_rent_epoch_in_vm_serialization,
287
+ mask_out_rent_epoch_in_vm_serialization:: id ( ) ,
288
+ ) ;
289
+ activate_if (
290
+ simplify_alt_bn128_syscall_error_codes,
291
+ simplify_alt_bn128_syscall_error_codes:: id ( ) ,
292
+ ) ;
293
+ activate_if (
294
+ fix_alt_bn128_multiplication_input_length,
295
+ fix_alt_bn128_multiplication_input_length:: id ( ) ,
296
+ ) ;
297
+ activate_if (
298
+ loosen_cpi_size_restriction,
299
+ loosen_cpi_size_restriction:: id ( ) ,
300
+ ) ;
301
+ activate_if (
302
+ increase_tx_account_lock_limit,
303
+ increase_tx_account_lock_limit:: id ( ) ,
304
+ ) ;
305
+ activate_if (
306
+ enable_extend_program_checked,
307
+ enable_extend_program_checked:: id ( ) ,
308
+ ) ;
309
+ activate_if (
310
+ formalize_loaded_transaction_data_size,
311
+ formalize_loaded_transaction_data_size:: id ( ) ,
312
+ ) ;
313
+ activate_if (
314
+ disable_zk_elgamal_proof_program,
315
+ disable_zk_elgamal_proof_program:: id ( ) ,
316
+ ) ;
317
+ activate_if (
318
+ reenable_zk_elgamal_proof_program,
319
+ reenable_zk_elgamal_proof_program:: id ( ) ,
320
+ ) ;
321
+ activate_if (
322
+ raise_cpi_nesting_limit_to_8,
323
+ raise_cpi_nesting_limit_to_8:: id ( ) ,
324
+ ) ;
325
+
326
+ Self { active, inactive }
327
+ }
328
+ }
329
+
164
330
pub mod deprecate_rewards_sysvar {
165
331
solana_pubkey:: declare_id!( "GaBtBJvmS4Arjj5W1NmFcyvPjsHN38UGYDq2MDwbs9Qu" ) ;
166
332
}
0 commit comments