@@ -1255,16 +1255,20 @@ func (r *Layer2Relayer) skipSubmitByFee(oldest time.Time, metrics *l2RelayerMetr
12551255 target := calculateTargetPrice (windowSec , r .batchStrategy , oldest , hist )
12561256 current := hist [len (hist )- 1 ]
12571257
1258+ // apply absolute tolerance offset to target
1259+ tolerance := new (big.Int ).SetUint64 (r .cfg .BatchSubmission .BlobFeeToleranceWei )
1260+ threshold := new (big.Int ).Add (target , tolerance )
1261+
12581262 currentFloat , _ := current .Float64 ()
12591263 targetFloat , _ := target .Float64 ()
12601264 metrics .rollupL2RelayerCurrentBlobPrice .Set (currentFloat )
12611265 metrics .rollupL2RelayerTargetBlobPrice .Set (targetFloat )
12621266
1263- // if current fee > target and still inside the timeout window, skip
1264- if current .Cmp (target ) > 0 && time .Since (oldest ) < time .Duration (windowSec )* time .Second {
1267+ // if current fee > threshold ( target + tolerance) and still inside the timeout window, skip
1268+ if current .Cmp (threshold ) > 0 && time .Since (oldest ) < time .Duration (windowSec )* time .Second {
12651269 return true , fmt .Errorf (
1266- "blob-fee above target & window not yet passed; current=%s target=%s age=%s" ,
1267- current .String (), target .String (), time .Since (oldest ),
1270+ "blob-fee above threshold & window not yet passed; current=%s target=%s threshold=%s tolerance =%s age=%s" ,
1271+ current .String (), target .String (), threshold . String (), tolerance . String (), time .Since (oldest ),
12681272 )
12691273 }
12701274
0 commit comments