feat: implement AccountPatch::merge#3082
Merged
Merged
Conversation
…o pgackst-unified-asset-delta
Per review feedback, serialize removed entries as bare `AssetVaultKey` and added entries as `Asset`, letting `Asset` own the fungible vs. non-fungible split instead of duplicating that logic in the patch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AccountPatch::mergeAccountPatch::merge
ec64568 to
da2d4a9
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 one comment with potential simplification inline.
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
AccountPatch::merge, which combines a follow-up patch into an existing one with patch semantics: storage and vault entries inotheroverwrite their counterparts inself, and the merged final nonce becomesother's. The merge is rejected if the two patches apply to different accounts, if both carry a final nonce andother's is not exactly one greater thanself's, if both are full-state patches, or if a storage slot is used as two different slot types.AccountPatch::newto reject patches that carry accountcodebut nofinal_noncevia the newAccountPatchError::CodeRequiresNonceUpdate: a patch with code represents account creation, which is a state-changing transaction and per tx kernel rules must increment the nonce.part of #2630