0xMiden / 0xMiden/protocol

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

Offen
#3,834 0 Kommentare 1 Reaktion 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

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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