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
137076c964
Revert "Add static"
...
This reverts commit 90c4e1b9d1cad9309c0cbcaeff52c172167b2c1c.
2022-08-13 12:16:19 -07:00
Daniel Lubarov
90c4e1b9d1
Add static
2022-08-13 12:15:42 -07:00
Daniel Lubarov
6ea801d960
TODOs
2022-08-13 10:23:29 -07:00
Daniel Lubarov
4c0c93ff56
Merge pull request #652 from mir-protocol/transaction_processing
...
Core transaction processing logic
2022-08-12 17:37:08 -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
cf0de26ddf
Merge pull request #664 from mir-protocol/fix_shift_propagation
...
Fix shift order in constant propagation
2022-08-11 12:57:22 -04:00
Daniel Lubarov
288ff63945
Fix shift ordering
2022-08-10 21:47:37 -07: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
65a20bcd8a
Merge remote-tracking branch 'proxima/log-portability'
2022-08-06 23:00:32 -04:00
Sebastien La Duca
86c1493d3d
Merge pull request #1 from mir-protocol/log-portability-stubs
...
Log portability stubs
2022-08-06 22:34:53 -04:00
Daniel Lubarov
385a990c50
Unsuppress warnings
2022-08-06 22:27:17 -04:00
Daniel Lubarov
1e5383c63d
Stub push/pop
2022-08-06 22:18:53 -04:00
Daniel Lubarov
0263116e6c
Merge pull request #661 from proxima-one/no-rand-2
...
feature-gate rand
2022-08-06 22:07:14 -04:00
Sladuca
e7216f2683
feature-gate rand
2022-08-06 11:35:41 -04:00
Sladuca
3d5a9174fd
remove explicit feature include
2022-08-06 11:17:36 -04:00
Daniel Lubarov
94def938aa
Merge pull request #654 from proxima-one/make-gates-public
...
Make the rest of gates public
2022-08-05 22:30:31 -05:00
Nicholas Ward
ed3ac7b29d
Merge pull request #658 from mir-protocol/memory_stark_fix
...
Memory Stark fix
2022-08-05 15:33:00 -07:00
Daniel Lubarov
5f14bef57e
Merge pull request #655 from mir-protocol/more_metadata
...
More metadata fields
2022-08-05 14:08:51 -05:00
Daniel Lubarov
ccc4202de3
Packing memory operations
2022-08-05 13:44:08 -04:00
Daniel Lubarov
b741458d02
Merge pull request #659 from mir-protocol/macro_labels
...
Support macro-local labels
2022-08-05 09:13:24 -05:00
Daniel Lubarov
616eb618f2
Support macro-local labels
...
Again borrowing syntax from NASM. Example from the test:
%macro spin
%%start:
PUSH %%start
JUMP
%endmacro
One thing this lets us do is create "wrapper" macros which call a function, then return to the code immediately following the macro call, such as
%macro decode_rlp_scalar
%stack (pos) -> (pos, %%after)
%jump(decode_rlp_scalar)
%%after:
%endmacro
I used this to clean up `type_0.asm`.
However, since such macros need to insert `%%after` beneath any arguments in the stack, using them will be suboptimal in some cases. I wouldn't worry about it generally, but we might want to avoid them in performance-critical code, or functions with many arguments like `memcpy`.
2022-08-04 12:32:20 -07:00
Nicholas Ward
bbcb419521
fmt
2022-08-04 14:56:16 -04:00
Nicholas Ward
bf4cf1c64f
fix
2022-08-04 14:40:34 -04:00
Daniel Lubarov
9d3d3afeba
Merge pull request #657 from mir-protocol/more_memory
...
Split up memory asm and add more helper functions
2022-08-04 09:34:56 -07:00
Daniel Lubarov
1e6cf4c4ab
newline
2022-08-04 09:34:46 -07:00
Daniel Lubarov
7423124e36
Split up memory asm and add more helper functions
2022-08-03 22:18:29 -07:00
Daniel Lubarov
fae653da2a
Missing retdest
2022-08-03 21:56:31 -07:00
Daniel Lubarov
233584e945
Merge pull request #656 from mir-protocol/min_max
...
min, max macros
2022-08-03 21:41:23 -07:00
Daniel Lubarov
7481831b74
Merge pull request #648 from mir-protocol/optimizer
...
Some simple optimization rules
2022-08-03 13:53:58 -07:00
Daniel Lubarov
dfd715fafb
Fix case where a valid constant propagation a broke test
2022-08-03 13:52:52 -07:00
Daniel Lubarov
f58990160e
min, max macros
...
Will be used later for things like updating `MemorySize`.
2022-08-03 13:44:44 -07:00
Daniel Lubarov
b4d83f8db2
More metadata fields
2022-08-03 13:43:13 -07:00
Daniel Lubarov
90be4749ef
Merge branch 'main' into optimizer
2022-08-03 09:58:54 -07:00
Daniel Lubarov
9b5b77d3e9
Check if suggested code is actually better
2022-08-03 09:57:40 -07:00
Daniel Lubarov
8aad0b0746
Feedback
2022-08-02 15:57:06 -07:00
Daniel Lubarov
6416826643
Feedback
2022-08-02 15:44:50 -07:00
Sebastien La Duca
8c515b4f2c
selectors can stay pub(crate)
2022-08-02 17:12:27 -04:00
Sebastien La Duca
243bc09293
make modules public
2022-08-02 16:42:37 -04:00
Sebastien La Duca
5563176bad
make rest of gates public
2022-08-02 16:20:58 -04:00
Daniel Lubarov
002b568a12
fix
2022-08-02 10:17:34 -07:00
Daniel Lubarov
cb2df9fa03
More commutative fns
2022-08-02 09:22:06 -07:00
Daniel Lubarov
139bec354d
Merge pull request #651 from mir-protocol/asm_constants
...
More constants for kernel ASM
2022-08-02 09:14:36 -07:00
Daniel Lubarov
c167da8cbe
Revert "UserspaceProgramCounter"
...
This reverts commit 05beaab661a8aaa2f84b6f121b5ac2f29f2ed836.
2022-08-02 09:11:27 -07:00
Daniel Lubarov
3b54ec3986
Feedback
2022-08-02 09:11:27 -07:00
Daniel Lubarov
8bb45203f9
More succinct deadbeef
2022-08-02 09:11:27 -07:00