Cleanup - Feature gate of `limit_max_instruction_trace_length` (#34085)
Cleans up feature gate of limit_max_instruction_trace_length.
This commit is contained in:
parent
48ed70a8d8
commit
d93280c287
|
@ -36,14 +36,13 @@ use {
|
||||||
feature_set::{
|
feature_set::{
|
||||||
bpf_account_data_direct_mapping, delay_visibility_of_program_deployment,
|
bpf_account_data_direct_mapping, delay_visibility_of_program_deployment,
|
||||||
enable_bpf_loader_extend_program_ix, enable_bpf_loader_set_authority_checked_ix,
|
enable_bpf_loader_extend_program_ix, enable_bpf_loader_set_authority_checked_ix,
|
||||||
enable_program_redeployment_cooldown, limit_max_instruction_trace_length,
|
enable_program_redeployment_cooldown, native_programs_consume_cu,
|
||||||
native_programs_consume_cu, remove_bpf_loader_incorrect_program_id,
|
remove_bpf_loader_incorrect_program_id,
|
||||||
},
|
},
|
||||||
instruction::{AccountMeta, InstructionError},
|
instruction::{AccountMeta, InstructionError},
|
||||||
loader_instruction::LoaderInstruction,
|
loader_instruction::LoaderInstruction,
|
||||||
loader_upgradeable_instruction::UpgradeableLoaderInstruction,
|
loader_upgradeable_instruction::UpgradeableLoaderInstruction,
|
||||||
native_loader,
|
native_loader,
|
||||||
program_error::MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED,
|
|
||||||
program_utils::limited_deserialize,
|
program_utils::limited_deserialize,
|
||||||
pubkey::Pubkey,
|
pubkey::Pubkey,
|
||||||
saturating_add_assign,
|
saturating_add_assign,
|
||||||
|
@ -1596,17 +1595,7 @@ fn execute<'a, 'b: 'a>(
|
||||||
}
|
}
|
||||||
match result {
|
match result {
|
||||||
ProgramResult::Ok(status) if status != SUCCESS => {
|
ProgramResult::Ok(status) if status != SUCCESS => {
|
||||||
let error: InstructionError = if status == MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED
|
let error: InstructionError = status.into();
|
||||||
&& !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()
|
|
||||||
};
|
|
||||||
Err(Box::new(error) as Box<dyn std::error::Error>)
|
Err(Box::new(error) as Box<dyn std::error::Error>)
|
||||||
}
|
}
|
||||||
ProgramResult::Err(mut error) => {
|
ProgramResult::Err(mut error) => {
|
||||||
|
|
|
@ -4889,14 +4889,7 @@ impl Bank {
|
||||||
transaction_accounts,
|
transaction_accounts,
|
||||||
self.rent_collector.rent,
|
self.rent_collector.rent,
|
||||||
compute_budget.max_invoke_stack_height,
|
compute_budget.max_invoke_stack_height,
|
||||||
if self
|
compute_budget.max_instruction_trace_length,
|
||||||
.feature_set
|
|
||||||
.is_active(&feature_set::limit_max_instruction_trace_length::id())
|
|
||||||
{
|
|
||||||
compute_budget.max_instruction_trace_length
|
|
||||||
} else {
|
|
||||||
std::usize::MAX
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
transaction_context.set_signature(tx.signature());
|
transaction_context.set_signature(tx.signature());
|
||||||
|
|
Loading…
Reference in New Issue