Skip to content

Commit

Permalink
refactor: indirects and read/write slices (#7082)
Browse files Browse the repository at this point in the history
This PR does a few things to clean up the indirect and mem handling in
the avm trace.

1) Adds support to resolve indirects across all operands in a similar
way to the simulator.
2) Introduces the `constrained_read` and `constrained_write` mem
abstractions that handle the (potential) indirect load step without
needing to manually write them.
3) Indirect handling in the `write_slice` and `read_slice` helpers.
4) Clean up gadgets read/write cycle - dropping unnecessary reads of
indirect destination offset thanks to above point
5) Simplified gadgets execution tests, removed checks other than return
result since they were arbitrary based on our read pattern at the time
and not reflective of what the tests should look like when they are
constrained.

Note the CMOV, MOV and JUMPI have been left for a later refactor as they
use specific load patterns in the mem trace, plus this PR was getting
large..
  • Loading branch information
IlyasRidhuan authored Jun 21, 2024
1 parent f500f2e commit d5e80ee
Show file tree
Hide file tree
Showing 3 changed files with 922 additions and 1,388 deletions.
Loading

0 comments on commit d5e80ee

Please sign in to comment.