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
027bcb41
Commit
027bcb41
authored
Oct 16, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diverging at step 11
parent
462199c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
full.go
mipsevm/full.go
+12
-1
full_test.go
mipsevm/full_test.go
+14
-0
mips_test_trie.js
test/mips_test_trie.js
+2
-1
No files found.
mipsevm/full.go
View file @
027bcb41
...
@@ -48,6 +48,16 @@ func addTrieNode(str []byte, interpreter *vm.EVMInterpreter, statedb *StateDB) {
...
@@ -48,6 +48,16 @@ func addTrieNode(str []byte, interpreter *vm.EVMInterpreter, statedb *StateDB) {
check
(
err
)
check
(
err
)
}
}
func
RunTest
()
{
ram
:=
make
(
map
[
uint32
](
uint32
))
LoadMappedFile
(
"test/bin/add.bin"
,
ram
,
0
)
ZeroRegisters
(
ram
)
ram
[
0xC000007C
]
=
0x5EAD0000
RunWithRam
(
ram
,
1
,
0
,
nil
)
}
func
RunFull
()
{
func
RunFull
()
{
interpreter
,
statedb
:=
GetInterpreter
(
0
,
true
)
interpreter
,
statedb
:=
GetInterpreter
(
0
,
true
)
deploy
(
interpreter
,
statedb
)
deploy
(
interpreter
,
statedb
)
...
@@ -55,6 +65,7 @@ func RunFull() {
...
@@ -55,6 +65,7 @@ func RunFull() {
ram
:=
make
(
map
[
uint32
](
uint32
))
ram
:=
make
(
map
[
uint32
](
uint32
))
//LoadMappedFile("../mipigo/test/test.bin", ram, 0)
//LoadMappedFile("../mipigo/test/test.bin", ram, 0)
LoadMappedFile
(
"test/bin/add.bin"
,
ram
,
0
)
LoadMappedFile
(
"test/bin/add.bin"
,
ram
,
0
)
ZeroRegisters
(
ram
)
ZeroRegisters
(
ram
)
ram
[
0xC000007C
]
=
0x5EAD0000
ram
[
0xC000007C
]
=
0x5EAD0000
root
:=
RamToTrie
(
ram
)
root
:=
RamToTrie
(
ram
)
...
@@ -69,7 +80,7 @@ func RunFull() {
...
@@ -69,7 +80,7 @@ func RunFull() {
fmt
.
Println
(
"trie is ready, let's run"
)
fmt
.
Println
(
"trie is ready, let's run"
)
fmt
.
Println
(
"state root"
,
root
,
"nodes"
,
len
(
Preimages
))
fmt
.
Println
(
"state root"
,
root
,
"nodes"
,
len
(
Preimages
))
for
step
:=
0
;
step
<
1
0
;
step
++
{
for
step
:=
0
;
step
<
4
0
;
step
++
{
// it's run o clock
// it's run o clock
from
:=
common
.
Address
{}
from
:=
common
.
Address
{}
to
:=
common
.
HexToAddress
(
"0x1337"
)
to
:=
common
.
HexToAddress
(
"0x1337"
)
...
...
mipsevm/full_test.go
View file @
027bcb41
package
main
package
main
import
(
import
(
"fmt"
"testing"
"testing"
)
)
func
TestFull
(
t
*
testing
.
T
)
{
func
TestFull
(
t
*
testing
.
T
)
{
RunFull
()
RunFull
()
}
}
func
TestFullEvm
(
t
*
testing
.
T
)
{
ram
:=
make
(
map
[
uint32
](
uint32
))
LoadMappedFile
(
"test/bin/add.bin"
,
ram
,
0
)
ZeroRegisters
(
ram
)
ram
[
0xC000007C
]
=
0x5EAD0000
for
step
:=
0
;
step
<
12
;
step
++
{
RunWithRam
(
ram
,
1
,
0
,
nil
)
root
:=
RamToTrie
(
ram
)
fmt
.
Println
(
step
,
root
)
}
}
test/mips_test_trie.js
View file @
027bcb41
...
@@ -14,7 +14,8 @@ describe("MIPS contract", function () {
...
@@ -14,7 +14,8 @@ describe("MIPS contract", function () {
}
}
let
root
=
trieAdd
[
'
root
'
]
let
root
=
trieAdd
[
'
root
'
]
for
(
let
i
=
0
;
i
<
15
;
i
++
)
{
console
.
log
(
"
start
"
,
root
)
for
(
let
i
=
0
;
i
<
12
;
i
++
)
{
ret
=
await
m
.
Step
(
root
)
ret
=
await
m
.
Step
(
root
)
const
receipt
=
await
ret
.
wait
()
const
receipt
=
await
ret
.
wait
()
for
(
l
of
receipt
.
logs
)
{
for
(
l
of
receipt
.
logs
)
{
...
...
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