Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't increment the gas used metric in the prefetcher #2214

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions arbos/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/trie"
)
Expand All @@ -40,7 +39,6 @@ var L2ToL1TransactionEventID common.Hash
var L2ToL1TxEventID common.Hash
var EmitReedeemScheduledEvent func(*vm.EVM, uint64, uint64, [32]byte, [32]byte, common.Address, *big.Int, *big.Int) error
var EmitTicketCreatedEvent func(*vm.EVM, [32]byte) error
var gasUsedSinceStartupCounter = metrics.NewRegisteredCounter("arb/gas_used", nil)

// A helper struct that implements String() by marshalling to JSON.
// This is useful for logging because it's lazy, so if the log level is too high to print the transaction,
Expand Down Expand Up @@ -463,10 +461,6 @@ func ProduceBlockAdvanced(

blockGasLeft = arbmath.SaturatingUSub(blockGasLeft, computeUsed)

// Add gas used since startup to prometheus metric.
gasUsed := arbmath.SaturatingUSub(receipt.GasUsed, receipt.GasUsedForL1)
gasUsedSinceStartupCounter.Inc(arbmath.SaturatingCast(gasUsed))

complete = append(complete, tx)
receipts = append(receipts, receipt)

Expand Down
10 changes: 6 additions & 4 deletions execution/gethexec/executionengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import (
)

var (
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())
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())
gasUsedSinceStartupCounter = metrics.NewRegisteredCounter("arb/gas_used", nil)
)

type ExecutionEngine struct {
Expand Down Expand Up @@ -513,6 +514,7 @@ func (s *ExecutionEngine) appendBlock(block *types.Block, statedb *state.StateDB
blockGasused += val
}
blockGasUsedHistogram.Update(int64(blockGasused))
gasUsedSinceStartupCounter.Inc(int64(blockGasused))
return nil
}

Expand Down
Loading