fix(protocol): verify input-note storage item count in the prologue - #3641
Conversation
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>
zeapoz
left a comment
There was a problem hiding this comment.
LGTM, left a single nit about touching up the doc comments to leave out superfluous information
Co-authored-by: Marti <marcin.gorny.94@protonmail.com>
bobbinth
left a comment
There was a problem hiding this comment.
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?
4c24768 to
08356c0
Compare
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 |
Summary
The transaction kernel prologue reads each input note's
num_storage_itemsfrom the advice provider, but never binds it to the note's authenticatedNOTE_STORAGE_COMMITMENT. This PR fixes itCloses #3593