Require >30 gwei for Polygon (#1952)

### Description

Fixes #1933. It's not pretty but I would like to sleep tonight
pull/1963/head
Nam Chu Hoai 2 years ago committed by GitHub
parent 93069fd7c3
commit 4cda702a30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      rust/chains/hyperlane-ethereum/src/mailbox.rs

@ -10,7 +10,7 @@ use ethers::abi::AbiEncode;
use ethers::prelude::Middleware; use ethers::prelude::Middleware;
use ethers::types::Eip1559TransactionRequest; use ethers::types::Eip1559TransactionRequest;
use ethers_contract::builders::ContractCall; use ethers_contract::builders::ContractCall;
use hyperlane_core::H160; use hyperlane_core::{KnownHyperlaneDomain, H160};
use tracing::instrument; use tracing::instrument;
use hyperlane_core::{ use hyperlane_core::{
@ -229,6 +229,16 @@ where
// Is not EIP 1559 chain // Is not EIP 1559 chain
return Ok(tx.gas(gas_limit)) return Ok(tx.gas(gas_limit))
}; };
let max_priority_fee = if matches!(
KnownHyperlaneDomain::try_from(message.destination),
Ok(KnownHyperlaneDomain::Polygon)
) {
// Polygon needs a max priority fee >= 30 gwei
let min_polygon_fee = U256::from(30_000_000_000u64);
max_priority_fee.max(min_polygon_fee)
} else {
max_priority_fee
};
// Is EIP 1559 chain // Is EIP 1559 chain
let mut request = Eip1559TransactionRequest::new(); let mut request = Eip1559TransactionRequest::new();
if let Some(from) = tx.tx.from() { if let Some(from) = tx.tx.from() {

Loading…
Cancel
Save