From 228319ed5d99a1c2160d66c61adf76b564c91d3a Mon Sep 17 00:00:00 2001 From: HAOYUatHZ Date: Tue, 8 Oct 2024 22:01:13 +1100 Subject: [PATCH 1/3] fix: fix sender gas price --- rollup/internal/controller/sender/sender.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rollup/internal/controller/sender/sender.go b/rollup/internal/controller/sender/sender.go index 2c206a8d6..548252c2d 100644 --- a/rollup/internal/controller/sender/sender.go +++ b/rollup/internal/controller/sender/sender.go @@ -159,7 +159,16 @@ func (s *Sender) SendConfirmation(cfm *Confirmation) { func (s *Sender) getFeeData(target *common.Address, data []byte, sidecar *gethTypes.BlobTxSidecar, baseFee, blobBaseFee uint64, fallbackGasLimit uint64) (*FeeData, error) { switch s.config.TxType { case LegacyTxType: - return s.estimateLegacyGas(target, data, fallbackGasLimit) + feeData, err := s.estimateLegacyGas(target, data, fallbackGasLimit) + if err != nil { + return nil, err + } + baseFeeInt := new(big.Int).SetUint64(baseFee) + maxGasPrice := new(big.Int).SetUint64(s.config.MaxGasPrice) + if feeData.gasPrice.Cmp(baseFeeInt) < 0 && baseFeeInt.Cmp(maxGasPrice) <= 0 { + feeData.gasPrice = baseFeeInt + } + return feeData, nil case DynamicFeeTxType: if sidecar == nil { return s.estimateDynamicGas(target, data, baseFee, fallbackGasLimit) @@ -357,6 +366,10 @@ func (s *Sender) resubmitTransaction(tx *gethTypes.Transaction, baseFee, blobBas 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 } From 8ae34c3a380f5f03c0ec25935ba9a7a9f1d4cf01 Mon Sep 17 00:00:00 2001 From: 0xmountaintop <0xmountaintop@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:03:34 +0000 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[bot?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/version/version.go b/common/version/version.go index a06c232c1..a9b3af2c6 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.4.64" +var tag = "v4.4.65" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { From 30a7b47b6fb2493d4a2fd6c021cee052919e2d2f Mon Sep 17 00:00:00 2001 From: HAOYUatHZ Date: Wed, 9 Oct 2024 19:45:53 +1100 Subject: [PATCH 3/3] revert --- rollup/internal/controller/sender/sender.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/rollup/internal/controller/sender/sender.go b/rollup/internal/controller/sender/sender.go index 548252c2d..aafda5690 100644 --- a/rollup/internal/controller/sender/sender.go +++ b/rollup/internal/controller/sender/sender.go @@ -159,16 +159,7 @@ func (s *Sender) SendConfirmation(cfm *Confirmation) { func (s *Sender) getFeeData(target *common.Address, data []byte, sidecar *gethTypes.BlobTxSidecar, baseFee, blobBaseFee uint64, fallbackGasLimit uint64) (*FeeData, error) { switch s.config.TxType { case LegacyTxType: - feeData, err := s.estimateLegacyGas(target, data, fallbackGasLimit) - if err != nil { - return nil, err - } - baseFeeInt := new(big.Int).SetUint64(baseFee) - maxGasPrice := new(big.Int).SetUint64(s.config.MaxGasPrice) - if feeData.gasPrice.Cmp(baseFeeInt) < 0 && baseFeeInt.Cmp(maxGasPrice) <= 0 { - feeData.gasPrice = baseFeeInt - } - return feeData, nil + return s.estimateLegacyGas(target, data, fallbackGasLimit) case DynamicFeeTxType: if sidecar == nil { return s.estimateDynamicGas(target, data, baseFee, fallbackGasLimit)