0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
632 stars 161 forks source link

Refactor decoder handling of control blocks #1538

Open plafer opened 1 month ago

plafer commented 1 month ago

When encountering a control block (e.g. JOIN), writing to the system and stack columns is handled by calling self.execute_op(Operation::Noop). This is unintuitive, makes debugging harder (e.g. a print inside execute_op() prints a bunch of NOOP operations that are not actually in the trace). Also, DYNCALL was the first control block where its effect on the stack and system columns doesn't correspond to any existing operation.

The real purpose of "executing NOOPs" is to

  1. ensure the trace capacity
  2. copy the stack columns over to the next row
  3. advance clock

We should introduce an abstraction that does this cleanly instead of reusing execute_op().

Context: https://github.com/0xPolygonMiden/miden-vm/pull/1535#discussion_r1807544164