0xMiden / 0xMiden/protocol

Standardize the config note selector as an explicit "note variant"

Abierto
#3,834 0 comentarios 1 reacción 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

Follow-up to the discussion in [#3721](https://github.com/0xMiden/protocol/issues/3721), where we have talked on a consistent methodology for the notes we add from here on by @bobbinth

> Using the selector - I think this is probably the most robust approach and as we add more notes that exhibit different behavior under different contexts, we should encode the info in this selector (maybe we should call it "note variant").

This issue covers making that convention explicit:

- We should rename the `SELECTOR_*` constants in the config note scripts and the `selector()` helpers on the Rust side to `note_variant`.
- Document the rule in `note/config/mod.rs`: a note with more than one code path carries a
`note_variant` felt in its first storage item, and variants are contiguous values starting at 0 and
are mirrored by a Rust enum. The script asserts both that the variant is known and that the
storage item count matches that variant.

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.