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
cf7df3a0
Commit
cf7df3a0
authored
Dec 08, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up done TODOs
parent
28920a00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
4 deletions
+0
-4
MIPSMemory.sol
contracts/MIPSMemory.sol
+0
-4
No files found.
contracts/MIPSMemory.sol
View file @
cf7df3a0
...
@@ -5,15 +5,12 @@ import "./lib/Lib_Keccak256.sol";
...
@@ -5,15 +5,12 @@ import "./lib/Lib_Keccak256.sol";
import "./lib/Lib_MerkleTrie.sol";
import "./lib/Lib_MerkleTrie.sol";
contract MIPSMemory {
contract MIPSMemory {
// TODO: the trie library should read and write from this as appropriate
mapping(bytes32 => bytes) public trie;
mapping(bytes32 => bytes) public trie;
function AddTrieNode(bytes calldata anything) public {
function AddTrieNode(bytes calldata anything) public {
Lib_MerkleTrie.GetTrie()[keccak256(anything)] = anything;
Lib_MerkleTrie.GetTrie()[keccak256(anything)] = anything;
}
}
// TODO: replace with mapping(bytes32 => mapping(uint, bytes4))
// to only save the part we care about
struct Preimage {
struct Preimage {
uint length;
uint length;
mapping(uint => uint64) data;
mapping(uint => uint64) data;
...
@@ -77,7 +74,6 @@ contract MIPSMemory {
...
@@ -77,7 +74,6 @@ contract MIPSMemory {
largePreimage[msg.sender].len += 136;
largePreimage[msg.sender].len += 136;
}
}
// TODO: input <136 bytes and do the end of hash | 0x01 / | 0x80
function AddLargePreimageFinal(bytes calldata idat) public view returns (bytes32, uint, uint32) {
function AddLargePreimageFinal(bytes calldata idat) public view returns (bytes32, uint, uint32) {
require(idat.length < 136, "final must be less than 136");
require(idat.length < 136, "final must be less than 136");
int offset = int(largePreimage[msg.sender].offset) - int(largePreimage[msg.sender].len);
int offset = int(largePreimage[msg.sender].offset) - int(largePreimage[msg.sender].len);
...
...
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