Skip to content

feat: rename NoteInputs to NoteStorage#2282

Merged
PhilippGackstatter merged 14 commits into0xMiden:nextfrom
Farukest:feat/rename-note-inputs-to-note-storage
Jan 20, 2026
Merged

feat: rename NoteInputs to NoteStorage#2282
PhilippGackstatter merged 14 commits into0xMiden:nextfrom
Farukest:feat/rename-note-inputs-to-note-storage

Conversation

@Farukest
Copy link
Contributor

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

@Farukest Farukest force-pushed the feat/rename-note-inputs-to-note-storage branch 2 times, most recently from b42f11c to 9f3891d Compare January 15, 2026 13:07
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
@Farukest Farukest force-pushed the feat/rename-note-inputs-to-note-storage branch from 9f3891d to 3e0929b Compare January 15, 2026 13:18
@Farukest
Copy link
Contributor Author

@PhilippGackstatter #2008 is done . need review a lot of work here :)
Mentioned on #2266

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@Farukest
Copy link
Contributor Author

Farukest commented Jan 15, 2026

@PhilippGackstatter all changes made. thank you.

@Farukest Farukest force-pushed the feat/rename-note-inputs-to-note-storage branch from d17b48c to a312421 Compare January 15, 2026 19:18
@PhilippGackstatter
Copy link
Contributor

PhilippGackstatter commented Jan 16, 2026

@Farukest Thanks for the updates and the effort!

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

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 next.

…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
@Farukest
Copy link
Contributor Author

@Farukest Thanks for the updates and the effort!

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

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 next.

I got this @PhilippGackstatter . need review

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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
@PhilippGackstatter
Copy link
Contributor

Could you merge in next @Farukest? Thanks!

@Farukest
Copy link
Contributor Author

Could you merge in next @Farukest? Thanks!

got this one @PhilippGackstatter

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Let's see if we can get a second review and then we'll merge it.

Copy link
Contributor

@partylikeits1983 partylikeits1983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I think the only comment left to address is this one: #2282 (comment)

@PhilippGackstatter PhilippGackstatter merged commit be6ea54 into 0xMiden:next Jan 20, 2026
16 checks passed
partylikeits1983 added a commit that referenced this pull request Feb 12, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename note inputs

3 participants