diff options
author | Martin Holst Swende <martin@swende.se> | 2018-10-23 22:28:18 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-10-23 22:28:18 +0800 |
commit | 4c0883e20d78b987dc95acd46498f326626aaee3 (patch) | |
tree | 056c6ae87ae9e4746affe66058396162910021fa /core/vm/logger.go | |
parent | 3088c122d8497acf176f03a3f19f6292e817cab7 (diff) | |
download | go-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.tar.gz go-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.tar.zst go-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.zip |
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.
Diffstat (limited to 'core/vm/logger.go')
-rw-r--r-- | core/vm/logger.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/core/vm/logger.go b/core/vm/logger.go index 85acb8d6d..1733bf270 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -56,16 +56,17 @@ type LogConfig struct { // StructLog is emitted to the EVM each cycle and lists information about the current internal state // prior to the execution of the statement. type StructLog struct { - Pc uint64 `json:"pc"` - Op OpCode `json:"op"` - Gas uint64 `json:"gas"` - GasCost uint64 `json:"gasCost"` - Memory []byte `json:"memory"` - MemorySize int `json:"memSize"` - Stack []*big.Int `json:"stack"` - Storage map[common.Hash]common.Hash `json:"-"` - Depth int `json:"depth"` - Err error `json:"-"` + Pc uint64 `json:"pc"` + Op OpCode `json:"op"` + Gas uint64 `json:"gas"` + GasCost uint64 `json:"gasCost"` + Memory []byte `json:"memory"` + MemorySize int `json:"memSize"` + Stack []*big.Int `json:"stack"` + Storage map[common.Hash]common.Hash `json:"-"` + Depth int `json:"depth"` + RefundCounter uint64 `json:"refund"` + Err error `json:"-"` } // overrides for gencodec @@ -177,7 +178,7 @@ func (l *StructLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost ui storage = l.changedValues[contract.Address()].Copy() } // create a new snaptshot of the EVM. - log := StructLog{pc, op, gas, cost, mem, memory.Len(), stck, storage, depth, err} + log := StructLog{pc, op, gas, cost, mem, memory.Len(), stck, storage, depth, env.StateDB.GetRefund(), err} l.logs = append(l.logs, log) return nil |