0xMiden / 0xMiden/protocol

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

Offen
#3,229 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
standards
Vorherrschende Sprache
Rust
Sterne
132
Forks
167
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
110

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.