Skip to content

Commit ec122b9

Browse files
devin-ai-integration[bot]Jayant Krishnamurthy
andcommitted
feat: apply gas multiplier cap in process_event_with_backoff
Co-Authored-By: Jayant Krishnamurthy <[email protected]>
1 parent c3dc5c9 commit ec122b9

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
@@ -434,8 +434,10 @@ pub async fn process_event_with_backoff(
434434
multiplier,
435435
e
436436
);
437+
// Calculate new multiplier with backoff, capped by backoff_gas_multiplier_cap_pct
438+
let new_multiplier = multiplier.saturating_mul(backoff_gas_multiplier_pct) / 100;
437439
current_multiplier.store(
438-
multiplier.saturating_mul(backoff_gas_multiplier_pct) / 100,
440+
std::cmp::min(new_multiplier, chain_state.backoff_gas_multiplier_cap_pct),
439441
std::sync::atomic::Ordering::Relaxed,
440442
);
441443
},

0 commit comments

Comments
 (0)