0xMiden / 0xMiden/protocol

Use `is_epilogue_auth_in_progress` flag to simplify epilogue auth execution

オープン
#3,498 コメント 2 件 リアクション 0 件 担当者 1 名 @Fumuran が担当を希望しています GitHub で見る
kernels
主要言語
Rust
スター
132
フォーク
167
平均マージ
1日 23時間
マージ済み PR(30日)
110

説明

https://github.com/0xMiden/protocol/pull/3396 PR introduced a new `is_epilogue_auth_in_progress` memory flag which shows whether we currently execute the authentication procedure during the epilogue. It's primary task is to skip tracking of procedures called inside the auth proc during epilogue.

Using this flag we can simplify the process of asserting whether the authentication procedure was called outside the epilogue. Currently we are doing this using `assert_auth_procedure` proc: it sets the `was_procedure_called` flag to 1 and then before calling the auth procedure in the epilogue we check that this flag remained 0.

But we can update the `assert_auth_procedure` to check whether the `is_epilogue_auth_in_progress` is currently 0 — that will mean that the authentication procedure was called inside a user code and not in the epilogue, so we could return an error right away instead of waiting for epilogue to do so.

In theory that will allow us to simplify the `execute_auth_procedure` proc in epilogue: there will be no reason to update the `was_procedure_called` flag for auth proc, and hence we will be able to remove the "was auth proc called" check before calling it.

_Originally posted by @PhilippGackstatter in https://github.com/0xMiden/protocol/pull/3396#discussion_r3718296935_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。