Commit 6e8f697f authored by George Hotz's avatar George Hotz

rename files for more logic

parent 5e621980
......@@ -25,3 +25,8 @@ Instruction set used by minigeth, 55 instructions:
'xor', 'xori']
STEPS=100000000 ./evm.sh unicorn ../mipigo/minigeth.bin
There's three ways to run this, see "run_<type>":
* unicorn -- fastest, uses none of the solidity
* evm -- uses MIPS.sol, but stubs MIPSMemory.sol and doesn't compute the merkle trie
* chain -- uses MIPS.sol + MIPSMemory.sol, will actually run on chain like this
......@@ -20,10 +20,6 @@ func LoadRam() map[uint32](uint32) {
return ram
}
/*func TestFullSlow(t *testing.T) {
RunFull()
}*/
// go test -run TestCompareEvmChain
func TestCompareEvmChain(t *testing.T) {
......@@ -48,7 +44,7 @@ func TestCompareEvmChain(t *testing.T) {
AddTrieNode(v, interpreter, statedb)
}
// run on chain
// run on (fake) chain
go func(root common.Hash) {
for step := 0; step < totalSteps; step++ {
steps := 1
......@@ -69,7 +65,7 @@ func TestCompareEvmChain(t *testing.T) {
}
}(root)
// run in unicorn
// run on evm
go func() {
for step := 0; step < totalSteps; step++ {
RunWithRam(ram, 1, 0, nil)
......
......@@ -17,29 +17,6 @@ import (
var ministart time.Time
// **** stub Tracer ****
type Tracer struct{}
// CaptureStart implements the Tracer interface to initialize the tracing operation.
func (jst *Tracer) CaptureStart(env *vm.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.
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
func (jst *Tracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error) {
}
// CaptureEnd is called after the call finishes to finalize the tracing.
func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) {
}
type jsoncontract struct {
Bytecode string `json:"bytecode"`
DeployedBytecode string `json:"deployedBytecode"`
......@@ -68,10 +45,6 @@ func GetInterpreter(ldebug int, realState bool) (*vm.EVMInterpreter, *StateDB) {
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