0xMiden / 0xMiden/protocol

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

Aberta
#3,229 3 comentários 2 reações 0 responsáveis Ver no GitHub
standards
Linguagem predominante
Rust
Estrelas
132
Forks
167
Merge médio
1d 23h
PRs com merge (30d)
110

Descrição

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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.