Skip to content

Commit 3754d4f

Browse files
committed
fix: process gas estimation for trusted relayer isms
1 parent 4dc7f7d commit 3754d4f

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

  • rust/main/chains/hyperlane-ethereum/src/contracts

rust/main/chains/hyperlane-ethereum/src/contracts/mailbox.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -659,20 +659,20 @@ where
659659
// In that case we fall back to l2_gas_limit = None so enforceable_gas_limit() uses
660660
// the direct process() gas estimate instead.
661661
let l2_gas_limit = if let Some(arbitrum_node_interface) = &self.arbitrum_node_interface {
662-
match arbitrum_node_interface
663-
.estimate_retryable_ticket(
664-
H160::zero().into(),
665-
// Give the sender a deposit (100 ETH), otherwise it reverts
666-
WEI_IN_ETHER.mul(100u32),
667-
self.contract.address(),
668-
U256::zero().into(),
669-
H160::zero().into(),
670-
H160::zero().into(),
671-
contract_call.calldata().unwrap_or_default(),
672-
)
673-
.estimate_gas()
674-
.await
675-
{
662+
let mut retryable_call = arbitrum_node_interface.estimate_retryable_ticket(
663+
H160::zero().into(),
664+
// Give the sender a deposit (100 ETH), otherwise it reverts
665+
WEI_IN_ETHER.mul(100u32),
666+
self.contract.address(),
667+
U256::zero().into(),
668+
H160::zero().into(),
669+
H160::zero().into(),
670+
contract_call.calldata().unwrap_or_default(),
671+
);
672+
if let Some(sender) = self.provider.default_sender() {
673+
retryable_call = retryable_call.from(sender);
674+
}
675+
match retryable_call.estimate_gas().await {
676676
Ok(estimate) => Some(estimate),
677677
Err(err) => {
678678
warn!(?err, "Failed to estimate l2_gas_limit via ArbitrumNodeInterface, falling back to direct gas estimate");

0 commit comments

Comments
 (0)