Commit e986fbdb authored by George Hotz's avatar George Hotz

500khz with nothing

parent 69cdd192
...@@ -42,6 +42,7 @@ contract MIPS { ...@@ -42,6 +42,7 @@ contract MIPS {
// TODO: this is actually doing an SLOAD first // TODO: this is actually doing an SLOAD first
sstore(addr, value) sstore(addr, value)
} }
return stateHash;
} }
} }
...@@ -76,6 +77,8 @@ contract MIPS { ...@@ -76,6 +77,8 @@ contract MIPS {
if (pc == 0xdead0000) { if (pc == 0xdead0000) {
return stateHash; return stateHash;
} }
/*stateHash = WriteMemory(stateHash, REG_PC, pc+4);
return stateHash;*/
return stepNextPC(stateHash, pc, pc+4); return stepNextPC(stateHash, pc, pc+4);
} }
......
...@@ -126,8 +126,11 @@ func (jst *Tracer) CaptureStart(env *vm.EVM, from common.Address, to common.Addr ...@@ -126,8 +126,11 @@ func (jst *Tracer) CaptureStart(env *vm.EVM, from common.Address, to common.Addr
} }
// CaptureState implements the Tracer interface to trace a single step of VM execution. // CaptureState implements the Tracer interface to trace a single step of VM execution.
var evmInsCount uint64 = 0
func (jst *Tracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) { func (jst *Tracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) {
//fmt.Println(pc, op, gas) //fmt.Println(pc, op, gas)
evmInsCount += 1
} }
// CaptureFault implements the Tracer interface to trace an execution fault // CaptureFault implements the Tracer interface to trace an execution fault
...@@ -190,6 +193,7 @@ func RunMinigeth(fn string, interpreter *vm.EVMInterpreter, bytecode []byte, ste ...@@ -190,6 +193,7 @@ func RunMinigeth(fn string, interpreter *vm.EVMInterpreter, bytecode []byte, ste
ram[0xc0000008] = 0 ram[0xc0000008] = 0
ram[0xc0000000+7*4] = 0 ram[0xc0000000+7*4] = 0
} }
fmt.Println("evm ins count", evmInsCount)
} }
func runTest(fn string, steps int, interpreter *vm.EVMInterpreter, bytecode []byte, gas uint64) (uint32, uint64) { func runTest(fn string, steps int, interpreter *vm.EVMInterpreter, bytecode []byte, gas uint64) (uint32, uint64) {
...@@ -235,9 +239,11 @@ func GetInterpreterAndBytecode() (*vm.EVMInterpreter, []byte) { ...@@ -235,9 +239,11 @@ func GetInterpreterAndBytecode() (*vm.EVMInterpreter, []byte) {
blockContext := core.NewEVMBlockContext(&header, bc, &author) blockContext := core.NewEVMBlockContext(&header, bc, &author)
txContext := vm.TxContext{} txContext := vm.TxContext{}
config := vm.Config{} config := vm.Config{}
/*config.Debug = true /*config.Debug = true
tracer := Tracer{} tracer := Tracer{}
config.Tracer = &tracer*/ config.Tracer = &tracer*/
evm := vm.NewEVM(blockContext, txContext, statedb, params.MainnetChainConfig, config) evm := vm.NewEVM(blockContext, txContext, statedb, params.MainnetChainConfig, config)
interpreter := vm.NewEVMInterpreter(evm, config) interpreter := vm.NewEVMInterpreter(evm, config)
......
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