Skip to content

Commit

Permalink
feat: add metric to evm call (#646)
Browse files Browse the repository at this point in the history
* feat: add metric to evm

* feat: bump version
  • Loading branch information
georgehao authored Feb 28, 2024
1 parent 989639a commit bfa7abc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ import (
"fmt"
"math"
"math/big"
"time"

"github.com/scroll-tech/go-ethereum/common"
cmath "github.com/scroll-tech/go-ethereum/common/math"
"github.com/scroll-tech/go-ethereum/core/types"
"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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down

0 comments on commit bfa7abc

Please sign in to comment.