0xMiden / 0xMiden/protocol

Use `is_epilogue_auth_in_progress` flag to simplify epilogue auth execution

Offen
#3,498 2 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @Fumuran Auf GitHub ansehen
kernels
Vorherrschende Sprache
Rust
Sterne
132
Forks
167
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
110

Beschreibung

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_

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.