Track called procedures
- 主要語言
- Rust
- 星號
- 772
- 分支
- 352
- 平均合併
- 1 天 12 小時
- 30 天內合併 PR
- 93
描述
As a user of the feature I implemented (tracked procedures), I realized that calling `auth_noop` instead of `auth__basic` in https://github.com/0xMiden/miden-base/pull/1622 would NOT have resulted in the expected error (`ERR_AUTH_PROCEDURE_CALLED_FROM_WRONG_CONTEXT`) due to how tracking is implemented.
More generally, just because we "call" an account procedure doesn't mean it will get tracked. For tracking to come into effect, the procedure must call into some "authenticateable" instruction (anything that checks either `authenticate_account_origin` or `assert_auth_procedure_origin`). If the procedure executes some "local" MASM instructions, and doesn't call into miden-lib (like the noop auth that does `push.0 drop`), it will not get tracked even if it was actually invoked. This is not a problem per-se, since such "local MASM" procedures are innocuous, but I think this should be documented better. And it makes me realize that the current approach of procedure tracking of https://github.com/0xMiden/miden-base/issues/1489, while it was relatively quick to implement, might be a little fragile. A better approach would probably be introducing procedure tracking at the VM level, which would:
a) not rely on `authenticate_account_origin` or `assert_auth_procedure_origin`, but instead unequivocally track account procedure calls "natively",
b) allow for tracking the actual count of invocations, not just the `was_called` bool flag.
_Originally posted by @mmagician in [#1623](https://github.com/0xMiden/miden-base/issues/1623#issuecomment-3104815042)_
貢獻指南
評估
這個 Issue 還沒有評估資料。