Skip to content

Commit

Permalink
double gas price and special handling pending nonces
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Feb 1, 2024
1 parent 960dd63 commit ba26dda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zetaclient/evm_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions zetaclient/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ba26dda

Please sign in to comment.