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
e32d3502
Commit
e32d3502
authored
Oct 28, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ugh, still failing
parent
dc8ce147
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
Lib_MerkleTrie.sol
contracts/lib/Lib_MerkleTrie.sol
+1
-0
trie_test.go
mipsevm/trie_test.go
+22
-12
mips_test_memory.js
test/mips_test_memory.js
+1
-2
No files found.
contracts/lib/Lib_MerkleTrie.sol
View file @
e32d3502
...
@@ -659,6 +659,7 @@ library Lib_MerkleTrie {
...
@@ -659,6 +659,7 @@ library Lib_MerkleTrie {
if (itemType == Lib_RLPReader.RLPItemType.DATA_ITEM) {
if (itemType == Lib_RLPReader.RLPItemType.DATA_ITEM) {
return Lib_RLPReader._copy(_in.ptr, itemOffset, itemLength);
return Lib_RLPReader._copy(_in.ptr, itemOffset, itemLength);
} else {
} else {
require(_in.length < 32, "bad _getNodeValue other");
return Lib_RLPReader._copy(_in.ptr, 0, _in.length);
return Lib_RLPReader._copy(_in.ptr, 0, _in.length);
}
}
}
}
...
...
mipsevm/trie_test.go
View file @
e32d3502
...
@@ -22,23 +22,33 @@ func TestTrie(t *testing.T) {
...
@@ -22,23 +22,33 @@ func TestTrie(t *testing.T) {
ioutil
.
WriteFile
(
"/tmp/eth/ramtrie"
,
dat
,
0644
)
ioutil
.
WriteFile
(
"/tmp/eth/ramtrie"
,
dat
,
0644
)
}
}
func
TestBuggedTrie
(
t
*
testing
.
T
)
{
func
printRoot
(
ram
map
[
uint32
](
uint32
))
{
ram
:=
make
(
map
[
uint32
](
uint32
))
root
:=
RamToTrie
(
ram
)
fmt
.
Println
(
"root ="
,
root
)
ram
[
0
]
=
1
}
ram
[
4
]
=
2
func
printTrie
(
ram
map
[
uint32
](
uint32
))
{
root
:=
RamToTrie
(
ram
)
root
:=
RamToTrie
(
ram
)
fmt
.
Println
(
"root
(0,4)
="
,
root
)
fmt
.
Println
(
"root ="
,
root
)
ParseNode
(
root
,
0
,
func
(
t
common
.
Hash
)
[]
byte
{
ParseNode
(
root
,
0
,
func
(
t
common
.
Hash
)
[]
byte
{
return
Preimages
[
t
]
return
Preimages
[
t
]
})
})
}
ram
[
0x40
]
=
3
func
TestBuggedTrie
(
t
*
testing
.
T
)
{
ram
:=
make
(
map
[
uint32
](
uint32
))
root
=
RamToTrie
(
ram
)
ram
[
0
]
=
1
fmt
.
Println
(
"root(0,4,0x40) ="
,
root
)
ram
[
4
]
=
2
ParseNode
(
root
,
0
,
func
(
t
common
.
Hash
)
[]
byte
{
printTrie
(
ram
)
return
Preimages
[
t
]
})
ram
[
0x40
]
=
3
printTrie
(
ram
)
ram
=
make
(
map
[
uint32
](
uint32
))
ram
[
0x7fffd00c
]
=
1
ram
[
0x7fffd010
]
=
2
printTrie
(
ram
)
ram
[
0x7fffcffc
]
=
3
printTrie
(
ram
)
}
}
test/mips_test_memory.js
View file @
e32d3502
...
@@ -39,11 +39,10 @@ describe("MIPSMemory contract", function () {
...
@@ -39,11 +39,10 @@ describe("MIPSMemory contract", function () {
expect
(
await
mm
.
ReadMemory
(
root
,
4
)).
to
.
equal
(
2
)
expect
(
await
mm
.
ReadMemory
(
root
,
4
)).
to
.
equal
(
2
)
expect
(
await
mm
.
ReadMemory
(
root
,
0x40
)).
to
.
equal
(
3
)
expect
(
await
mm
.
ReadMemory
(
root
,
0x40
)).
to
.
equal
(
3
)
})
})
it
(
"
write
four
should work
"
,
async
function
()
{
it
(
"
write
other three
should work
"
,
async
function
()
{
await
mm
.
AddTrieNode
(
new
Uint8Array
([
0x80
]))
await
mm
.
AddTrieNode
(
new
Uint8Array
([
0x80
]))
let
root
=
"
0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421
"
let
root
=
"
0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421
"
root
=
await
write
(
mm
,
root
,
0xc0000080
,
0xaa
)
root
=
await
write
(
mm
,
root
,
0x7fffd00c
,
1
)
root
=
await
write
(
mm
,
root
,
0x7fffd00c
,
1
)
root
=
await
write
(
mm
,
root
,
0x7fffd010
,
2
)
root
=
await
write
(
mm
,
root
,
0x7fffd010
,
2
)
root
=
await
write
(
mm
,
root
,
0x7fffcffc
,
3
)
root
=
await
write
(
mm
,
root
,
0x7fffcffc
,
3
)
...
...
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