diff --git a/rust/main/chains/hyperlane-ethereum/src/tx.rs b/rust/main/chains/hyperlane-ethereum/src/tx.rs index e989be11d6..1a95c5436b 100644 --- a/rust/main/chains/hyperlane-ethereum/src/tx.rs +++ b/rust/main/chains/hyperlane-ethereum/src/tx.rs @@ -1,5 +1,5 @@ -use std::sync::Arc; use std::time::Duration; +use std::{ops::Mul, sync::Arc}; use ethers::{ abi::Detokenize, @@ -154,7 +154,7 @@ where } let Ok((base_fee, max_fee, max_priority_fee)) = - estimate_eip1559_fees(provider, None, &latest_block).await + estimate_eip1559_fees(provider, None, &latest_block, domain).await else { // Is not EIP 1559 chain return Ok(tx.gas(gas_limit)); @@ -210,6 +210,7 @@ async fn estimate_eip1559_fees( provider: Arc, estimator: Option, latest_block: &Block, + domain: &HyperlaneDomain, ) -> ChainResult<(EthersU256, EthersU256, EthersU256)> where M: Middleware + 'static, @@ -234,7 +235,17 @@ where eip1559_default_estimator(base_fee_per_gas, fee_history.reward) }; - Ok((base_fee_per_gas, max_fee_per_gas, max_priority_fee_per_gas)) + let mut gas_price_multiplier: u32 = 1; + // `treasure` chain gas estimation underestimates the actual gas price, so we add a multiplier to it + if domain.id() == 61166 { + gas_price_multiplier = 2; + } + + Ok(( + base_fee_per_gas.mul(gas_price_multiplier), + max_fee_per_gas.mul(gas_price_multiplier), + max_priority_fee_per_gas.mul(gas_price_multiplier), + )) } pub(crate) async fn call_with_reorg_period(