From 06a21f327dada2315d821b1e55f89443b62c7b03 Mon Sep 17 00:00:00 2001 From: georgehao Date: Mon, 4 Mar 2024 10:21:05 +0800 Subject: [PATCH] feat: add transactions len metrics of block processer (#650) * feat: add transactions len metrics of block processer * feat: bump version --- core/state_processor.go | 4 ++++ params/version.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/state_processor.go b/core/state_processor.go index 9e3968cc6748..87ebbaa18790 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -27,10 +27,13 @@ import ( "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/core/vm" "github.com/scroll-tech/go-ethereum/crypto" + "github.com/scroll-tech/go-ethereum/metrics" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rollup/fees" ) +var processorBlockTransactionGauge = metrics.NewRegisteredGauge("processor/block/transactions", nil) + // StateProcessor is a basic Processor, which takes care of transitioning // state from one point to another. // @@ -73,6 +76,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg } blockContext := NewEVMBlockContext(header, p.bc, p.config, nil) vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, p.config, cfg) + processorBlockTransactionGauge.Update(int64(block.Transactions().Len())) // Iterate over and process the individual transactions for i, tx := range block.Transactions() { msg, err := tx.AsMessage(types.MakeSigner(p.config, header.Number), header.BaseFee) diff --git a/params/version.go b/params/version.go index 04cfba1a6912..0fa8fd5f9552 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 1 // Minor version component of the current release - VersionPatch = 18 // Patch version component of the current release + VersionPatch = 19 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )