0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
611 stars 148 forks source link

Allow procedures with the same name to differ on the number of locals #1377

Open hackaugusto opened 4 days ago

hackaugusto commented 4 days ago

When compiling the account code, one can wrap the basic wallet example. The issue is that when wrapping said code, there can be name conflicts, for example, the current code is just an re-export:

        # acct proc 0
        export.wallet::receive_asset
        # acct proc 1
        export.wallet::send_asset

If the above is changed to:

        export.send_asset  # <- note the absence of the local `.1`
            exec.wallet::send_asset
        end

The compilation fails with AccountCodeAssemblerError(ConflictingNumLocals("send_asset")) when running the following test cargo test -- executed_transaction_account_delta. This is a bit annoying, specially because consistently using proc for everything is a way of circumventing https://github.com/0xPolygonMiden/miden-vm/issues/1376

hackaugusto commented 4 days ago

There maybe some deeper issues with the procedure caching code. It could be that the cache is done on a per name basis, instead of a per mast or full-path.