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
d34531cd
Commit
d34531cd
authored
Oct 12, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
have to move that too
parent
c22b2fdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Challenge.sol
contracts/Challenge.sol
+8
-8
No files found.
contracts/Challenge.sol
View file @
d34531cd
...
...
@@ -90,19 +90,19 @@ contract Challenge {
// the first instruction executed in MIPS should be an access of startState
// parentblockhash, txhash, coinbase, unclehash, gaslimit, time
bytes32 startState = GlobalStartState;
startState = mem.WriteBytes32(startState, 0x
3
0000000, parentHash);
startState = mem.WriteBytes32(startState, 0x
3
0000020, Lib_RLPReader.readBytes32(blockNp1[4]));
startState = mem.WriteBytes32(startState, 0x
3
0000040, bytes32(uint256(Lib_RLPReader.readAddress(blockNp1[2]))));
startState = mem.WriteBytes32(startState, 0x
3
0000060, Lib_RLPReader.readBytes32(blockNp1[1]));
startState = mem.WriteBytes32(startState, 0x
3
0000080, bytes32(Lib_RLPReader.readUint256(blockNp1[9])));
startState = mem.WriteBytes32(startState, 0x
3
00000a0, bytes32(Lib_RLPReader.readUint256(blockNp1[11])));
startState = mem.WriteBytes32(startState, 0x
B
0000000, parentHash);
startState = mem.WriteBytes32(startState, 0x
B
0000020, Lib_RLPReader.readBytes32(blockNp1[4]));
startState = mem.WriteBytes32(startState, 0x
B
0000040, bytes32(uint256(Lib_RLPReader.readAddress(blockNp1[2]))));
startState = mem.WriteBytes32(startState, 0x
B
0000060, Lib_RLPReader.readBytes32(blockNp1[1]));
startState = mem.WriteBytes32(startState, 0x
B
0000080, bytes32(Lib_RLPReader.readUint256(blockNp1[9])));
startState = mem.WriteBytes32(startState, 0x
B
00000a0, bytes32(Lib_RLPReader.readUint256(blockNp1[11])));
// 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
// we disagree at the end
require(mem.ReadMemory(finalSystemState, 0xC0000080) == 0x5EAD0000, "machine is not stopped in final state (PC == 0x5EAD0000)");
require(mem.ReadMemory(finalSystemState, 0x
3
0000800) == 0x1337f00d, "state is not outputted");
require(mem.ReadBytes32(finalSystemState, 0x
3
0000804) == assertionRoot, "you are claiming a different state root in machine");
require(mem.ReadMemory(finalSystemState, 0x
B
0000800) == 0x1337f00d, "state is not outputted");
require(mem.ReadBytes32(finalSystemState, 0x
B
0000804) == assertionRoot, "you are claiming a different state root in machine");
return newChallengeTrusted(startState, finalSystemState, stepCount);
}
...
...
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