Commit e986fbdb authored by George Hotz's avatar George Hotz

500khz with nothing

parent 69cdd192
......@@ -42,6 +42,7 @@ contract MIPS {
// TODO: this is actually doing an SLOAD first
sstore(addr, value)
}
return stateHash;
}
}
......@@ -76,6 +77,8 @@ contract MIPS {
if (pc == 0xdead0000) {
return stateHash;
}
/*stateHash = WriteMemory(stateHash, REG_PC, pc+4);
return stateHash;*/
return stepNextPC(stateHash, pc, pc+4);
}
......
......@@ -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.
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) {
//fmt.Println(pc, op, gas)
evmInsCount += 1
}
// CaptureFault implements the Tracer interface to trace an execution fault
......@@ -190,6 +193,7 @@ func RunMinigeth(fn string, interpreter *vm.EVMInterpreter, bytecode []byte, ste
ram[0xc0000008] = 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) {
......@@ -235,9 +239,11 @@ func GetInterpreterAndBytecode() (*vm.EVMInterpreter, []byte) {
blockContext := core.NewEVMBlockContext(&header, bc, &author)
txContext := vm.TxContext{}
config := vm.Config{}
/*config.Debug = true
tracer := Tracer{}
config.Tracer = &tracer*/
evm := vm.NewEVM(blockContext, txContext, statedb, params.MainnetChainConfig, 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