From 4c0883e20d78b987dc95acd46498f326626aaee3 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 23 Oct 2018 16:28:18 +0200 Subject: core/vm: adds refund as part of the json standard trace (#17910) This adds the global accumulated refund counter to the standard json output as a numeric json value. Previously this was not very interesting since it was not used much, but with the new sstore gas changes the value is a lot more interesting from a consensus investigation perspective. --- cmd/evm/json_logger.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cmd/evm') diff --git a/cmd/evm/json_logger.go b/cmd/evm/json_logger.go index f16424fbe..50cb4f0e4 100644 --- a/cmd/evm/json_logger.go +++ b/cmd/evm/json_logger.go @@ -45,14 +45,15 @@ func (l *JSONLogger) CaptureStart(from common.Address, to common.Address, create // CaptureState outputs state information on the logger. func (l *JSONLogger) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, depth int, err error) error { log := vm.StructLog{ - Pc: pc, - Op: op, - Gas: gas, - GasCost: cost, - MemorySize: memory.Len(), - Storage: nil, - Depth: depth, - Err: err, + Pc: pc, + Op: op, + Gas: gas, + GasCost: cost, + MemorySize: memory.Len(), + Storage: nil, + Depth: depth, + RefundCounter: env.StateDB.GetRefund(), + Err: err, } if !l.cfg.DisableMemory { log.Memory = memory.Data() -- cgit v1.2.3