0xMiden / 0xMiden/miden-vm

Track called procedures

Đang mở
#2,061 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
772
Fork
352
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
93

Mô tả

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)_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.