Skip to content

Commit

Permalink
Cleans up feature gate of limit_max_instruction_trace_length.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Nov 15, 2023
1 parent f005075 commit 4fcbce2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
16 changes: 3 additions & 13 deletions programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ use {
feature_set::{
bpf_account_data_direct_mapping, delay_visibility_of_program_deployment,
enable_bpf_loader_extend_program_ix, enable_bpf_loader_set_authority_checked_ix,
enable_program_redeployment_cooldown, limit_max_instruction_trace_length,
native_programs_consume_cu, remove_bpf_loader_incorrect_program_id,
enable_program_redeployment_cooldown, native_programs_consume_cu,
remove_bpf_loader_incorrect_program_id,
},
instruction::{AccountMeta, InstructionError},
loader_instruction::LoaderInstruction,
Expand Down Expand Up @@ -1596,17 +1596,7 @@ fn execute<'a, 'b: 'a>(
}
match result {
ProgramResult::Ok(status) if status != SUCCESS => {
let error: InstructionError = if status == MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED
&& !invoke_context
.feature_set
.is_active(&limit_max_instruction_trace_length::id())
{
// Until the limit_max_instruction_trace_length feature is
// enabled, map the `MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED` error to `InvalidError`.
InstructionError::InvalidError
} else {
status.into()
};
let error: InstructionError = status.into();
Err(Box::new(error) as Box<dyn std::error::Error>)
}
ProgramResult::Err(mut error) => {
Expand Down
9 changes: 1 addition & 8 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4889,14 +4889,7 @@ impl Bank {
transaction_accounts,
self.rent_collector.rent,
compute_budget.max_invoke_stack_height,
if self
.feature_set
.is_active(&feature_set::limit_max_instruction_trace_length::id())
{
compute_budget.max_instruction_trace_length
} else {
std::usize::MAX
},
compute_budget.max_instruction_trace_length,
);
#[cfg(debug_assertions)]
transaction_context.set_signature(tx.signature());
Expand Down

0 comments on commit 4fcbce2

Please sign in to comment.