204 Commits

Author SHA1 Message Date
Linda Guiga
8e1969db2f
Fix interpreter jumps (#1471)
* Fix interpreter jumps

* Apply comments
2024-01-22 11:30:51 +01:00
Alonso González
a78a29a698
Merge pull request #1423 from topos-protocol/jumpdest_nd
Refactor jumpdest analysis
2024-01-11 17:14:48 +01:00
Linda Guiga
b05e84ddf8
Interpreter GenerationInputs (#1455)
* Add initialization with GenerationInputs to the interpreter

* Add new_with_generation_inputs_and_kernel

* Apply comments
2024-01-11 16:03:05 +01:00
4l0n50
1715573c22 Fix problems after address bundling 2024-01-09 14:15:16 +01:00
4l0n50
5b71eb4ee0 Address review comments 2024-01-09 11:48:30 +01:00
4l0n50
22e267c34c Address bundling 2024-01-09 11:32:31 +01:00
Robin Salen
2dacbfe2ff
Address bundling (#1426)
* Start

* Scale TxnFields

* Speed-up

* Misc fixes

* Other fixes

* Fix

* Fix offset

* One more fix

* And one more fix

* Fix

* Fix

* Fix init

* More interpreter fixes

* Final fixes

* Add helper methods

* Clippy

* Apply suggestions

* Comments

* Update documentation

* Regenerate pdf

* minor

* Rename some macros for consistency

* Add utility method for unscaling segments and scaled metadata

* Address comments
2024-01-08 10:46:26 +00:00
4l0n50
1c994737ef Address comments 2024-01-05 17:30:59 +01:00
4l0n50
a83404966e Rebase to main
Refactor encode_empty_node and encode_branch_node

Add constant and store encoded empty node in an other position

Remove child segment

Clean code

Apply suggestions from code review

Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>

Remive global label

Move encoded empty nodes
2023-12-27 12:04:14 +01:00
4l0n50
4e569484c2 Improve proof generation 2023-12-20 14:29:57 +01:00
4l0n50
5acabad72d Eliminate nested simulations 2023-12-20 14:29:54 +01:00
Alonso González
0bec627899 Apply suggestions from code review
Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
2023-12-20 14:29:08 +01:00
4l0n50
ed260980b2 Fix jumpdest analisys test 2023-12-20 14:29:08 +01:00
4l0n50
ff3dc2e516 Refactor run_next_jumpdest_table_proof 2023-12-20 14:29:04 +01:00
Robin Salen
7cb0488429
Minor cleanup (#1435) 2023-12-19 11:06:54 +01:00
Linda Guiga
f67ee258a1
Add exceptions handling to the interpreter (#1393)
* Add exceptions handling to the interpreter

* Apply comments

* Fix comments
2023-12-18 19:11:16 +01:00
Linda Guiga
a90aa40b7a
Implement MPT preinitialization (#1406)
* Implement MPT preinitialization

* Apply comments

* Replace GlobalMetadata reads with stores in the kernel

* Change memory specs

* Remove trie data length as a prover input
2023-12-07 12:08:47 -05:00
Robin Salen
2d36559dad
Make some functions const (#1407) 2023-12-05 13:41:31 -05:00
Hamy Ratoanina
64cc1000e7
Move stack_len_bounds_aux to general columns (#1360)
* Move stack_len_bounds_aux to general columns

* Update specs

* Apply comments

* Apply comment
2023-11-28 14:14:47 -05:00
Linda Guiga
96f3faf26e
Changes in interpreter and implement interpreter version for add11 (#1359)
* Fix interpreter, turn syscall opcodes into actual syscalls, create interpreter test for add11

* Rename test_add11 to test_add11_yml

* Apply comments

* Cleanup add11_yml interpreter test

* Make stack_top() return a Result, and remove Result from add11_yml test

* Apply comment
2023-11-28 13:35:40 -05:00
Linda Guiga
ab70bc536d
Fix run_syscall in interpreter. (#1351)
* Fix syscall and change sload test to catch the error

* Update comment

* Cleanup
2023-11-27 12:34:41 -05:00
Robin Salen
f7d5e7c47c
Fix MSTORE_32BYTES in interpreter (#1354) 2023-11-14 17:19:19 -05:00
Hamy Ratoanina
6d751b13c1
Remove values of last memory channel (#1291)
* Remove values of last memory channel

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>

* Fix merge

* Apply comments

* Fix ASM

* Top stack documentation (#7)

* Add doc file

* Apply comments

* Apply comments

* Fix visibility

* Fix visibility

---------

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
2023-11-13 11:03:50 -05:00
David
75ae0eb59f
Merge pull request #1346 from 0xPolygonZero/dp-unwrap-hunting
Root out some unwraps
2023-11-13 14:28:17 +00:00
Robin Salen
88fcc32983
Reduce visibility for a bunch of structs and methods in EVM crate (#1289)
* Reduce visibility for a bunch of structs and methods

* Remove redundant
2023-11-13 09:26:56 -05:00
Linda Guiga
5800e6ad64
Add run_syscall and tests for sload and sstore (#1344)
* Add run_syscall and tests for sload and sstore

* Replace panics with errors and address comments

* Apply comments

* Change last addr name in prepare_interpreter

* Fix kernel_mode in tests

* Minor cleanup
2023-11-10 19:19:00 -05:00
Robin Salen
cc0cdd0783
Remove unnecessary code duplication (#1349)
* Remove unnecessary code duplication

* Clippy
2023-11-10 17:12:44 -05:00
Hamy Ratoanina
3810bd1ae9
Charge gas for native instructions in interpreter (#1348)
* Charge gas for native instructions in interpreter

* Apply comment

* Format
2023-11-10 16:37:54 -05:00
David Palm
d2b5882ae9
Root out some unwraps 2023-11-10 08:53:08 +01:00
Robin Salen
7447959fad
Fix kexit_info in test 2023-10-27 11:15:23 -04:00
Robin Salen
15a9e9928a
Fix test on interpreter side 2023-10-26 17:08:40 -04:00
Robin Salen
29005dc586
Use SUBMOD in Kernel 2023-10-21 11:44:23 -04:00
Hamy Ratoanina
1d60431992
Store top of the stack in memory channel 0 (#1215)
* Store top of the stack in memory channel 0

* Fix interpreter

* Apply comments

* Remove debugging code

* Merge commit

* Remove debugging comments

* Apply comments

* Fix witness generation for exceptions

* Fix witness generation for exceptions (again)

* Fix modfp254 constraint
2023-10-11 16:28:49 -04:00
Robin Salen
03a9558198
Handle additional panics (#1250)
* Remove some panic risks

* Remove more panics

* Handle jump with empty stack

* Handle last expect

* More panics

* Handle from_big_endian

* Handle from_little_endian

* Remove remaining risky as_usize()

* Remove explicit panic

* Clippy

* Handle unwrap

* Make error messages more explicit

* Simplify u256 to usize conversion
2023-09-26 11:13:57 -04:00
Robin Salen
5a1b05acfb
Remove risks of panic 2023-09-12 19:23:16 -04:00
Robin Salen
9508b49090
Move byte packing / unpacking to a distinct table (#1212)
* Duplicate Memory trace into BytePacking one

* Add mload_32bytes instruction

* Use dedicated ops for byte packing trace

* Change witness generation to reduce memory reads for MLOAD_32BYTES

* Remove segments

* Fix stack

* Fix extra product when fixing CTL for byte_packing

* Write output value in trace

* Add constraints for BYTE_PACKING table

* Add recursive constraints for BYTE_PACKING table

* Fix constraints

* Add address in trace and constraints

* Add timestamp and batch inputs into BytePackingOp struct

* Add extra column

* Fix BytePackingStark CTL

* Tiny fix in witness generation

* Fix the Memory CTL

* Add constraints for the new columns

* Remove 1 column

* Remove limb columns

* Fix

* Fix recursive circuit of BytePackingTable

* Fix constraints

* Fix endianness

* Add MSTORE_32BYTES instruction and move decomposition to packing table

* Add missing constraint

* Add range-check for all bytes

* Add extra constraint

* Cleanup

* Remove REMAINING_LEN column

* Add corresponding implementations in interpreter

* Fix recursive version

* Remove debug assertion because of CI

* Remove FILTER column

* Update new test from rebasing

* Reorder STARK modules to match TraceCheckPoint ordering

* Address comments

* Pacify clippy

* Add documentation to the packing module

* Fix doctest
2023-09-13 04:45:37 +10:00
Robin Salen
c0b4f155f4
Implement receipts and logs
Co-authored-by: Hamy Ratoanina <hamy.ratoanina@toposware.com>
Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
2023-08-22 20:00:49 +01:00
Nicholas Ward
975e9a49fa fmt 2023-06-20 12:51:55 -07:00
Nicholas Ward
8eeca9be95 undo dummy change 2023-06-20 12:48:38 -07:00
Nicholas Ward
2fa43121d7 dummy change to get tests to rerun :P 2023-06-20 12:48:21 -07:00
Nicholas Ward
9bb6da049e fmt 2023-06-20 12:30:37 -07:00
Nicholas Ward
afd4bd0406 cleanup 2023-06-20 12:02:45 -07:00
Nicholas Ward
bc53ddc56f fix 2023-06-20 12:01:24 -07:00
Jacqueline Nabaglo
cedeff5219 PUSH0 2023-06-13 13:29:30 -07:00
Robin Salen
9d60191d73
Implement returndatasize/returndatacopy for interpreter 2023-04-14 13:22:27 -04:00
Robin Salen
6946eacaca
Implement codesize/codecopy for interpreter 2023-04-14 11:41:39 -04:00
Robin Salen
0f3285c33b
Implement gasprice on the interpreter 2023-04-14 11:41:39 -04:00
Robin Salen
e9cc5632eb
Impl caller/address/origin opcodes for interpreter 2023-04-14 11:41:38 -04:00
Robin Salen
011ea8e49b
Fix from review 2023-04-11 07:46:22 -04:00
Robin Salen
3da8efa6ba
Implement sar in interpreter 2023-04-09 16:07:31 -04:00