diff --git a/core/vm/evm.go b/core/vm/evm.go index 6ab7642544..6137d0f740 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -545,6 +545,8 @@ func (evm *EVM) captureEnd(depth int, typ OpCode, startGas uint64, leftOverGas u } } +// GetVMContext provides context about the block being executed as well as state +// to the tracers. func (evm *EVM) GetVMContext() *tracing.VMContext { return &tracing.VMContext{ Coinbase: evm.Context.Coinbase, diff --git a/eth/tracers/logger/logger.go b/eth/tracers/logger/logger.go index f8ebe52aa2..9d6f4c8a19 100644 --- a/eth/tracers/logger/logger.go +++ b/eth/tracers/logger/logger.go @@ -184,9 +184,7 @@ func (l *StructLogger) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scope var stck []uint256.Int if !l.cfg.DisableStack { stck = make([]uint256.Int, len(stack)) - for i, item := range stack { - stck[i] = item - } + copy(stck, stack) } contractAddr := scope.Address() stackLen := len(stack)