feat: check event commitment nullifier existence on Noir side#21151
Closed
benesjan wants to merge 3 commits into
Closed
feat: check event commitment nullifier existence on Noir side#21151benesjan wants to merge 3 commits into
benesjan wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nventuro
reviewed
Mar 6, 2026
Comment on lines
+24
to
+33
| if check_nullifier_exists(event_commitment) { | ||
| enqueue_event_for_validation( | ||
| contract_address, | ||
| event_type_id, | ||
| randomness, | ||
| serialized_event, | ||
| event_commitment, | ||
| tx_hash, | ||
| recipient, | ||
| ); |
Contributor
There was a problem hiding this comment.
Heh, this is not what I meant. This would be terrible as it'd introduce an extra roundtrip per message.
I meant that the callers of this function already have access to the tx effects, and that we'd just search there (just like we do for the note hash when finding the nonce). But I just realized we don't have all nullifiers, only the first one, so we can't search for this. Given that I'd abandon this then.
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.
Implemented this PR as a reaction to this comment. Makes sense to have the check in Noir for events as well as it's a good software design to handle invalid data as soon as possible in the data processing pipeline. It will also make the behavior the same between note and events since in the case of notes we have already performed this validation in Noir when brute forcing nonces.
Summary
check_nullifier_existscall inprocess_private_event_msg(Noir) to verify the event commitment exists in the nullifier tree before enqueuing it for validationevent_service.tsthat verifies the siloed event commitment is present in the tx's nullifiers🤖 Generated with Claude Code