Skip to content

Commit

Permalink
Cleanup - Feature gate of limit_max_instruction_trace_length (solan…
Browse files Browse the repository at this point in the history
…a-labs#34085)

Cleans up feature gate of limit_max_instruction_trace_length.
  • Loading branch information
Lichtso authored Nov 15, 2023
1 parent 48ed70a commit d93280c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
17 changes: 3 additions & 14 deletions programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ 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,
loader_upgradeable_instruction::UpgradeableLoaderInstruction,
native_loader,
program_error::MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED,
program_utils::limited_deserialize,
pubkey::Pubkey,
saturating_add_assign,
Expand Down Expand Up @@ -1596,17 +1595,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 d93280c

Please sign in to comment.