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
a01e998c
Commit
a01e998c
authored
Oct 27, 2022
by
Willem Olding
Committed by
norswap
Dec 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates tests with new call format
parent
25273b2f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
9 deletions
+10
-9
Makefile
Makefile
+1
-1
challenge_fault.sh
demo/challenge_fault.sh
+4
-4
challenge_simple.sh
demo/challenge_simple.sh
+3
-3
main.go
mipsevm/main.go
+1
-0
lib.js
scripts/lib.js
+1
-1
No files found.
Makefile
View file @
a01e998c
...
...
@@ -79,7 +79,7 @@ test_challenge:
minigeth/go-ethereum 13284469
# Generate initial
(
generic
)
MIPS memory checkpoint and final checkpoint
for
# block 13284469.
mipsevm/mipsevm
&&
mipsevm/mipsevm
13284469
mipsevm/mipsevm
--outputGolden
&&
mipsevm/mipsevm
--blockNumber
=
13284469
npx hardhat
test test
/challenge_test.js
.PHONY
:
test_challenge
...
...
demo/challenge_fault.sh
View file @
a01e998c
...
...
@@ -101,7 +101,7 @@ mkdir -p /tmp/cannon /tmp/cannon_fault && rm -rf /tmp/cannon/* /tmp/cannon_fault
# stored in /tmp/cannon/golden.json
shout
"GENERATING INITIAL MEMORY STATE CHECKPOINT"
mipsevm/mipsevm
mipsevm/mipsevm
--outputGolden
shout
"DEPLOYING CONTRACTS"
npx hardhat run scripts/deploy.js
--network
$NETWORK
...
...
@@ -113,7 +113,7 @@ shout "FETCHING PREIMAGES FOR REAL BLOCK"
minigeth/go-ethereum
$BLOCK
shout
"COMPUTING REAL MIPS FINAL MEMORY CHECKPOINT"
mipsevm/mipsevm
$BLOCK
mipsevm/mipsevm
--blockNumber
=
$BLOCK
# these are the preimages for the real block (but go into a different basedir)
shout
"FETCHING PREIMAGES FOR FAULTY BLOCK"
...
...
@@ -122,10 +122,10 @@ BASEDIR=/tmp/cannon_fault minigeth/go-ethereum $BLOCK
# since the computation includes a fault, the output file will be different than
# for the real block
shout
"COMPUTE FAKE MIPS CHECKPOINT"
OUTPUTFAULT
=
1
BASEDIR
=
/tmp/cannon_fault mipsevm/mipsevm
$BLOCK
OUTPUTFAULT
=
1
BASEDIR
=
/tmp/cannon_fault mipsevm/mipsevm
--blockNumber
=
$BLOCK
# alternatively, to inject a fault in registers instead of memory
# REGFAULT=13240000 BASEDIR=/tmp/cannon_fault mipsevm/mipsevm $BLOCK
# REGFAULT=13240000 BASEDIR=/tmp/cannon_fault mipsevm/mipsevm
--blockNumber=
$BLOCK
# --- BINARY SEARCH ------------------------------------------------------------
...
...
demo/challenge_simple.sh
View file @
a01e998c
...
...
@@ -97,7 +97,7 @@ mkdir -p /tmp/cannon /tmp/cannon_fault && rm -rf /tmp/cannon/* /tmp/cannon_fault
# stored in /tmp/cannon/golden.json
shout
"GENERATING INITIAL MEMORY STATE CHECKPOINT"
mipsevm/mipsevm
mipsevm/mipsevm
--outputGolden
shout
"DEPLOYING CONTRACTS"
npx hardhat run scripts/deploy.js
--network
$NETWORK
...
...
@@ -109,13 +109,13 @@ shout "FETCHING PREIMAGES FOR REAL BLOCK"
minigeth/go-ethereum
$BLOCK
shout
"COMPUTING REAL MIPS FINAL MEMORY CHECKPOINT"
mipsevm/mipsevm
$BLOCK
mipsevm/mipsevm
--blockNumber
=
$BLOCK
shout
"FETCHING PREIMAGES FOR WRONG BLOCK"
BASEDIR
=
/tmp/cannon_fault minigeth/go-ethereum
$WRONG_BLOCK
shout
"COMPUTING FAKE MIPS FINAL MEMORY CHECKPOINT"
BASEDIR
=
/tmp/cannon_fault mipsevm/mipsevm
$WRONG_BLOCK
BASEDIR
=
/tmp/cannon_fault mipsevm/mipsevm
--blockNumber
=
$WRONG_BLOCK
# pretend the wrong block's input, checkpoints and preimages are the right block's
ln
-s
/tmp/cannon_fault/0_
$WRONG_BLOCK
/tmp/cannon_fault/0_
$BLOCK
...
...
mipsevm/main.go
View file @
a01e998c
...
...
@@ -59,6 +59,7 @@ func main() {
lastStep
:=
1
if
evm
{
// TODO: fix this
log
.
Fatal
(
"EVM execution currently not supported"
)
/*ZeroRegisters(ram)
LoadMappedFile(programPath, ram, 0)
WriteCheckpoint(ram, "/tmp/cannon/golden.json", -1)
...
...
scripts/lib.js
View file @
a01e998c
...
...
@@ -112,7 +112,7 @@ function getTrieAtStep(blockNumberN, step) {
if
(
!
fs
.
existsSync
(
fn
))
{
console
.
log
(
"
running mipsevm
"
)
child_process
.
execSync
(
"
mipsevm/mipsevm
"
+
blockNumberN
.
toString
()
+
"
"
+
step
.
toString
(),
{
stdio
:
'
inherit
'
})
child_process
.
execSync
(
"
mipsevm/mipsevm
--blockNumber=
"
+
blockNumberN
.
toString
()
+
"
--target=
"
+
step
.
toString
(),
{
stdio
:
'
inherit
'
})
}
return
JSON
.
parse
(
fs
.
readFileSync
(
fn
))
...
...
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