0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
612 stars 150 forks source link

Allow changing constant values prior to execution #1330

Open hackaugusto opened 2 months ago

hackaugusto commented 2 months ago

In the protocol account id generation requires PoW. However, for testing, we want to decrease these requirements, otherwise it becomes to slow to run the tests. To reduce the PoW requirements we have to patch both the Rust and the Masm code. The former is done using cfg! and the later is done via patching the MASM code.

The above however has an issue that it is easy to lose the synchronization of said constants, causing test failures that can be time consuming to debug.

To fix the above, ideally we would delay inlining the constants until execution time, allowing the tests to overwrite the source code constants.