Skip to content

Commit c3dc5c9

Browse files
devin-ai-integration[bot]Jayant Krishnamurthy
andcommitted
feat: replace hardcoded gas ceiling with configurable cap in process_event
Co-Authored-By: Jayant Krishnamurthy <[email protected]>
1 parent a9046d2 commit c3dc5c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/fortuna/src/keeper.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,9 @@ pub async fn process_event(
540540
// Pad the gas estimate after checking it against the simulation gas limit, ensuring that
541541
// the padded gas estimate doesn't exceed the maximum amount of gas we are willing to use.
542542
let gas_estimate = gas_estimate.saturating_mul(gas_estimate_multiplier_pct.into()) / 100;
543-
let gas_estimate = gas_estimate.min((gas_limit * DEFAULT_GAS_ESTIMATE_MULTIPLIER_PCT) / 100);
543+
// Apply the configurable cap from backoff_gas_multiplier_cap_pct
544+
let max_gas_estimate = gas_limit.saturating_mul(chain_config.backoff_gas_multiplier_cap_pct.into()) / 100;
545+
let gas_estimate = gas_estimate.min(max_gas_estimate);
544546

545547
let contract_call = contract
546548
.reveal_with_callback(

0 commit comments

Comments
 (0)