0xMiden / 0xMiden/protocol

Use `is_epilogue_auth_in_progress` flag to simplify epilogue auth execution

未关闭
#3,498 2 条评论 0 个 reaction 已指派 1 人 已被 @Fumuran 认领 在 GitHub 查看
kernels
主要语言
Rust
星标
132
派生
167
平均合并
1 天 23 小时
30 天内合并 PR
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 摘要。