mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
core/vm: remove redundant tracing hook invocation from interpreter loop
This commit is contained in:
parent
75526bb8e0
commit
479ea1196d
1 changed files with 9 additions and 16 deletions
|
|
@ -258,9 +258,9 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
|
||||||
contract.Gas -= cost
|
contract.Gas -= cost
|
||||||
}
|
}
|
||||||
|
|
||||||
if operation.dynamicGas != nil {
|
|
||||||
// All ops with a dynamic memory usage also has a dynamic gas cost.
|
// All ops with a dynamic memory usage also has a dynamic gas cost.
|
||||||
var memorySize uint64
|
var memorySize uint64
|
||||||
|
if operation.dynamicGas != nil {
|
||||||
// calculate the new memory size and expand the memory to fit
|
// calculate the new memory size and expand the memory to fit
|
||||||
// the operation
|
// the operation
|
||||||
// Memory check needs to be done prior to evaluating the dynamic gas portion,
|
// Memory check needs to be done prior to evaluating the dynamic gas portion,
|
||||||
|
|
@ -291,6 +291,8 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
|
||||||
contract.Gas -= dynamicCost
|
contract.Gas -= dynamicCost
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
// Do tracing before memory expansion
|
// Do tracing before memory expansion
|
||||||
if debug {
|
if debug {
|
||||||
if in.evm.Config.Tracer.OnGasChange != nil {
|
if in.evm.Config.Tracer.OnGasChange != nil {
|
||||||
|
|
@ -304,15 +306,6 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
|
||||||
if memorySize > 0 {
|
if memorySize > 0 {
|
||||||
mem.Resize(memorySize)
|
mem.Resize(memorySize)
|
||||||
}
|
}
|
||||||
} else if debug {
|
|
||||||
if in.evm.Config.Tracer.OnGasChange != nil {
|
|
||||||
in.evm.Config.Tracer.OnGasChange(gasCopy, gasCopy-cost, tracing.GasChangeCallOpCode)
|
|
||||||
}
|
|
||||||
if in.evm.Config.Tracer.OnOpcode != nil {
|
|
||||||
in.evm.Config.Tracer.OnOpcode(pc, byte(op), gasCopy, cost, callContext, in.returnData, in.evm.depth, VMErrorFromErr(err))
|
|
||||||
logged = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// execute the operation
|
// execute the operation
|
||||||
res, err = operation.execute(&pc, in, callContext)
|
res, err = operation.execute(&pc, in, callContext)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue