Skip to content

Commit

Permalink
fix: paying 50% more than base gas price to buffer EIP1559 gas price …
Browse files Browse the repository at this point in the history
…increase (#1672)

* paying 50% more than base gas price to buffer block by block gas price increase

* udpate changelog
  • Loading branch information
brewmaster012 committed Jan 31, 2024
1 parent b14638c commit 4f1751b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixes

* [1672](https://github.com/zeta-chain/node/pull/1672) - paying 50% more than base gas price to buffer EIP1559 gas price increase
* [1642](https://github.com/zeta-chain/node/pull/1642) - Change WhitelistERC20 authorization from group1 to group2
* [1610](https://github.com/zeta-chain/node/issues/1610) - add pending outtx hash to tracker after monitoring for 10 minutes

Expand Down
8 changes: 7 additions & 1 deletion zetaclient/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const (
DefaultBaseGasPrice = 1_000_000
)

var (
// paying 50% more than the current base gas price to buffer for potential block-by-block
// gas price increase due to EIP1559 feemarket on ZetaChain
bufferMultiplier = sdktypes.MustNewDecFromStr("1.5")
)

// Broadcast Broadcasts tx to metachain. Returns txHash and error
func (b *ZetaCoreBridge) Broadcast(gaslimit uint64, authzWrappedMsg sdktypes.Msg, authzSigner AuthZSigner) (string, error) {
b.broadcastLock.Lock()
Expand All @@ -44,7 +50,7 @@ func (b *ZetaCoreBridge) Broadcast(gaslimit uint64, authzWrappedMsg sdktypes.Msg
}
reductionRate := sdktypes.MustNewDecFromStr(ante.GasPriceReductionRate)
// multiply gas price by the system tx reduction rate
adjustedBaseGasPrice := sdktypes.NewDec(baseGasPrice).Mul(reductionRate)
adjustedBaseGasPrice := sdktypes.NewDec(baseGasPrice).Mul(reductionRate).Mul(bufferMultiplier)

if blockHeight > b.blockHeight {
b.blockHeight = blockHeight
Expand Down

0 comments on commit 4f1751b

Please sign in to comment.