Skip to content

Commit 63c09a2

Browse files
author
alexisdevilliers
committed
cast first
1 parent 46d2785 commit 63c09a2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rollup/internal/controller/relayer/l1_relayer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,14 @@ func (r *Layer1Relayer) shouldUpdateGasOracle(baseFee uint64, blobBaseFee uint64
251251
}
252252

253253
expectedBaseFeeDelta := r.lastBaseFee*r.gasPriceDiff/gasPriceDiffPrecision + 1
254-
if baseFee >= r.minGasPrice && math.Abs(float64(baseFee-r.lastBaseFee)) >= float64(expectedBaseFeeDelta) {
254+
if baseFee >= r.minGasPrice && math.Abs(float64(baseFee)-float64(r.lastBaseFee)) >= float64(expectedBaseFeeDelta) {
255255
return true
256256
}
257257

258258
expectedBlobBaseFeeDelta := r.lastBlobBaseFee * r.gasPriceDiff / gasPriceDiffPrecision
259259
// Plus a minimum of 0.01 gwei, since the blob base fee is usually low, preventing short-time flunctuation.
260260
expectedBlobBaseFeeDelta += 10000000
261-
if blobBaseFee >= r.minGasPrice && math.Abs(float64(blobBaseFee-r.lastBlobBaseFee)) >= float64(expectedBlobBaseFeeDelta) {
261+
if blobBaseFee >= r.minGasPrice && math.Abs(float64(blobBaseFee)-float64(r.lastBlobBaseFee)) >= float64(expectedBlobBaseFeeDelta) {
262262
return true
263263
}
264264

rollup/internal/controller/relayer/l2_relayer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ func (r *Layer2Relayer) ProcessGasPriceOracle() {
346346

347347
// last is undefined or (suggestGasPriceUint64 >= minGasPrice && exceed diff)
348348
if r.lastGasPrice == 0 || (suggestGasPriceUint64 >= r.minGasPrice &&
349-
(math.Abs(float64(suggestGasPriceUint64-r.lastGasPrice)) >= float64(expectedDelta))) {
349+
(math.Abs(float64(suggestGasPriceUint64)-float64(r.lastGasPrice)) >= float64(expectedDelta))) {
350350
data, err := r.l2GasOracleABI.Pack("setL2BaseFee", suggestGasPrice)
351351
if err != nil {
352352
log.Error("Failed to pack setL2BaseFee", "batch.Hash", batch.Hash, "GasPrice", suggestGasPrice.Uint64(), "err", err)

0 commit comments

Comments
 (0)