aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-10-23 22:28:18 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-10-23 22:28:18 +0800
commit4c0883e20d78b987dc95acd46498f326626aaee3 (patch)
tree056c6ae87ae9e4746affe66058396162910021fa /cmd
parent3088c122d8497acf176f03a3f19f6292e817cab7 (diff)
downloadgo-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.tar
go-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.tar.gz
go-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.tar.bz2
go-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.tar.lz
go-tangerine-4c0883e20d78b987dc95acd46498f326626aaee3.tar.xz
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 'cmd')
-rw-r--r--cmd/evm/json_logger.go17
1 files changed, 9 insertions, 8 deletions
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()