Skip to content

Commit

Permalink
[fix]: fix bigint cmp formular
Browse files Browse the repository at this point in the history
  • Loading branch information
Sha3nS committed Aug 15, 2023
1 parent 0a5ea1f commit fe5d7e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gas-oracle/oracle/overhead.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ func wrapUpdateOverhead(l2Backend DeployContractBackend, cfg *Config) (func(*big
if err != nil {
return err
}
ometrics.GasOracleStats.OverHeadGauge.Inc(1)
// skip update if overhead is not changed
if overhead == newOverheadLevel {
if overhead.Cmp(newOverheadLevel) == 0 {
log.Info("skip update overhead", "overhead", overhead)
return nil
}
Expand All @@ -115,7 +116,6 @@ func wrapUpdateOverhead(l2Backend DeployContractBackend, cfg *Config) (func(*big
return fmt.Errorf("cannot update base fee: %w", err)
}
log.Info("L2 overhead transaction sent", "hash", tx.Hash().Hex(), "old overhead", overhead, "new overhead", newOverheadLevel)
ometrics.GasOracleStats.OverHeadGauge.Update(newOverheadLevel.Int64())

if cfg.waitForReceipt {
// Wait for the receipt
Expand Down

0 comments on commit fe5d7e9

Please sign in to comment.