Open
Conversation
7869b93 to
519a15c
Compare
Contributor
iAmMichaelConnor
left a comment
There was a problem hiding this comment.
Not approving yet, because I don't know if we want it, and Nico will have opinions
Comment on lines
-16
to
-18
| where | ||
| T: Empty, | ||
| { |
Contributor
There was a problem hiding this comment.
Why was this change made? (I'm genuinely curious)
| are_duplicates: fn[Env](T, T) -> bool, | ||
| ) { | ||
| // Each original item must match its hinted deduped item. | ||
| original.for_each_i(|item, i| { |
Contributor
There was a problem hiding this comment.
Waaaait a minute... you're using the helper function that you hate! 😲
| /// Two read requests are considered duplicates if they read the same value from the same contract. | ||
| /// The counter (when the read happened) is irrelevant for dedup purposes. | ||
| pub fn are_duplicate_read_requests(a: Scoped<Counted<Field>>, b: Scoped<Counted<Field>>) -> bool { | ||
| (a.inner.inner == b.inner.inner) & (a.contract_address == b.contract_address) |
Contributor
There was a problem hiding this comment.
I'm still amazed that Noir makes this the same constraint cost as:
assert_eq(a.inner.inner, b.inner.inner);
assert_eq(a.contract_address, b.contract_address);
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.
Deduplicate
note_hash_read_requests,nullifier_read_requestsandkey_validation_requests_and_generatorsbefore validating the requests.The cost for dudup: