Skip to content

refactor(protocol): share the note storage preimage load - #3656

Closed
mmagician wants to merge 2 commits into
mmagician-claude/skip-redundant-note-storage-rehashfrom
mmagician-claude/refactor-share-note-storage-preimage-load
Closed

refactor(protocol): share the note storage preimage load#3656
mmagician wants to merge 2 commits into
mmagician-claude/skip-redundant-note-storage-rehashfrom
mmagician-claude/refactor-share-note-storage-preimage-load

Conversation

@mmagician

@mmagician mmagician commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Addresses bobbinth's review comment that the prologue's storage handling duplicates the input-note reader.

The prologue and input_note_internal::get_storage_raw both load a note's storage preimage from the advice map and assert its item count - this logic now became a new helper protocol_utils::note::load_storage_preimage.

@mmagician
mmagician force-pushed the mmagician-claude/fix-l05-note-storage-count-verify branch from 4c24768 to 08356c0 Compare August 21, 2026 08:07
@mmagician
mmagician changed the base branch from mmagician-claude/fix-l05-note-storage-count-verify to mmagician-claude/skip-redundant-note-storage-rehash August 21, 2026 08:08
The prologue and the input-note storage reader both load a note's storage
preimage from the advice map and assert its item count against the note's
count. Extracts that into `protocol_utils::note::load_storage_preimage`,
which both now call.

The two error constants collapse into a single
`ERR_NOTE_STORAGE_ITEMS_COUNT_MISMATCH`, since MASM cannot parameterize an
error code. `protocol_utils` errors are emitted into both the tx-kernel and
protocol-library error modules, so it remains reachable from either side.
@mmagician
mmagician force-pushed the mmagician-claude/refactor-share-note-storage-preimage-load branch from 007548a to 27ffcb2 Compare August 21, 2026 08:12
@mmagician
mmagician marked this pull request as draft August 21, 2026 08:24
Comment thread crates/miden-protocol/asm/protocol_utils/src/note.masm Outdated
Comment thread crates/miden-protocol/asm/protocol_utils/src/note.masm Outdated
Co-authored-by: Marti <marcin.gorny.94@protonmail.com>
@mmagician

Copy link
Copy Markdown
Collaborator Author

Assessment: this works, but since the extracted helper is just 2 effective lines of MASM, I don't think this is worth doing, closing.

@mmagician mmagician closed this Aug 21, 2026
@bobbinth
bobbinth deleted the mmagician-claude/refactor-share-note-storage-preimage-load branch September 5, 2026 15:47
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.

2 participants