fix: remove redundant to/memo from DecryptionData#364
Open
Conversation
7d045d3 to
b785d3b
Compare
The `to` and `memo` fields in `DecryptionData` were redundant: the on-chain `ZoneInbox` already decrypts the ciphertext via AES-256-GCM and can derive these values directly from the plaintext. Remove them from the struct and use the decrypted values on-chain instead of comparing against sequencer-supplied duplicates. Saves 52 bytes of calldata per encrypted deposit (20-byte address + 32-byte memo). Closes #357 Made-with: Cursor
b785d3b to
5c7f28b
Compare
Resolve conflicts:
- docs/pages/protocol/privacy/{overview,execution,prover-design}.md:
accept deletion. The privacy docs were removed from the /pages tree
on main; equivalent content now lives in docs/specs/zone_spec.md.
- docs/specs/zone_spec.md: propagate the DecryptionData trim into the
spec. Removed the to/memo fields from the struct definition, and
rewrote the Onchain Decryption Verification section from a
three-step (Chaum-Pedersen + AES-GCM + plaintext match) process to
a two-step one where the zone uses the decrypted (to, memo)
directly instead of comparing against sequencer-supplied copies.
- IZone.sol and Rust crates auto-merged.
Made-with: Cursor
Resolve conflicts introduced by PR #355 (deposit counter) landing on main. Only code conflict: regenerated crates/tempo-zone/tests/assets/zone-test-genesis.json via `tempo-xtask generate-zone-genesis` since the deposit counter added state to ZoneInbox/ZonePortal bytecode. All other files (IZone.sol, ZoneInbox.sol, abi.rs, tests, etc.) auto-merged cleanly — the DecryptionData trim (remove to/memo) and the deposit counter additions are orthogonal. Made-with: Cursor
The integration tests' start_from_l1() patches the ZoneInbox/ZoneConfig bytecode at test setup by replacing Address::ZERO with the real L1 portal address. The previous regeneration baked 0xbb..bb as the placeholder, causing `expected 4 tempoPortal immutable(s) ... found 0` assertion failures in all start_from_l1 integration tests. Regenerated with --tempo-portal 0x0000...0000 to match main's convention. Made-with: Cursor
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
toandmemofields from theDecryptionDatastruct. These were redundant becauseZoneInboxalready decrypts the ciphertext via AES-256-GCM on-chain and can derive(to, memo)directly from the plaintext.ZoneInbox.solto use the decrypted values directly instead of comparing them against sequencer-supplied duplicates.Closes #357
Changes
IZone.soltoandmemofromDecryptionDataZoneInbox.soldecryptedTo/decryptedMemofromdecodePlaintext()directlyZoneInbox.t.sol,ZoneBridge.t.solabi.rs,advance_tempo.rsl1.rs,builder.rsoverview.md,crypto-review.md,prover-design.mdNote
The off-chain TIP-403 policy check in
l1.rsthat previously redirected unauthorized recipients by settingto: d.senderinDecryptionDatano longer has an on-chain effect — the contract now always uses the decrypted recipient. The policy check is retained for logging but the redirect variable is prefixed with_to suppress the unused warning. This behavioral change should be evaluated separately if sequencer-side recipient override is still desired.Test plan
forge build— Solidity compilesforge test --match-contract "ZoneInbox|ZoneBridge"— 41/41 tests passcargo build --workspace— Rust compilescargo test -p zone— advance_tempo and builder tests passMade with Cursor