feat: add metric to evm call (#646)

* feat: add metric to evm

* feat: bump version
This commit is contained in:
georgehao 2024-02-28 09:45:38 +08:00 committed by GitHub
parent 989639a25a
commit bfa7abcc50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -20,6 +20,7 @@ import (
"fmt"
"math"
"math/big"
"time"
"github.com/scroll-tech/go-ethereum/common"
cmath "github.com/scroll-tech/go-ethereum/common/math"
@ -27,11 +28,14 @@ import (
"github.com/scroll-tech/go-ethereum/core/vm"
"github.com/scroll-tech/go-ethereum/crypto/codehash"
"github.com/scroll-tech/go-ethereum/log"
"github.com/scroll-tech/go-ethereum/metrics"
"github.com/scroll-tech/go-ethereum/params"
)
var emptyKeccakCodeHash = codehash.EmptyKeccakCodeHash
var evmCallExecutionTimer = metrics.NewRegisteredTimer("evm/call/execution", nil)
/*
The State Transitioning Model
@ -384,7 +388,9 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
} else {
// Increment the nonce for the next transaction
st.state.SetNonce(msg.From(), st.state.GetNonce(sender.Address())+1)
evmCallStart := time.Now()
ret, st.gas, vmerr = st.evm.Call(sender, st.to(), st.data, st.gas, st.value)
evmCallExecutionTimer.Update(time.Since(evmCallStart))
}
// no refunds for l1 messages

View file

@ -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 = 17 // Patch version component of the current release
VersionPatch = 18 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)