Commit bd10a31d authored by George Hotz's avatar George Hotz

adding logger allows interpreter to be stock

parent 920aa20b
...@@ -43,8 +43,9 @@ core/vm/gas_table.go ...@@ -43,8 +43,9 @@ core/vm/gas_table.go
core/vm/gas.go core/vm/gas.go
core/vm/instructions.go core/vm/instructions.go
core/vm/interface.go core/vm/interface.go
#core/vm/interpreter.go core/vm/interpreter.go
core/vm/jump_table.go core/vm/jump_table.go
core/vm/logger.go
core/vm/memory_table.go core/vm/memory_table.go
core/vm/memory.go core/vm/memory.go
core/vm/opcodes.go core/vm/opcodes.go
......
...@@ -18,41 +18,13 @@ package vm ...@@ -18,41 +18,13 @@ package vm
import ( import (
"hash" "hash"
"math/big"
"sync/atomic" "sync/atomic"
"time"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/common/math"
//"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
// **** stub Tracer ****
type Tracer interface {
CaptureStart(env *EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int)
CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, rData []byte, depth int, err error)
CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, depth int, err error)
CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error)
}
/*type StubTracer struct{}
// CaptureStart implements the Tracer interface to initialize the tracing operation.
func (jst *StubTracer) CaptureStart(env *EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) {
}
// CaptureState implements the Tracer interface to trace a single step of VM execution.
func (jst *StubTracer) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, rData []byte, depth int, err error) {
}
// CaptureFault implements the Tracer interface to trace an execution fault
func (jst *StubTracer) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, depth int, err error) {
}
// CaptureEnd is called after the call finishes to finalize the tracing.
func (jst *StubTracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) {
}*/
// Config are the configuration options for the Interpreter // Config are the configuration options for the Interpreter
type Config struct { type Config struct {
Debug bool // Enables debugging Debug bool // Enables debugging
...@@ -125,7 +97,7 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { ...@@ -125,7 +97,7 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
if err := EnableEIP(eip, &jt); err != nil { if err := EnableEIP(eip, &jt); err != nil {
// Disable it, so caller can check if it's activated or not // Disable it, so caller can check if it's activated or not
cfg.ExtraEips = append(cfg.ExtraEips[:i], cfg.ExtraEips[i+1:]...) cfg.ExtraEips = append(cfg.ExtraEips[:i], cfg.ExtraEips[i+1:]...)
//log.Error("EIP activation failed", "eip", eip, "error", err) log.Error("EIP activation failed", "eip", eip, "error", err)
} }
} }
cfg.JumpTable = jt cfg.JumpTable = jt
...@@ -137,10 +109,6 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { ...@@ -137,10 +109,6 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
} }
} }
func (in *EVMInterpreter) GetCfg() *Config {
return &in.cfg
}
// Run loops and evaluates the contract's code with the given input data and returns // Run loops and evaluates the contract's code with the given input data and returns
// the return byte-slice and an error if one occurred. // the return byte-slice and an error if one occurred.
// //
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment