Use `is_epilogue_auth_in_progress` flag to simplify epilogue auth execution
- Lingua principale
- Rust
- Stelle
- 132
- Fork
- 167
- Merge medio
- 1g 23h
- PR unite (30g)
- 110
Descrizione
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_
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.