0xMiden / 0xMiden/protocol

Use `is_epilogue_auth_in_progress` flag to simplify epilogue auth execution

Abierto
#3,498 2 comentarios 0 reacciones 1 asignado Reclamado por @Fumuran Ver en GitHub
kernels
Lenguaje dominante
Rust
Estrellas
132
Forks
167
Merge medio
1 d 23 h
PR fusionados (30 d)
110

Descripción

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_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.