Skip to content

fix(protocol): verify input-note storage item count in the prologue - #3641

Merged
mmagician merged 9 commits into
nextfrom
mmagician-claude/fix-l05-note-storage-count-verify
Aug 21, 2026
Merged

fix(protocol): verify input-note storage item count in the prologue#3641
mmagician merged 9 commits into
nextfrom
mmagician-claude/fix-l05-note-storage-count-verify

Conversation

@mmagician

@mmagician mmagician commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

The transaction kernel prologue reads each input note's num_storage_items from the advice provider, but never binds it to the note's authenticated NOTE_STORAGE_COMMITMENT. This PR fixes it

Closes #3593

Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
claude added 4 commits August 20, 2026 12:24
Addresses review: promote the magic 0 in locaddr.0 to the
PROCESS_NOTE_STORAGE_PREIMAGE_LOC constant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Addresses review: "advised" is not used as an adjective in this
codebase; refer to the item count from the advice map instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…_to_memory

Addresses review: document the operand stack state right before the
call to pipe_elements_preimage_to_memory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Addresses review: "scratch buffer"/"scratch memory" is not used in
this codebase; refer to memory locals / the preimage buffer instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mmagician
mmagician marked this pull request as ready for review August 20, 2026 13:04
@mmagician
mmagician requested review from Fumuran and zeapoz August 20, 2026 13:04

@zeapoz zeapoz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, left a single nit about touching up the doc comments to leave out superfluous information

Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
mmagician and others added 2 commits August 20, 2026 16:17

@bobbinth bobbinth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Thank you! I left a couple of optional comments inline..

Also, the original issue mentioned that we may be able to get some hashing somewhere else - but I'm not seeing any other changes. Did this not materialize?

Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/prologue.masm Outdated
@mmagician

mmagician commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Also, the original issue mentioned that we may be able to get some hashing somewhere else - but I'm not seeing any other changes. Did this not materialize?

We could save on some extra hashing, but it does require a bit more refactoring. I've opened a draft PR #3659 to address this (I'm not yet fully convinced it's worth it though).

Merging this PR as-is

@mmagician
mmagician added this pull request to the merge queue Aug 21, 2026
Merged via the queue into next with commit 73a3d0d Aug 21, 2026
19 checks passed
@mmagician
mmagician deleted the mmagician-claude/fix-l05-note-storage-count-verify branch August 21, 2026 08:26
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.

L-05: get_storage_info Returns an Unverified Note Storage Item Count

4 participants