From 438a9fb1d6c63a7ab7a53ed0406d30fab0f815ef Mon Sep 17 00:00:00 2001 From: 0xmountaintop <37070449+0xmountaintop@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:14:08 +1100 Subject: [PATCH] fix(sender): make sure gas price is above baseFee (#1531) Co-authored-by: 0xmountaintop <0xmountaintop@users.noreply.github.com> Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: colinlyguo --- common/version/version.go | 2 +- rollup/internal/controller/sender/sender.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/version/version.go b/common/version/version.go index 0f9a7cd89..6fdb62be4 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.4.77" +var tag = "v4.4.78" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/rollup/internal/controller/sender/sender.go b/rollup/internal/controller/sender/sender.go index ff32750f7..9c8652d33 100644 --- a/rollup/internal/controller/sender/sender.go +++ b/rollup/internal/controller/sender/sender.go @@ -362,6 +362,10 @@ func (s *Sender) createReplacingTransaction(tx *gethTypes.Transaction, baseFee, originalGasPrice := tx.GasPrice() gasPrice := new(big.Int).Mul(originalGasPrice, escalateMultipleNum) gasPrice = new(big.Int).Div(gasPrice, escalateMultipleDen) + baseFeeInt := new(big.Int).SetUint64(baseFee) + if gasPrice.Cmp(baseFeeInt) < 0 { + gasPrice = baseFeeInt + } if gasPrice.Cmp(maxGasPrice) > 0 { gasPrice = maxGasPrice }