225 Commits

Author SHA1 Message Date
Daniel Lubarov
0de392b335 Fix optimization 2022-10-02 11:51:49 -07:00
Daniel Lubarov
9f9143d6f6 Finish some misc storage logic 2022-10-02 11:14:19 -07:00
Daniel Lubarov
9d22e376d0 Add TODO 2022-10-02 09:27:29 -07:00
Daniel Lubarov
9e483528d3 MPT hashing logic, part 3 2022-10-02 09:11:39 -07:00
Daniel Lubarov
f2f05952ab MPT hashing logic, part 2 2022-10-01 20:02:42 -07:00
Daniel Lubarov
12247047ae MPT hashing logic, part 1 2022-09-30 17:02:25 -07:00
Nicholas Ward
faaaa0e0e2
Merge pull request #742 from mir-protocol/msize
MSIZE
2022-09-30 09:11:43 -07:00
Nicholas Ward
f6ff07840f fixes 2022-09-30 09:05:18 -07:00
BGluth
09ba1b6fce
Merge pull request #740 from mir-protocol/h256_trie_roots
Trie roots now use `H256` instead of `U256`
2022-09-30 09:32:09 -06:00
Nicholas Ward
ea135341e8 MSIZE 2022-09-29 23:35:02 -07:00
Daniel Lubarov
c721155e23 Main function, txn processing loop 2022-09-29 23:15:33 -07:00
BGluth
7e6844963a Few small changes related to switching to H256 2022-09-29 17:24:23 -06:00
Daniel Lubarov
5555085c4c MPT read for extension nodes 2022-09-27 21:41:22 -07:00
Daniel Lubarov
0e48d58147 Finish MPT read logic 2022-09-26 19:13:17 -07:00
Daniel Lubarov
c7b03cfe9a More MPT logic 2022-09-24 20:49:19 -07:00
Nicholas Ward
26fcd9eed4 fmt 2022-09-23 11:49:30 -07:00
Nicholas Ward
2b298e39eb stack manipulation: allow empty LHS 2022-09-23 11:49:13 -07:00
Daniel Lubarov
dbb0503d3e Support macro overloading 2022-09-22 20:22:57 -07:00
Daniel Lubarov
c27e40e7bb
Merge pull request #731 from mir-protocol/mpt
Basic MPT logic
2022-09-22 12:06:16 -07:00
Daniel Lubarov
37d92b55ac Basic MPT logic
For now this contains most of the basic framework/structure. Logic for things like insertions will come later.
2022-09-22 11:25:37 -07:00
Daniel Lubarov
218f689422 Fix prohibited macro names 2022-09-21 13:10:16 -07:00
Daniel Lubarov
f876a8ab02 Fix macro vars in %stack directive 2022-09-21 08:42:56 -07:00
Daniel Lubarov
3fc7996d79
Merge pull request #683 from mir-protocol/call_common
Fill in call_common routine
2022-09-17 12:00:49 -07:00
Nicholas Ward
a5f34d9a2e fix 2022-09-13 22:03:25 -07:00
Nicholas Ward
b25986ce57 parentheses change 2022-09-13 22:03:25 -07:00
Nicholas Ward
0b9881c5e3 blocks in stack manipulation 2022-09-09 12:05:58 -07:00
Daniel Lubarov
fdb6cafe18 Fill in call_common routine 2022-09-07 16:42:21 -07:00
Daniel Lubarov
9b259cb917 Feedback 2022-09-05 10:12:23 -07:00
Daniel Lubarov
aaf7ace396 Remove JUMPDESTs 2022-09-04 22:31:56 -07:00
Nicholas Ward
df15031145 clippy: remove unused 'peekable' 2022-09-02 15:40:24 -07:00
Jacqueline Nabaglo
4c52d37546
Save columns by verifying invalid opcodes in software (#701)
* Save columns by verifying invalid opcodes in software

* Autogenerate invalid opcode bitfield (Daniel comment)

* Remove unnecessary panic label
2022-08-30 13:06:03 -07:00
Daniel Lubarov
8505d64e37 Fill in keccakf_u32s 2022-08-30 12:28:08 -07:00
Daniel Lubarov
d0be79e822 Feedback 2022-08-25 23:35:38 -07:00
Daniel Lubarov
aa87f2c3ba Public memory 2022-08-25 20:19:18 -07:00
Daniel Lubarov
ce456fb8ea
Merge pull request #665 from mir-protocol/trie_metadata
Trie related segments and metadata
2022-08-22 17:30:28 -07:00
Jacqueline Nabaglo
b98dd47820
Permission levels, jumps, traps (#653)
* Permission levels, jumps, traps

* Tests passing

* PR comments + documentation

* Docs + minor bugfixes

* Tests

* Use already-defined `stop` and `exception` (but renamed to `sys_stop`, `fault_exception`)

* Daniel comments
2022-08-16 09:46:10 -07:00
Daniel Lubarov
232303b9ec
Merge pull request #666 from mir-protocol/rlp_encode
RLP encoding functions
2022-08-15 12:19:04 -07:00
Daniel Lubarov
97b271bf69
Merge pull request #663 from mir-protocol/use_mstore_txn_field
Make use of `mstore_txn_field` in type 0 parsing
2022-08-15 11:41:18 -07:00
Daniel Lubarov
539152d767 RLP encoding functions 2022-08-14 11:41:53 -07:00
Daniel Lubarov
6a7e8d0fb0 Trie related segments and metadata
Summary of the design:
- Tries are stored as immutable, copy-on-write trees
- All trie data is stored in the `TrieData` segment. Since it's immutable, data is never modified/deleted, new versions are just appended at the end.
- In order to support reverts, each context stores a pointer to the initial state trie version, plus the initial version of each storage trie.

One variation which may be worth considering is storing the whole state trie as one big trie (with sub-tries for storage). Reverts would then be simpler - we'd replace a single pointer. I thought that approach might make hashing the trie a bit more complex, as the node associated with an account would be a special type of node, rather than just another leaf. Either approach seems reasonable though.
2022-08-13 13:24:58 -07:00
Daniel Lubarov
f52e005307 Add static 2022-08-13 12:17:19 -07:00
Daniel Lubarov
6ea801d960 TODOs 2022-08-13 10:23:29 -07:00
Daniel Lubarov
74b1fd25e6 TODOs 2022-08-12 17:37:00 -07:00
Daniel Lubarov
cc61c7211c Core transaction processing logic
With lots of TODOs to fill in afterward; this is just a start.
2022-08-12 17:20:18 -07:00
Daniel Lubarov
1763b6bc37
Merge pull request #662 from mir-protocol/stack_pruning_opt_perms
For permutations, find the optimal sequence of swaps
2022-08-12 17:19:47 -07:00
Daniel Lubarov
288ff63945 Fix shift ordering 2022-08-10 21:47:37 -07:00
Daniel Lubarov
707e564934 Make use of mstore_txn_field in type 0 parsing
Some of the `%stack` operations are now trivial, but I kind of like keeping `%stack` since it serves as documentation as well, making comments about the stack unnecessary.
2022-08-09 18:44:41 -04:00
Daniel Lubarov
763d63de08 For permutations, find the optimal sequence of swaps
Using a method Angus described. This is mainly his idea and code, I just ported it to Rust.
2022-08-09 16:33:02 -04:00
Daniel Lubarov
68de3ee0c6
Merge pull request #660 from mir-protocol/packing
Packing memory operations
2022-08-08 14:23:49 -04:00
Daniel Lubarov
5f14bef57e
Merge pull request #655 from mir-protocol/more_metadata
More metadata fields
2022-08-05 14:08:51 -05:00