kkrt-labs / cairo-vm-ts

A typescript implementation of the Cairo VM
Apache License 2.0
18 stars 13 forks source link

refactor: remove ResLogic.Unused and specific condition flow #95

Closed zmalatrax closed 3 months ago

zmalatrax commented 3 months ago

When computing res, the Cairo whitepaper has a specific condition when:

If all condition are met, it flags res as Unused and uses op1 instead of res in the PC update

However, this condition doesn't seem necessary as we could use the classic behavior (following the same state transition as if pc_update == 0, 1 or 2), change op1 by res in the Jnz case and obtain a similar state