mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-28 00:27:26 +00:00
fix negative evm
This commit is contained in:
parent
01649de12e
commit
c8592a42a8
1 changed files with 8 additions and 1 deletions
|
|
@ -120,6 +120,13 @@ func (t *perfTracer) OnBlockStart(event tracing.BlockEvent) {
|
|||
func (t *perfTracer) OnTxStart(vm *tracing.VMContext, tx *types.Transaction, from common.Address) {
|
||||
t.txStartTime = time.Now()
|
||||
t.statedb = vm.StateDB
|
||||
|
||||
// The accumulated measurements include IO performed before any txs were executed.
|
||||
if t.txIndex == 0 {
|
||||
initialIO := t.statedb.GetAccumulatedIOMeasurements()
|
||||
t.prevAccountReads = initialIO.AccountReads
|
||||
t.prevStorageReads = initialIO.StorageReads
|
||||
}
|
||||
}
|
||||
|
||||
func (t *perfTracer) OnTxEnd(receipt *types.Receipt, err error) {
|
||||
|
|
@ -131,7 +138,7 @@ func (t *perfTracer) OnTxEnd(receipt *types.Receipt, err error) {
|
|||
evmTime time.Duration
|
||||
)
|
||||
if ioTime > totalTime {
|
||||
log.Error("PerfTracer: IO time exceeds total time", "ioTime", ioTime, "totalTime", totalTime)
|
||||
log.Error("PerfTracer: IO time exceeds total time", "ioTime", ioTime, "totalTime", totalTime, "txIdx", t.txIndex)
|
||||
} else {
|
||||
evmTime = totalTime - ioTime
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue