Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6e8f697f
Commit
6e8f697f
authored
3 years ago
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename files for more logic
parent
5e621980
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
33 deletions
+7
-33
README
mipsevm/README
+5
-0
compare_evmchain_test.go
mipsevm/compare_evmchain_test.go
+2
-6
run_chain.go
mipsevm/run_chain.go
+0
-0
run_evm.go
mipsevm/run_evm.go
+0
-27
run_unicorn.go
mipsevm/run_unicorn.go
+0
-0
No files found.
mipsevm/README
View file @
6e8f697f
...
...
@@ -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
This diff is collapsed.
Click to expand it.
mipsevm/compare_evmchain_test.go
View file @
6e8f697f
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
mipsevm/
full
.go
→
mipsevm/
run_chain
.go
View file @
6e8f697f
File moved
This diff is collapsed.
Click to expand it.
mipsevm/
mips
evm.go
→
mipsevm/
run_
evm.go
View file @
6e8f697f
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
mipsevm/unicorn.go
→
mipsevm/
run_
unicorn.go
View file @
6e8f697f
File moved
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment