diff --git a/node/derivation/derivation.go b/node/derivation/derivation.go index cd31e6353..19831f253 100644 --- a/node/derivation/derivation.go +++ b/node/derivation/derivation.go @@ -174,14 +174,11 @@ func (d *Derivation) derivationBlock(ctx context.Context) { d.logger.Error("eth_getLogs failed", "err", err) return } - latestBatchIndex, err := d.rollup.LastCommittedBatchIndex(&bind.CallOpts{ - BlockNumber: big.NewInt(int64(latest)), - }) + latestBatchIndex, err := d.rollup.LastCommittedBatchIndex(nil) if err != nil { d.logger.Error("query rollup latestCommitted batch Index failed", "err", err) return } - d.metrics.SetLatestBatchIndex(latestBatchIndex.Uint64()) d.logger.Info("fetched rollup tx", "txNum", len(logs), "latestBatchIndex", latestBatchIndex) for _, lg := range logs { @@ -211,7 +208,6 @@ func (d *Derivation) derivationBlock(ctx context.Context) { // only last block of batch d.logger.Info("batch derivation complete", "batch_index", batchInfo.batchIndex, "currentBatchEndBlock", lastHeader.Number.Uint64()) d.metrics.SetL2DeriveHeight(lastHeader.Number.Uint64()) - d.metrics.SetSyncedBatchIndex(batchInfo.batchIndex) withdrawalRoot, err := d.L2ToL1MessagePasser.MessageRoot(&bind.CallOpts{ BlockNumber: lastHeader.Number, }) diff --git a/node/derivation/metrics.go b/node/derivation/metrics.go index da5e8937d..9003db632 100644 --- a/node/derivation/metrics.go +++ b/node/derivation/metrics.go @@ -18,12 +18,10 @@ const ( ) type Metrics struct { - L1SyncHeight metrics.Gauge - RollupL2Height metrics.Gauge - DeriveL2Height metrics.Gauge - BatchStatus metrics.Gauge - LatestBatchIndex metrics.Gauge - SyncedBatchIndex metrics.Gauge + L1SyncHeight metrics.Gauge + RollupL2Height metrics.Gauge + DeriveL2Height metrics.Gauge + BatchStatus metrics.Gauge } func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { @@ -56,18 +54,6 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Name: "batch_root_exception", Help: "", }, labels).With(labelsAndValues...), - LatestBatchIndex: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ - Namespace: namespace, - Subsystem: metricsSubsystem, - Name: "latest_batch_index", - Help: "", - }, labels).With(labelsAndValues...), - SyncedBatchIndex: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ - Namespace: namespace, - Subsystem: metricsSubsystem, - Name: "synced_batch_index", - Help: "", - }, labels).With(labelsAndValues...), } } @@ -87,14 +73,6 @@ func (m *Metrics) SetBatchStatus(status uint64) { m.BatchStatus.Set(float64(status)) } -func (m *Metrics) SetLatestBatchIndex(batchIndex uint64) { - m.LatestBatchIndex.Set(float64(batchIndex)) -} - -func (m *Metrics) SetSyncedBatchIndex(batchIndex uint64) { - m.SyncedBatchIndex.Set(float64(batchIndex)) -} - func (m *Metrics) Serve(hostname string, port uint64) (*http.Server, error) { mux := http.NewServeMux() mux.Handle("/metrics", promhttp.Handler())