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 09a9ef8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gas-oracle/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var (
DaFeeGauge metrics.Gauge
// OverHeadGauge over_head, amortized cost of batch submission per transaction
OverHeadGauge metrics.Gauge
// OverHeadGauge over_head, amortized cost of batch submission per transaction
OverHeadUpdateGauge metrics.Gauge
// L1GasPriceGauge l1_base_fee + l1_priority_fee
L1GasPriceGauge metrics.Gauge

Expand All @@ -49,6 +51,7 @@ func InitAndRegisterStats(r metrics.Registry) {
GasOracleStats.FeeScalarGauge = metrics.NewRegisteredGauge("fee_scalar", r)
GasOracleStats.DaFeeGauge = metrics.NewRegisteredGauge("da_fee", r)
GasOracleStats.OverHeadGauge = metrics.NewRegisteredGauge("over_head", r)
GasOracleStats.OverHeadUpdateGauge = metrics.NewRegisteredGauge("over_head_update", r)
GasOracleStats.L1GasPriceGauge = metrics.NewRegisteredGauge("l1_gas_price", r)

// stats for gas oracle version
Expand Down
3 changes: 2 additions & 1 deletion 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.OverHeadUpdateGauge.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 Down

0 comments on commit 09a9ef8

Please sign in to comment.