Repository navigation
chore: propagate CodePatch from the transaction kernel to the proven transaction - #4103
Open
PhilippGackstatter wants to merge 8 commits into
Open
PhilippGackstatter wants to merge 8 commits into
PhilippGackstatter wants to merge 8 commits into
Conversation
PhilippGackstatter
marked this pull request as ready for review
October 23, 2026 08:08
…ation # Conflicts: # crates/miden-protocol/src/block/code_tree/patch.rs
mmagician
approved these changes
Oct 27, 2026
Comment on lines
+185
to
+198
| # The transaction outputs occupy the top 16 elements, so the padding below them cannot be | ||
| # reached directly. Save the output notes commitment in a local to bring the padding up to the | ||
| # top four words, one word at a time. | ||
| loc_storew_le.OUTPUT_NOTES_COMMITMENT_LOC dropw | ||
| # => [ACCOUNT_UPDATE_COMMITMENT, CODE_PATCH_COMMITMENT, LOGS_EXPIRATION_COMMITMENT, pad(16)] | ||
|
|
||
| repeat.3 | ||
| movupw.3 dropw | ||
| end | ||
| # => [OUTPUT_NOTES_COMMITMENT, ACCOUNT_UPDATE_COMMITMENT, LOGS_COMMITMENT, tx_expiration_block_num, pad(3)] | ||
| # => [ACCOUNT_UPDATE_COMMITMENT, CODE_PATCH_COMMITMENT, LOGS_EXPIRATION_COMMITMENT, pad(4)] | ||
|
|
||
| # replace the last padding word with the output notes commitment | ||
| movupw.3 loc_loadw_le.OUTPUT_NOTES_COMMITMENT_LOC | ||
| # => [OUTPUT_NOTES_COMMITMENT, ACCOUNT_UPDATE_COMMITMENT, CODE_PATCH_COMMITMENT, LOGS_EXPIRATION_COMMITMENT] |
| padw | ||
| # => [CODE_PATCH_COMMITMENT, LOGS_EXPIRATION_COMMITMENT, ACCOUNT_UPDATE_COMMITMENT] | ||
|
|
||
| # place the account update commitment above the code patch commitment |
|
|
||
| # truncate the stack | ||
| repeat.13 movup.13 drop end | ||
| exec.sys::truncate_stack |
Collaborator
There was a problem hiding this comment.
actually would truncate_stack not work in crates/miden-protocol/asm/kernels/transaction/bin/main.masm instead of saving one word to locals and then moving and dropping the words?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This wires
CodePatchthrough the whole transaction pipeline: from the kernel output stack, through the executor's consistency checks and the proven transaction, to the verifier. The kernel still emits an empty patch, so later work only needs to fill in the kernel side and the advice map read.[OUTPUT_NOTES_COMMITMENT, ACCOUNT_UPDATE_COMMITMENT, CODE_PATCH_COMMITMENT, LOGS_EXPIRATION_COMMITMENT].CODE_PATCH_COMMITMENTisEMPTY_WORDfor now.TransactionHeadercarries the commitment so that it can recompute the ID.Why the transaction ID commits to the code patch
TransactionId. The reference block is not in the ID, but it is a precondition, not an effect.Part of #4006