0xMiden / 0xMiden/protocol

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

オープン
#3,834 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
standards
主要言語
Rust
スター
132
フォーク
167
平均マージ
1日 23時間
マージ済み PR(30日)
110

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。