Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: paying 50% more than base gas price to buffer EIP1559 gas price increase #1672

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading