diff --git a/cost-model/src/cost_model.rs b/cost-model/src/cost_model.rs index 1a5501ab6ce179..5a817670b7b744 100644 --- a/cost-model/src/cost_model.rs +++ b/cost-model/src/cost_model.rs @@ -128,7 +128,6 @@ impl CostModel { let enable_request_heap_frame_ix = true; let result = compute_budget.process_instructions( transaction.message().program_instructions_iter(), - true, // default_units_per_instruction has enabled in MNB !feature_set.is_active(&remove_deprecated_request_unit_ix::id()), enable_request_heap_frame_ix, feature_set.is_active(&add_set_tx_loaded_accounts_data_size_instruction::id()), diff --git a/program-runtime/src/compute_budget.rs b/program-runtime/src/compute_budget.rs index 9045229f5b8c7f..3664a3046bcfa1 100644 --- a/program-runtime/src/compute_budget.rs +++ b/program-runtime/src/compute_budget.rs @@ -6,7 +6,7 @@ use { entrypoint::HEAP_LENGTH as MIN_HEAP_FRAME_BYTES, feature_set::{ add_set_tx_loaded_accounts_data_size_instruction, enable_request_heap_frame_ix, - remove_deprecated_request_unit_ix, use_default_units_in_fee_calculation, FeatureSet, + remove_deprecated_request_unit_ix, FeatureSet, }, fee::FeeBudgetLimits, genesis_config::ClusterType, @@ -177,7 +177,6 @@ impl ComputeBudget { pub fn process_instructions<'a>( &mut self, instructions: impl Iterator, - default_units_per_instruction: bool, support_request_units_deprecated: bool, enable_request_heap_frame_ix: bool, support_set_loaded_accounts_data_size_limit_ix: bool, @@ -261,18 +260,12 @@ impl ComputeBudget { self.heap_size = Some(bytes as usize); } - let compute_unit_limit = if default_units_per_instruction { - updated_compute_unit_limit.or_else(|| { - Some( - num_non_compute_budget_instructions - .saturating_mul(DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT), - ) + let compute_unit_limit = updated_compute_unit_limit + .unwrap_or_else(|| { + num_non_compute_budget_instructions + .saturating_mul(DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT) }) - } else { - updated_compute_unit_limit - } - .unwrap_or(MAX_COMPUTE_UNIT_LIMIT) - .min(MAX_COMPUTE_UNIT_LIMIT); + .min(MAX_COMPUTE_UNIT_LIMIT); self.compute_unit_limit = u64::from(compute_unit_limit); self.loaded_accounts_data_size_limit = updated_loaded_accounts_data_size_limit @@ -302,7 +295,6 @@ impl ComputeBudget { let prioritization_fee_details = compute_budget .process_instructions( instructions, - feature_set.is_active(&use_default_units_in_fee_calculation::id()), !feature_set.is_active(&remove_deprecated_request_unit_ix::id()), enable_request_heap_frame_ix, feature_set.is_active(&add_set_tx_loaded_accounts_data_size_instruction::id()), @@ -345,7 +337,6 @@ mod tests { let mut compute_budget = ComputeBudget::default(); let result = compute_budget.process_instructions( tx.message().program_instructions_iter(), - true, false, /*not support request_units_deprecated*/ $enable_request_heap_frame_ix, $support_set_loaded_accounts_data_size_limit_ix, @@ -895,7 +886,6 @@ mod tests { let mut compute_budget = ComputeBudget::default(); let result = compute_budget.process_instructions( transaction.message().program_instructions_iter(), - true, false, //not support request_units_deprecated true, //enable_request_heap_frame_ix, true, //support_set_loaded_accounts_data_size_limit_ix, diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index 390046e21bbc46..5b07d212e447f0 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -251,7 +251,6 @@ impl Accounts { ComputeBudget::new(compute_budget::MAX_COMPUTE_UNIT_LIMIT as u64); let _process_transaction_result = compute_budget.process_instructions( tx.message().program_instructions_iter(), - true, // default_units_per_instruction has enabled in MNB !feature_set.is_active(&remove_deprecated_request_unit_ix::id()), true, // don't reject txs that use request heap size ix feature_set.is_active(&add_set_tx_loaded_accounts_data_size_instruction::id()), diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 09dee0a2ee4c53..8309c51a53b509 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -5084,7 +5084,6 @@ impl Bank { Measure::start("compute_budget_process_transaction_time"); let process_transaction_result = compute_budget.process_instructions( tx.message().program_instructions_iter(), - true, !self .feature_set .is_active(&remove_deprecated_request_unit_ix::id()), diff --git a/runtime/src/transaction_priority_details.rs b/runtime/src/transaction_priority_details.rs index 096147e04b4004..08cbefd3280b93 100644 --- a/runtime/src/transaction_priority_details.rs +++ b/runtime/src/transaction_priority_details.rs @@ -27,7 +27,6 @@ pub trait GetTransactionPriorityDetails { let prioritization_fee_details = compute_budget .process_instructions( instructions, - true, // use default units per instruction true, // supports prioritization by request_units_deprecated instruction true, // enable request heap frame instruction true, // enable support set accounts data size instruction