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
70a1cd1f
Commit
70a1cd1f
authored
Nov 09, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wee we did a challenge
parent
03413842
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
README.md
README.md
+1
-1
main.go
mipsevm/main.go
+8
-13
assert.js
scripts/assert.js
+1
-1
No files found.
README.md
View file @
70a1cd1f
...
...
@@ -67,6 +67,7 @@ minigeth/go-ethereum 1171895 && mipsevm/mipsevm 1171895
minigeth/go-ethereum 10 && mipsevm/mipsevm 10
BLOCK=1171895 npx hardhat run scripts/challenge.js
# do binary search
for i in {1..23}
do
ID=0 BLOCK=10 CHALLENGER=1 npx hardhat run scripts/respond.js
...
...
@@ -78,7 +79,6 @@ ID=0 BLOCK=10 CHALLENGER=1 npx hardhat run scripts/assert.js
# assert as defender (passes)
ID=0 BLOCK=1171895 npx hardhat run scripts/assert.js
```
## State Oracle API
...
...
mipsevm/main.go
View file @
70a1cd1f
...
...
@@ -36,19 +36,20 @@ func main() {
lastStep
:=
1
if
evm
{
ZeroRegisters
(
ram
)
// TODO: fix this
/*ZeroRegisters(ram)
LoadMappedFile("mipigo/minigeth.bin", ram, 0)
WriteCheckpoint(ram, "/tmp/cannon/golden.json", -1)
LoadMappedFile(fmt.Sprintf("%s/input", root), ram, 0x30000000)
RunWithRam(ram, target-1, 0, root, nil)
lastStep += target - 1
fn := fmt.Sprintf("%s/checkpoint_%d.json", root, lastStep)
WriteCheckpoint
(
ram
,
fn
,
lastStep
)
WriteCheckpoint(ram, fn, lastStep)
*/
}
else
{
mu
:=
GetHookedUnicorn
(
root
,
ram
,
func
(
l
step
int
,
mu
uc
.
Unicorn
,
ram
map
[
uint32
](
uint32
))
{
step
:=
lstep
+
1
mu
:=
GetHookedUnicorn
(
root
,
ram
,
func
(
step
int
,
mu
uc
.
Unicorn
,
ram
map
[
uint32
](
uint32
))
{
// it seems this runs before the actual step happens
// this can be raised to 10,000,000 if the files are too large
if
step
%
10000000
==
0
||
step
==
target
{
if
(
target
==
-
1
&&
step
%
10000000
==
0
)
||
step
==
target
{
SyncRegs
(
mu
,
ram
)
fn
:=
fmt
.
Sprintf
(
"%s/checkpoint_%d.json"
,
root
,
step
)
WriteCheckpoint
(
ram
,
fn
,
step
)
...
...
@@ -57,7 +58,8 @@ func main() {
mu
.
RegWrite
(
uc
.
MIPS_REG_PC
,
0x5ead0004
)
}
}
lastStep
=
step
// TODO: is this where the plus 1 goes?
lastStep
=
step
+
1
})
ZeroRegisters
(
ram
)
...
...
@@ -72,13 +74,6 @@ func main() {
// TODO: this is actually step 0->1. Renumber as appropriate
LoadMappedFileUnicorn
(
mu
,
fmt
.
Sprintf
(
"%s/input"
,
root
),
ram
,
0x30000000
)
if
target
==
0
{
// no actual running at step 0
fn
:=
fmt
.
Sprintf
(
"%s/checkpoint_%d.json"
,
root
,
target
)
WriteCheckpoint
(
ram
,
fn
,
target
)
return
}
mu
.
Start
(
0
,
0x5ead0004
)
SyncRegs
(
mu
,
ram
)
}
...
...
scripts/assert.js
View file @
70a1cd1f
...
...
@@ -42,7 +42,7 @@ async function main() {
}
let
receipt
=
await
ret
.
wait
()
console
.
log
(
receipt
)
console
.
log
(
receipt
.
events
.
map
((
x
)
=>
x
.
event
)
)
}
main
()
...
...
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