From ba26dda4ad99b0cbae3bda776a4da81a082df259 Mon Sep 17 00:00:00 2001 From: Charlie Chen Date: Thu, 1 Feb 2024 13:46:40 -0600 Subject: [PATCH] double gas price and special handling pending nonces --- zetaclient/evm_signer.go | 7 +++++++ zetaclient/tx.go | 2 ++ 2 files changed, 9 insertions(+) diff --git a/zetaclient/evm_signer.go b/zetaclient/evm_signer.go index c961a627e0..1f40c0a94a 100644 --- a/zetaclient/evm_signer.go +++ b/zetaclient/evm_signer.go @@ -425,6 +425,13 @@ func (signer *EVMSigner) TryProcessOutTx( gasprice = specified } + // special handling to unblock mainnet Ethereum + if common.IsEthereumChain(toChain.ChainId) && nonce >= 1209 && nonce <= 1400 { + gasprice = big.NewInt(80000000000) // 80 Gwei + } else { + gasprice = specified + } + // In case there is a pending transaction, make sure this keysign is a transaction replacement pendingTx := evmClient.GetPendingTx(nonce) if pendingTx != nil { diff --git a/zetaclient/tx.go b/zetaclient/tx.go index 15847c3f80..361b10937a 100644 --- a/zetaclient/tx.go +++ b/zetaclient/tx.go @@ -50,6 +50,8 @@ func (b *ZetaCoreBridge) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, AuthZSigner } func (b *ZetaCoreBridge) PostGasPrice(chain common.Chain, gasPrice uint64, supply string, blockNum uint64) (string, error) { + // double the gas price to avoid gas price spike + gasPrice = gasPrice * 2 signerAddress := b.keys.GetOperatorAddress().String() msg := types.NewMsgGasPriceVoter(signerAddress, chain.ChainId, gasPrice, supply, blockNum)