openzeppelin_relayer::utils

Function get_resubmit_timeout_with_backoff

Source
pub fn get_resubmit_timeout_with_backoff(timeout: i64, attempts: usize) -> i64
Expand description

Calculates the resubmit age with exponential backoff

§Arguments

  • timeout - The base timeout in milliseconds
  • attempts - The number of attempts made so far

§Returns

The new timeout with exponential backoff applied: timeout * 2^(attempts-1)