feat: rename NoteInputs to NoteStorage#2282
feat: rename NoteInputs to NoteStorage#2282PhilippGackstatter merged 14 commits into0xMiden:nextfrom
Conversation
b42f11c to
9f3891d
Compare
This commit renames the NoteInputs type to NoteStorage throughout the codebase to better reflect that these values represent stored data associated with a note rather than inputs. Changes include: - Renamed NoteInputs struct to NoteStorage - Renamed inputs.rs to storage.rs - Updated MAX_INPUTS_PER_NOTE to MAX_NOTE_STORAGE_ITEMS - Updated all related method names: inputs() -> storage(), num_values() -> len(), values() -> items() - Updated all variable names: note_inputs -> note_storage - Updated Assembly files with new terminology - Updated error messages and constants - Updated documentation Closes 0xMiden#1662
9f3891d to
3e0929b
Compare
|
@PhilippGackstatter #2008 is done . need review a lot of work here :) |
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Thanks a lot for taking this on!
Try searching for these strings in the codebase, and you'll find some occurrences that still need to be renamed:
- NUM_INPUTS (probably to storage_length)
- note's inputs
- note inputs
- INPUTS_COMMITMENT
- p2id_inputs
- p2ide_inputs
- mint_inputs
create_p2ide_note_with_inputs(inputs:->create_p2ide_note_with_storage(storage:
| # ================================================================================================= | ||
|
|
||
| const ERR_P2ID_WRONG_NUMBER_OF_INPUTS="P2ID note expects exactly 2 note inputs" | ||
| const ERR_P2ID_WRONG_NUMBER_OF_INPUTS="P2ID note expects exactly 2 note storage" |
There was a problem hiding this comment.
| const ERR_P2ID_WRONG_NUMBER_OF_INPUTS="P2ID note expects exactly 2 note storage" | |
| const ERR_P2ID_UNEXPECTED_STORAGE_LENGTH="P2ID note expects exactly 2 note storage items" |
This needs a rename. Probably same for other notes, swap, mint, etc.
| # ================================================================================================= | ||
|
|
||
| const ERR_SWAP_WRONG_NUMBER_OF_INPUTS="SWAP script expects exactly 16 note inputs" | ||
| const ERR_SWAP_WRONG_NUMBER_OF_INPUTS="SWAP script expects exactly 16 note storage" |
There was a problem hiding this comment.
Above this line, const SWAP_NOTE_INPUTS_NUMBER=16 -> const SWAP_NOTE_STORAGE_LENGTH=16.
Address review feedback: - Rename INPUT_NOTE_NUM_INPUTS_OFFSET to INPUT_NOTE_STORAGE_LENGTH_OFFSET - Rename INPUT_NOTE_INPUTS_COMMITMENT_OFFSET to INPUT_NOTE_STORAGE_COMMITMENT_OFFSET - Rename *_NUM_INPUTS constants to *_STORAGE_LENGTH - Rename ERR_*_WRONG_NUMBER_OF_INPUTS to ERR_*_UNEXPECTED_STORAGE_LENGTH - Rename mint_inputs.rs to mint_storage.rs - Update function names: parse_p2id_inputs -> parse_p2id_storage - Update error messages to use 'note storage items' terminology - Update test helpers and assertions
|
@PhilippGackstatter all changes made. thank you. |
d17b48c to
a312421
Compare
|
@Farukest Thanks for the updates and the effort!
These can still be found in the code base and, e.g. "note inputs" should be renamed to "note storage". Could you give this another shot? Let's also merge |
…ts-to-note-storage # Conflicts: # crates/miden-protocol/src/transaction/kernel/advice_inputs.rs
- Rename P2ID_NOTE_NUM_INPUTS to P2ID_NOTE_STORAGE_LENGTH - Rename RPO_CLAIM_NOTE_INPUTS_COMMITMENT to RPO_CLAIM_NOTE_STORAGE_COMMITMENT - Update comments: "note inputs" -> "note storage" - Update error messages to use "note storage" terminology
I got this @PhilippGackstatter . need review |
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Thanks! Looks good!
I left a few small comments, but mostly I think we should merge this sooner than later because keeping the PR up to date will be difficult due to the many parts it touches.
There are still many occurences of "note inputs" and related terms in the codebase (#2282) but these are also ok to fix in a subsequent PR, as long as we get the main ones here.
The most important outstanding thing is renaming active_note::get_inputs to get_storage.
crates/miden-protocol/asm/kernels/transaction/lib/prologue.masm
Outdated
Show resolved
Hide resolved
Changes based on Philip's review comments: - B2AGG.masm: B2AGG_NOTE_INPUTS_COUNT → B2AGG_NOTE_STORAGE_LEN - B2AGG.masm: ERR_B2AGG_WRONG_NUMBER_OF_INPUTS → ERR_B2AGG_UNEXPECTED_STORAGE_LENGTH - lib.rs: claim_inputs → claim_storage_items - prologue.masm: INPUT_COMMITMENT → STORAGE_COMMITMENT in comment - active_note.masm: get_inputs → get_storage procedure rename - note.masm: various comment updates (inputs → storage) - shared_utils/note.masm: input values → storage values - tx_args.rs: storage_commitment |-> inputs → storage_commitment |-> storage_items - Updated all callers of get_inputs to get_storage
|
Could you merge in |
got this one @PhilippGackstatter |
…ts-to-note-storage
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good to me!
Let's see if we can get a second review and then we'll merge it.
crates/miden-protocol/asm/kernels/transaction/lib/prologue.masm
Outdated
Show resolved
Hide resolved
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
There was a problem hiding this comment.
Looks great! I think the only comment left to address is this one: #2282 (comment)
* feat: rename NoteInputs to NoteStorage This commit renames the NoteInputs type to NoteStorage throughout the codebase to better reflect that these values represent stored data associated with a note rather than inputs. Changes include: - Renamed NoteInputs struct to NoteStorage - Renamed inputs.rs to storage.rs - Updated MAX_INPUTS_PER_NOTE to MAX_NOTE_STORAGE_ITEMS - Updated all related method names: inputs() -> storage(), num_values() -> len(), values() -> items() - Updated all variable names: note_inputs -> note_storage - Updated Assembly files with new terminology - Updated error messages and constants - Updated documentation Closes #1662 * chore: complete note inputs to note storage rename Address review feedback: - Rename INPUT_NOTE_NUM_INPUTS_OFFSET to INPUT_NOTE_STORAGE_LENGTH_OFFSET - Rename INPUT_NOTE_INPUTS_COMMITMENT_OFFSET to INPUT_NOTE_STORAGE_COMMITMENT_OFFSET - Rename *_NUM_INPUTS constants to *_STORAGE_LENGTH - Rename ERR_*_WRONG_NUMBER_OF_INPUTS to ERR_*_UNEXPECTED_STORAGE_LENGTH - Rename mint_inputs.rs to mint_storage.rs - Update function names: parse_p2id_inputs -> parse_p2id_storage - Update error messages to use 'note storage items' terminology - Update test helpers and assertions * fix: rename remaining num_expected_inputs to expected_storage_length * chore: rename remaining note inputs references to note storage - Rename P2ID_NOTE_NUM_INPUTS to P2ID_NOTE_STORAGE_LENGTH - Rename RPO_CLAIM_NOTE_INPUTS_COMMITMENT to RPO_CLAIM_NOTE_STORAGE_COMMITMENT - Update comments: "note inputs" -> "note storage" - Update error messages to use "note storage" terminology * address PR review comments: rename get_inputs to get_storage Changes based on Philip's review comments: - B2AGG.masm: B2AGG_NOTE_INPUTS_COUNT → B2AGG_NOTE_STORAGE_LEN - B2AGG.masm: ERR_B2AGG_WRONG_NUMBER_OF_INPUTS → ERR_B2AGG_UNEXPECTED_STORAGE_LENGTH - lib.rs: claim_inputs → claim_storage_items - prologue.masm: INPUT_COMMITMENT → STORAGE_COMMITMENT in comment - active_note.masm: get_inputs → get_storage procedure rename - note.masm: various comment updates (inputs → storage) - shared_utils/note.masm: input values → storage values - tx_args.rs: storage_commitment |-> inputs → storage_commitment |-> storage_items - Updated all callers of get_inputs to get_storage * fix: correct NoteError import path after merge * fix: update generated files and fix import order * Apply suggestions from code review * chore: regenerate error files * chore: revert foreign_inputs_len change * Apply suggestions from code review Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com> --------- Co-authored-by: Farukest <farukest@users.noreply.github.com> Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
This commit renames the NoteInputs type to NoteStorage throughout the codebase to better reflect that these values represent stored data associated with a note rather than inputs.
Changes include:
Closes #1662