erigon2: exec metric (#3567)

This commit is contained in:
Alex Sharov 2022-02-22 08:55:49 +07:00 committed by GitHub
parent 5cd561bd74
commit f5da8833b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ import (
"syscall"
"time"
metrics2 "github.com/VictoriaMetrics/metrics"
"github.com/holiman/uint256"
"github.com/ledgerwatch/erigon-lib/aggregator"
libcommon "github.com/ledgerwatch/erigon-lib/common"
@ -48,6 +49,8 @@ var (
commitments bool
)
var blockExecutionTimer = metrics2.GetOrCreateSummary("chain_execution_seconds")
func init() {
withBlock(erigon2Cmd)
withDatadir(erigon2Cmd)
@ -271,6 +274,7 @@ func Erigon2(genesis *core.Genesis, logger log.Logger) error {
}
func runBlock2(trace bool, txNumStart uint64, rw *ReaderWrapper, ww *WriterWrapper, chainConfig *params.ChainConfig, getHeader func(hash common.Hash, number uint64) *types.Header, block *types.Block, vmConfig vm.Config) (uint64, types.Receipts, error) {
defer blockExecutionTimer.UpdateDuration(time.Now())
header := block.Header()
vmConfig.TraceJumpDest = true
engine := ethash.NewFullFaker()