Skip to content

fix: correct inverted constrained encryption check in message delivery#21399

Merged
nventuro merged 2 commits intomerge-train/fairiesfrom
claudebox/c8cf1c507575d776-3
Mar 12, 2026
Merged

fix: correct inverted constrained encryption check in message delivery#21399
nventuro merged 2 commits intomerge-train/fairiesfrom
claudebox/c8cf1c507575d776-3

Conversation

@AztecBot
Copy link
Collaborator

Summary

  • Fixed inverted boolean comparison in message_delivery.nr line 208 that caused ONCHAIN_CONSTRAINED to run encryption unconstrained and vice versa.
  • The check was comparing against ONCHAIN_UNCONSTRAINED instead of ONCHAIN_CONSTRAINED, flipping the condition passed to remove_constraints_if.

Backport

This is a backport fix targeting v4-next via merge-train/fairies.

Test plan

  • Verify constrained encryption is actually constrained when using ONCHAIN_CONSTRAINED delivery mode
  • Verify unconstrained encryption when using ONCHAIN_UNCONSTRAINED delivery mode

cc @nventuro for review

ClaudeBox log: https://claudebox.work/s/c8cf1c507575d776?run=3

The comparison on line 208 was checking against ONCHAIN_UNCONSTRAINED
instead of ONCHAIN_CONSTRAINED, causing remove_constraints_if to receive
the wrong boolean and run encryption unconstrained when it should be
constrained and vice versa.
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 12, 2026
@nventuro nventuro marked this pull request as ready for review March 12, 2026 02:55
@nventuro nventuro self-requested a review as a code owner March 12, 2026 02:55
@nventuro nventuro enabled auto-merge (squash) March 12, 2026 02:56
@nventuro nventuro merged commit e61e292 into merge-train/fairies Mar 12, 2026
10 checks passed
@nventuro nventuro deleted the claudebox/c8cf1c507575d776-3 branch March 12, 2026 21:41
AztecBot added a commit that referenced this pull request Mar 12, 2026
#21399)

## Summary
- Fixed inverted boolean comparison in `message_delivery.nr` line 208 that caused `ONCHAIN_CONSTRAINED` to run encryption unconstrained and vice versa.
- The check was comparing against `ONCHAIN_UNCONSTRAINED` instead of `ONCHAIN_CONSTRAINED`, flipping the condition passed to `remove_constraints_if`.

## Backport
This is a backport fix targeting `v4-next` via `merge-train/fairies`.

## Test plan
- [ ] Verify constrained encryption is actually constrained when using `ONCHAIN_CONSTRAINED` delivery mode
- [ ] Verify unconstrained encryption when using `ONCHAIN_UNCONSTRAINED` delivery mode

cc @nventuro for review

ClaudeBox log: https://claudebox.work/s/c8cf1c507575d776?run=3
@AztecBot
Copy link
Collaborator Author

✅ Successfully backported to backport-to-v4-next-staging #21453.

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

backport-to-v4-next claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants