Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hadv committed Jul 26, 2023
1 parent 31617d5 commit 0b13282
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
}
// Static portion of gas
cost = operation.constantGas // For tracing
log.Info("operation", "cost", cost)
if !contract.UseGas(operation.constantGas) {
return nil, ErrOutOfGas
}
Expand All @@ -245,6 +246,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
if operation.dynamicGas != nil {
var dynamicCost uint64
dynamicCost, err = operation.dynamicGas(in.evm, contract, stack, mem, memorySize)
log.Info("dynamicCost", "dynamicCost", dynamicCost)
cost += dynamicCost // total cost, for debug tracing
if err != nil || !contract.UseGas(dynamicCost) {
return nil, ErrOutOfGas
Expand Down

0 comments on commit 0b13282

Please sign in to comment.