test-validator: Always use overridden compute budget in bank (#25128)

This commit is contained in:
Jon Cinque 2022-05-11 15:46:51 +02:00 committed by GitHub
parent 766e361111
commit 542a14d9b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 26 deletions

View File

@ -4372,15 +4372,16 @@ impl Bank {
feature_set_clone_time.as_us()
);
let compute_budget = if let Some(compute_budget) = self.compute_budget {
compute_budget
} else {
let tx_wide_compute_cap = feature_set.is_active(&tx_wide_compute_cap::id());
let compute_budget_max_units = if tx_wide_compute_cap {
compute_budget::MAX_UNITS
} else {
compute_budget::DEFAULT_UNITS
};
let mut compute_budget = self
.compute_budget
.unwrap_or_else(|| ComputeBudget::new(compute_budget_max_units));
let mut compute_budget = ComputeBudget::new(compute_budget_max_units);
if tx_wide_compute_cap {
let mut compute_budget_process_transaction_time =
Measure::start("compute_budget_process_transaction_time");
@ -4400,6 +4401,8 @@ impl Bank {
return TransactionExecutionResult::NotExecuted(err);
}
}
compute_budget
};
self.execute_loaded_transaction(
tx,