Skip to content

feat: move storage_slot from partial commitment to completion hash#21351

Merged
benesjan merged 1 commit intomerge-train/fairiesfrom
jv/move-storage-slot-to-completion-hash
Mar 11, 2026
Merged

feat: move storage_slot from partial commitment to completion hash#21351
benesjan merged 1 commit intomerge-train/fairiesfrom
jv/move-storage-slot-to-completion-hash

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Mar 11, 2026

This is the first PR of probably 2 towards achieving No-setup Partial Notes. In this PR I move the storage_slot from the partial note commitment (first hash round) to the completion hash (second round).

AI Summary

  • Moves storage_slot from the partial note commitment (first hash round) to the completion hash (second round), since with the Owned state variable the storage slot no longer encodes the owner and can be safely revealed publicly
  • Simplifies the partial commitment to hash(owner, randomness) and the completion hash to hash(commitment, storage_slot, value)
  • Removes storage_slot from the private message encoding; it is now extracted from the public completion log during note discovery
  • Applied to both UintNote and NFTNote and all contract callers

pub global MAX_PUBLIC_LOG_LEN_FOR_NOTE_COMPLETION: u32 = MAX_NOTE_PACKED_LEN;

global MAX_LOG_CONTENT_LEN: u32 = std::cmp::max(
pub(crate) global MAX_LOG_CONTENT_LEN: u32 = std::cmp::max(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to expose this because it's now used by fetch_and_process_partial_note_completion_logs when separating the public note content from the storage slot.

@benesjan benesjan changed the base branch from next to merge-train/fairies March 11, 2026 07:12
With the introduction of the `Owned` state variable, the storage slot no longer
encodes the owner address, making it safe to reveal publicly. This moves
storage_slot from the first round of hashing (partial commitment) to the second
round (completion hash), simplifying the private message and partial commitment.

Changes:
- Partial commitment: hash(owner, randomness) instead of hash(owner, storage_slot, randomness)
- Completion hash: hash(commitment, storage_slot, value) instead of hash(commitment, value)
- Completion log: [tag, storage_slot, ...values] instead of [tag, ...values]
- storage_slot removed from private message encoding/decoding
- storage_slot extracted from completion log during note discovery
- Applied to both UintNote and NFTNote

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@benesjan benesjan force-pushed the jv/move-storage-slot-to-completion-hash branch from 54f7b0c to 09ba01e Compare March 11, 2026 07:13
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@benesjan benesjan marked this pull request as ready for review March 11, 2026 07:13
@benesjan benesjan requested a review from nventuro as a code owner March 11, 2026 07:13
@benesjan benesjan requested a review from mverzilli March 11, 2026 07:59
Copy link
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

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

Nice!

@benesjan benesjan merged commit 936ab03 into merge-train/fairies Mar 11, 2026
18 checks passed
@benesjan benesjan deleted the jv/move-storage-slot-to-completion-hash branch March 11, 2026 11:07
github-merge-queue bot pushed a commit that referenced this pull request Mar 13, 2026
BEGIN_COMMIT_OVERRIDE
fix: skip oracle version check for pinned protocol contracts (#21349)
fix: not reusing tags of partially reverted txs (#20817)
feat: move storage_slot from partial commitment to completion hash
(#21351)
feat: offchain reception (#20893)
fix: handle workspace members in needsRecompile crate collection
(#21284)
fix(aztec-nr): return Option from decode functions and fix event
commitment capacity (#21264)
fix: handle bad note lengths on compute_note_hash_and_nullifier (#21271)
fix: address review feedback from PRs #21284 and #21237 (#21369)
fix: claim contract & improve nullif docs (#21234)
feat!: auto-enqueue public init nullifier for contracts with public
functions (#20775)
fix: search for all note nonces instead of just the one for the note
index (#21438)
fix: set anvilSlotsInAnEpoch in e2e_offchain_payment to prevent
finalization race (#21452)
fix: complete legacy oracle mappings for all pinned contracts (#21404)
fix: correct inverted constrained encryption check in message delivery
(#21399)
feat!: improve L2ToL1MessageWitness API (#21231)
END_COMMIT_OVERRIDE
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.

2 participants