Revert "Feature gates for rbpf v0.2.16 (#21590)"

This reverts commit 6777ca244f.
This commit is contained in:
Trent Nelson
2021-12-13 08:48:38 -07:00
committed by Tao Zhu
parent 3369826bd1
commit e68cd335d5
5 changed files with 5 additions and 27 deletions

View File

@@ -35,8 +35,7 @@ use {
feature_set::{
add_missing_program_error_mappings, close_upgradeable_program_accounts,
fix_write_privs, reduce_required_deploy_balance,
reject_deployment_of_unresolved_syscalls,
reject_section_virtual_address_file_offset_mismatch, start_verify_shift32_imm,
reject_deployment_of_unresolved_syscalls, requestable_heap_size,
stop_verify_mul64_imm_nonzero, upgradeable_close_instruction,
},
ic_logger_msg, ic_msg,
@@ -81,7 +80,7 @@ pub fn create_executor(
program_data_offset: usize,
invoke_context: &mut dyn InvokeContext,
use_jit: bool,
reject_deployment_of_broken_elfs: bool,
reject_unresolved_syscalls: bool,
) -> Result<Arc<BpfExecutor>, InstructionError> {
let syscall_registry = syscalls::register_syscalls(invoke_context).map_err(|e| {
ic_msg!(invoke_context, "Failed to register syscalls: {}", e);
@@ -92,14 +91,10 @@ pub fn create_executor(
max_call_depth: bpf_compute_budget.max_call_depth,
stack_frame_size: bpf_compute_budget.stack_frame_size,
enable_instruction_tracing: log_enabled!(Trace),
reject_unresolved_syscalls: reject_deployment_of_broken_elfs
reject_unresolved_syscalls: reject_unresolved_syscalls
&& invoke_context.is_feature_active(&reject_deployment_of_unresolved_syscalls::id()),
reject_section_virtual_address_file_offset_mismatch: reject_deployment_of_broken_elfs
&& invoke_context
.is_feature_active(&reject_section_virtual_address_file_offset_mismatch::id()),
verify_mul64_imm_nonzero: !invoke_context
.is_feature_active(&stop_verify_mul64_imm_nonzero::id()),
verify_shift32_imm: invoke_context.is_feature_active(&start_verify_shift32_imm::id()),
.is_feature_active(&stop_verify_mul64_imm_nonzero::id()), // TODO: Feature gate and then remove me
..Config::default()
};
let mut executable = {