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
751fbcde
Commit
751fbcde
authored
Oct 31, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor challenge to use inputhash, and remove wrong test
parent
df6dfbb8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
test_mipsevm.yml
.github/workflows/test_mipsevm.yml
+0
-2
Challenge.sol
contracts/Challenge.sol
+8
-7
No files found.
.github/workflows/test_mipsevm.yml
View file @
751fbcde
...
@@ -20,8 +20,6 @@ jobs:
...
@@ -20,8 +20,6 @@ jobs:
run
:
|
run
:
|
npm install --global yarn
npm install --global yarn
yarn install
yarn install
-
name
:
Test MIPS on EVM
run
:
cd mipsevm && ./evm.sh
-
name
:
Build minigeth and run default block (cache)
-
name
:
Build minigeth and run default block (cache)
run
:
|
run
:
|
./run.sh
./run.sh
...
...
contracts/Challenge.sol
View file @
751fbcde
...
@@ -88,14 +88,15 @@ contract Challenge {
...
@@ -88,14 +88,15 @@ contract Challenge {
// load starting info into the input oracle
// load starting info into the input oracle
// we both agree at the beginning
// we both agree at the beginning
// the first instruction executed in MIPS should be an access of startState
// the first instruction executed in MIPS should be an access of startState
// parentblockhash, txhash, coinbase, unclehash, gaslimit, time
bytes32 txhash = Lib_RLPReader.readBytes32(blockNp1[4]);
bytes32 coinbase = bytes32(uint256(Lib_RLPReader.readAddress(blockNp1[2])));
bytes32 unclehash = Lib_RLPReader.readBytes32(blockNp1[1]);
bytes32 gaslimit = bytes32(Lib_RLPReader.readUint256(blockNp1[9]));
bytes32 time = bytes32(Lib_RLPReader.readUint256(blockNp1[11]));
bytes32 inputHash = keccak256(abi.encodePacked(parentHash, txhash, coinbase, unclehash, gaslimit, time));
bytes32 startState = GlobalStartState;
bytes32 startState = GlobalStartState;
startState = mem.WriteBytes32(startState, 0xB0000000, parentHash);
startState = mem.WriteBytes32(startState, 0xB0000000, inputHash);
startState = mem.WriteBytes32(startState, 0xB0000020, Lib_RLPReader.readBytes32(blockNp1[4]));
startState = mem.WriteBytes32(startState, 0xB0000040, bytes32(uint256(Lib_RLPReader.readAddress(blockNp1[2]))));
startState = mem.WriteBytes32(startState, 0xB0000060, Lib_RLPReader.readBytes32(blockNp1[1]));
startState = mem.WriteBytes32(startState, 0xB0000080, bytes32(Lib_RLPReader.readUint256(blockNp1[9])));
startState = mem.WriteBytes32(startState, 0xB00000a0, bytes32(Lib_RLPReader.readUint256(blockNp1[11])));
// confirm the finalSystemHash asserts the state you claim (in $t0-$t7) and the machine is stopped
// confirm the finalSystemHash asserts the state you claim (in $t0-$t7) and the machine is stopped
// you must load these proofs into MIPS before calling this
// you must load these proofs into MIPS before calling this
...
...
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