21 Commits

Author SHA1 Message Date
Daniel Lubarov
a05ed9fc3a Fix clobbering of RLP data memory 2023-03-19 11:49:15 -07:00
Daniel Lubarov
29f0692efc Fix a few issues found by EVM tests 2023-02-24 23:37:08 -08:00
Daniel Lubarov
f4ab65f973 Fixes to get test_simple_transfer working 2022-12-08 23:27:20 -08:00
Daniel Lubarov
a8e30b0ca0 Switch a few uses of current-context memory to kernel memory
E.g. make sure the RLP segment is only used with the kernel context. Using current-context memory would also work, we just need to be consistent.

For transaction parsing etc, the context should be 0 anyway, but explicitly referring to kernel memory feels more idiomatic to me.
2022-10-15 08:45:01 -07:00
Daniel Lubarov
e6b5e3656f Some more uses of %increment, %decrement 2022-10-07 12:03:37 -07:00
Daniel Lubarov
f2cb42bbe8 MPT logic to hash branch nodes 2022-10-05 20:46:49 -07:00
Daniel Lubarov
0ccb340e40 RLP related fixes 2022-10-04 15:18:31 -07:00
Daniel Lubarov
66c28e953d Unroll num_bytes
Since it's in some code paths where speed is critical.
2022-10-03 14:42:11 -07:00
Daniel Lubarov
25a448e24b Minor refactor of RLP code 2022-10-03 09:58:43 -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
c721155e23 Main function, txn processing loop 2022-09-29 23:15:33 -07:00
Daniel Lubarov
aaf7ace396 Remove JUMPDESTs 2022-09-04 22:31:56 -07:00
Daniel Lubarov
539152d767 RLP encoding functions 2022-08-14 11:41:53 -07: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
Daniel Lubarov
fae653da2a Missing retdest 2022-08-03 21:56:31 -07:00
Daniel Lubarov
d6b5193c9b RLP decoding tests 2022-07-31 20:29:57 -07:00
Daniel Lubarov
3d8ac2a391 style 2022-07-26 16:25:01 -07:00
Daniel Lubarov
05c7dfa115 Feedback 2022-07-25 16:32:59 -07:00
Daniel Lubarov
544c84b420 Transaction (RLP) parsing
Will add tests once we have the interpreter support for other segmnets.
2022-07-23 21:39:01 -07:00