From 1f3cbe56e3ba7dee5631d580e074aa4893ae469e Mon Sep 17 00:00:00 2001 From: Morty Date: Wed, 3 Dec 2025 16:37:22 +0800 Subject: [PATCH 1/5] feat(rollup-relayer): add blob fee tolerance --- rollup/conf/config.json | 3 ++- rollup/internal/config/relayer.go | 5 +++++ rollup/internal/controller/relayer/l2_relayer.go | 12 ++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/rollup/conf/config.json b/rollup/conf/config.json index 537ac144b4..de93697a08 100644 --- a/rollup/conf/config.json +++ b/rollup/conf/config.json @@ -58,7 +58,8 @@ "min_batches": 1, "max_batches": 6, "timeout": 7200, - "backlog_max": 75 + "backlog_max": 75, + "blob_fee_tolerance_wei": 10000000000 }, "gas_oracle_config": { "min_gas_price": 0, diff --git a/rollup/internal/config/relayer.go b/rollup/internal/config/relayer.go index 55f6393db9..c126f21c2a 100644 --- a/rollup/internal/config/relayer.go +++ b/rollup/internal/config/relayer.go @@ -48,6 +48,11 @@ type BatchSubmission struct { TimeoutSec int64 `json:"timeout"` // The maximum number of pending batches to keep in the backlog. BacklogMax int64 `json:"backlog_max"` + // BlobFeeToleranceWei is the absolute tolerance (in wei) added to the target blob fee. + // If the current fee is below target + tolerance, we proceed with submission. + // This prevents skipping submission when the price difference is negligible (e.g., 1 wei). + // Recommended value: 10 gwei (10000000000 wei). + BlobFeeToleranceWei uint64 `json:"blob_fee_tolerance_wei"` } // ChainMonitor this config is used to get batch status from chain_monitor API. diff --git a/rollup/internal/controller/relayer/l2_relayer.go b/rollup/internal/controller/relayer/l2_relayer.go index 27cb11543f..b942172803 100644 --- a/rollup/internal/controller/relayer/l2_relayer.go +++ b/rollup/internal/controller/relayer/l2_relayer.go @@ -1255,16 +1255,20 @@ func (r *Layer2Relayer) skipSubmitByFee(oldest time.Time, metrics *l2RelayerMetr target := calculateTargetPrice(windowSec, r.batchStrategy, oldest, hist) current := hist[len(hist)-1] + // apply absolute tolerance offset to target + tolerance := new(big.Int).SetUint64(r.cfg.BatchSubmission.BlobFeeToleranceWei) + threshold := new(big.Int).Add(target, tolerance) + currentFloat, _ := current.Float64() targetFloat, _ := target.Float64() metrics.rollupL2RelayerCurrentBlobPrice.Set(currentFloat) metrics.rollupL2RelayerTargetBlobPrice.Set(targetFloat) - // if current fee > target and still inside the timeout window, skip - if current.Cmp(target) > 0 && time.Since(oldest) < time.Duration(windowSec)*time.Second { + // if current fee > threshold (target + tolerance) and still inside the timeout window, skip + if current.Cmp(threshold) > 0 && time.Since(oldest) < time.Duration(windowSec)*time.Second { return true, fmt.Errorf( - "blob-fee above target & window not yet passed; current=%s target=%s age=%s", - current.String(), target.String(), time.Since(oldest), + "blob-fee above threshold & window not yet passed; current=%s target=%s threshold=%s tolerance=%s age=%s", + current.String(), target.String(), threshold.String(), tolerance.String(), time.Since(oldest), ) } From 3bca4924a6eb9df4159f658960d3a7b57a4c0d81 Mon Sep 17 00:00:00 2001 From: Morty Date: Wed, 3 Dec 2025 16:40:40 +0800 Subject: [PATCH 2/5] rename --- rollup/conf/config.json | 2 +- rollup/internal/config/relayer.go | 4 ++-- rollup/internal/controller/relayer/l2_relayer.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rollup/conf/config.json b/rollup/conf/config.json index de93697a08..19a956216a 100644 --- a/rollup/conf/config.json +++ b/rollup/conf/config.json @@ -59,7 +59,7 @@ "max_batches": 6, "timeout": 7200, "backlog_max": 75, - "blob_fee_tolerance_wei": 10000000000 + "blob_fee_tolerance": 10000000000 }, "gas_oracle_config": { "min_gas_price": 0, diff --git a/rollup/internal/config/relayer.go b/rollup/internal/config/relayer.go index c126f21c2a..a46ffeab69 100644 --- a/rollup/internal/config/relayer.go +++ b/rollup/internal/config/relayer.go @@ -48,11 +48,11 @@ type BatchSubmission struct { TimeoutSec int64 `json:"timeout"` // The maximum number of pending batches to keep in the backlog. BacklogMax int64 `json:"backlog_max"` - // BlobFeeToleranceWei is the absolute tolerance (in wei) added to the target blob fee. + // BlobFeeTolerance is the absolute tolerance (in wei) added to the target blob fee. // If the current fee is below target + tolerance, we proceed with submission. // This prevents skipping submission when the price difference is negligible (e.g., 1 wei). // Recommended value: 10 gwei (10000000000 wei). - BlobFeeToleranceWei uint64 `json:"blob_fee_tolerance_wei"` + BlobFeeTolerance uint64 `json:"blob_fee_tolerance"` } // ChainMonitor this config is used to get batch status from chain_monitor API. diff --git a/rollup/internal/controller/relayer/l2_relayer.go b/rollup/internal/controller/relayer/l2_relayer.go index b942172803..c3ddbdac4f 100644 --- a/rollup/internal/controller/relayer/l2_relayer.go +++ b/rollup/internal/controller/relayer/l2_relayer.go @@ -1256,7 +1256,7 @@ func (r *Layer2Relayer) skipSubmitByFee(oldest time.Time, metrics *l2RelayerMetr current := hist[len(hist)-1] // apply absolute tolerance offset to target - tolerance := new(big.Int).SetUint64(r.cfg.BatchSubmission.BlobFeeToleranceWei) + tolerance := new(big.Int).SetUint64(r.cfg.BatchSubmission.BlobFeeTolerance) threshold := new(big.Int).Add(target, tolerance) currentFloat, _ := current.Float64() From 4ed6d58d113c711ba3e7fe86ad4cdeefab48c81d Mon Sep 17 00:00:00 2001 From: Morty Date: Wed, 3 Dec 2025 16:57:35 +0800 Subject: [PATCH 3/5] update comment --- rollup/internal/config/relayer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rollup/internal/config/relayer.go b/rollup/internal/config/relayer.go index a46ffeab69..2e50969ada 100644 --- a/rollup/internal/config/relayer.go +++ b/rollup/internal/config/relayer.go @@ -50,8 +50,7 @@ type BatchSubmission struct { BacklogMax int64 `json:"backlog_max"` // BlobFeeTolerance is the absolute tolerance (in wei) added to the target blob fee. // If the current fee is below target + tolerance, we proceed with submission. - // This prevents skipping submission when the price difference is negligible (e.g., 1 wei). - // Recommended value: 10 gwei (10000000000 wei). + // This prevents skipping submission when the price difference is negligible. BlobFeeTolerance uint64 `json:"blob_fee_tolerance"` } From 066e8614aba7205fb2ba03f65a9108851709a4c0 Mon Sep 17 00:00:00 2001 From: Morty Date: Wed, 3 Dec 2025 17:04:12 +0800 Subject: [PATCH 4/5] update comment --- rollup/conf/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup/conf/config.json b/rollup/conf/config.json index 19a956216a..f4f382022f 100644 --- a/rollup/conf/config.json +++ b/rollup/conf/config.json @@ -59,7 +59,7 @@ "max_batches": 6, "timeout": 7200, "backlog_max": 75, - "blob_fee_tolerance": 10000000000 + "blob_fee_tolerance": 500000000 }, "gas_oracle_config": { "min_gas_price": 0, From 7cbacbfe00e905589884e7b72174e4c168d54b2a Mon Sep 17 00:00:00 2001 From: yiweichi Date: Wed, 3 Dec 2025 09:07:48 +0000 Subject: [PATCH 5/5] =?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 ba510f3d8c..801661cb3f 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.7.9" +var tag = "v4.7.10" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {