0xMiden / 0xMiden/protocol

Consider adding `exec`-wrappers for `call`-able procedures in `miden::standards`

Abierto
#3,229 3 comentarios 2 reacciones 0 asignados Ver en GitHub
standards
Lenguaje dominante
Rust
Estrellas
132
Forks
167
Merge medio
1 d 23 h
PR fusionados (30 d)
110

Descripción

Since we decided that all account component procedures should be `call`-ed (https://github.com/0xMiden/protocol/issues/2862), it would be a nice ergonomics improvement to implement `exec`-utable wrappers around procedures that should be `call`-ed (discussed also in https://github.com/0xMiden/protocol/issues/2862#issuecomment-4378313052). For example, after https://github.com/0xMiden/protocol/pull/3222 the MINT and BURN notes manually call `code_inspection::has_procedure`. This could be made nicer with an "adapter" that pads and truncates the stack, just like `miden::protocol` procedures wrap kernel procedures.

```
#! Defined in miden::standards::inspection::code_inspection::adapter
#!
#! Inputs: [PROC_ROOT]
#! Outputs: [has_procedure]
#!
#! Invocation: exec
proc has_procedure
# pad the stack to 16
call.code_inspection::has_procedure
# truncate the stack
end
```

These procedures could be defined in an `adapter` sub-module of the procedures that they wrap. The alternative is to define them in the same module, but then the procedure name would have to be different, which seems less desirable.

This is a larger mechanical project that would be nice to do eventually, though not very important now.

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.