Consider adding `exec`-wrappers for `call`-able procedures in `miden::standards`
- Langage dominant
- Rust
- Étoiles
- 132
- Forks
- 167
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 110
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.