feat: swap AccountDelta for AccountPatch in executed and proven transaction#3089
Open
PhilippGackstatter wants to merge 7 commits into
Open
feat: swap AccountDelta for AccountPatch in executed and proven transaction#3089PhilippGackstatter wants to merge 7 commits into
AccountDelta for AccountPatch in executed and proven transaction#3089PhilippGackstatter wants to merge 7 commits into
Conversation
20ddffe to
decf3cc
Compare
ec64568 to
da2d4a9
Compare
3869ea8 to
553a27a
Compare
bobbinth
approved these changes
Jun 12, 2026
bobbinth
left a comment
Contributor
There was a problem hiding this comment.
Looks good! Thank you! I left just a couple of small comments inline.
Comment on lines
37
to
+38
| /// The commitment to the delta computed by the transaction kernel. | ||
| account_delta_commitment: Word, | ||
| account_patch_commitment: Word, |
Contributor
There was a problem hiding this comment.
The comment here needs to be updated.
Comment on lines
+321
to
+325
| /// The commitment to the [`AccountPatch`](crate::account::AccountPatch) resulting from the | ||
| /// execution of the transaction, as computed by the transaction kernel in the epilogue. It | ||
| /// must equal the commitment of the patch carried in [`AccountUpdateDetails::Public`] when | ||
| /// present. | ||
| account_patch_commitment: Word, |
Contributor
There was a problem hiding this comment.
The last sentence is a bit unclear: if AccountUpdateDetails is Private is account_patch_commitment set to anything (or is it an empty word)?
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.
Summary
Stacks on top of #3082 and replaces the account delta with the account patch in the transaction account update path: the kernel-emitted commitment,
TxAccountUpdate,AccountUpdateDetails, the batch and block account update flows, and the prover.Changes
AccountUpdateDetails::Delta(AccountDelta)becomesAccountUpdateDetails::Public(AccountPatch).TxAccountUpdate::account_delta_commitmentbecomesaccount_patch_commitment, and its validator checks the carriedAccountPatchagainst that commitment directly.account_delta::compute_patch_commitment(module to be renamed) and hashes it together with the final account commitment to produceACCOUNT_UPDATE_COMMITMENT.AccountUpdateTracker::into_patchis now wired in:TransactionBaseHost::into_partsreturns both the delta and the patch, the executor reconcilesaccount_patch.to_commitment()againsttx_outputs.account_patch_commitment(), and the prover uses the patch when building theProvenTransaction.ExecutedTransactiongains anaccount_patchfield, so consumers can inspect the absolute post-transaction state. Delta is kept for this PR.TxAccountUpdate::account_id == AccountPatch::account_idso it always runs for public accounts, not just for new public accounts.Temporary pre-fee / post-fee handling
Under the old delta flow the kernel committed to the pre-fee delta, while the host carried the post-fee delta in
AccountUpdateDetails::Delta(the fee asset had been removed). The verifier worked around this by re-adding the fee asset to the carried delta before checking it against the committed pre-fee commitment, then removing it again.This PR makes the assumption that the automatic fee removal in the tx kernel will go away and be replaced with a fee note, which will no longer have this pre-post-fee split. So, this PR treats the pre-fee patch as the patch of the entire transaction. This is not correct under the current fee model (the fee removal is not reflected in the patch), but it would be correct under the planned note-based fee model. This PR disables one test that fails because of this mismatch (
prove_account_creation_with_fees) that should be re-enabled (or removed if no longer useful) once we have refactored fees.Follow-Ups
AccountDeltafromExecutedTransaction. For now kept because it's still used in many tests and those will be refactored separately.account_delta::compute_commitmentcall in the epilogue. It still callsaccount_delta::compute_commitment(and drops the result) right aftercompute_patch_commitment, because the host's delta event hooks fire from that procedure and downstream code still observes the delta.$kernel::account_deltamodule toaccount_updatesince it contains both delta and patch logic.$kernel::account_delta::compute_commitmenttocompute_delta_commitment.update*procedures inaccount_delta.masmtocommit*for clarity.test_account_deltato a different approach since the tests previously relied on the executor checking the delta commitment match, but this is no longer the case. As part of this, integrate patch testing into this test module.