Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Mar 26, 2024
1 parent 97c2bfa commit 8abc855
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions execution/gethexec/executionengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
)

var (
baseFeeGauge = metrics.NewRegisteredGauge("arb/block/basefee", nil)
blockGasUsedGauge = metrics.NewRegisteredHistogram("arb/block/gasused", nil, metrics.NewBoundedHistogramSample())
txCountGauge = metrics.NewRegisteredHistogram("arb/block/transactions/count", nil, metrics.NewBoundedHistogramSample())
txGasUsedGauge = metrics.NewRegisteredHistogram("arb/transaction/gasused", nil, metrics.NewBoundedHistogramSample())
baseFeeGauge = metrics.NewRegisteredGauge("arb/block/basefee", nil)
blockGasUsedHistogram = metrics.NewRegisteredHistogram("arb/block/gasused", nil, metrics.NewBoundedHistogramSample())
txCountHistogram = metrics.NewRegisteredHistogram("arb/block/transactions/count", nil, metrics.NewBoundedHistogramSample())
txGasUsedHistogram = metrics.NewRegisteredHistogram("arb/block/transactions/gasused", nil, metrics.NewBoundedHistogramSample())
)

type ExecutionEngine struct {
Expand Down Expand Up @@ -497,14 +497,14 @@ func (s *ExecutionEngine) appendBlock(block *types.Block, statedb *state.StateDB
return errors.New("geth rejected block as non-canonical")
}
baseFeeGauge.Update(block.BaseFee().Int64())
txCountGauge.Update(int64(len(block.Transactions()) - 1))
txCountHistogram.Update(int64(len(block.Transactions()) - 1))
var blockGasused uint64
for i := 1; i < len(receipts); i++ {
val := arbmath.SaturatingUSub(receipts[i].GasUsed, receipts[i].GasUsedForL1)
txGasUsedGauge.Update(int64(val))
txGasUsedHistogram.Update(int64(val))
blockGasused += val
}
blockGasUsedGauge.Update(int64(blockGasused))
blockGasUsedHistogram.Update(int64(blockGasused))
return nil
}

Expand Down

0 comments on commit 8abc855

Please sign in to comment.