-
Notifications
You must be signed in to change notification settings - Fork 857
fix: Mock Challenges
with different values
#930
Conversation
👋 Comment on this pull request with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Although I think we could just remove the old one and always require 2 different mock randomness, but this also makes it flexible.
@han0110 will do so then. It just annoys me a lot that we can't just take one and add X to it to det the second one.. But will just require 2 and that's all! Thanks! |
As mentioned in #926, the `Challenges::mock` function was not adding different values for the `Challenges`. Therefore, a new function has been added that allows mocking by passing two different values (one per each challenge). This allows to keep the API we previously had and also, reduce the need to send always 2 values when only 1 can be passed. Resolves: #926
45456b5
to
7991cee
Compare
Just rebased. Will merge as soon as CI passes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! But I have one quick question: I thought the point of this fix was to use different values for each challenge with the mock prover, but you're using block.randomness
in both. Is it because it fails when the randomnesses are different?
The only place where the two are needed is Keccak circuit AFAIK. In the rest of places, I left the same code/config as we had before. |
…ions#930) * wip: preliminary work sig circuit/lookp * feat: handle panics and edge cases in sig circuit * fix: handle v not boolean * fix: fq modulus not assigned and bus-mapping handle overflowing r/s * fix: sig_v handle invalid values (lookup) and is_valid dev_load fix * refactor (review comment) * fix: no sig table lookup for invalid sig_v * remove wrong test case (assertion fail)
* wip: preliminary work sig circuit/lookp * feat: handle panics and edge cases in sig circuit * fix: handle v not boolean * fix: fq modulus not assigned and bus-mapping handle overflowing r/s * fix: sig_v handle invalid values (lookup) and is_valid dev_load fix * refactor (review comment) * fix: no sig table lookup for invalid sig_v * remove wrong test case (assertion fail)
* wip: preliminary work sig circuit/lookp * feat: handle panics and edge cases in sig circuit * fix: handle v not boolean * fix: fq modulus not assigned and bus-mapping handle overflowing r/s * fix: sig_v handle invalid values (lookup) and is_valid dev_load fix * refactor (review comment) * fix: no sig table lookup for invalid sig_v * remove wrong test case (assertion fail)
* wip: preliminary work sig circuit/lookp * feat: handle panics and edge cases in sig circuit * fix: handle v not boolean * fix: fq modulus not assigned and bus-mapping handle overflowing r/s * fix: sig_v handle invalid values (lookup) and is_valid dev_load fix * refactor (review comment) * fix: no sig table lookup for invalid sig_v * remove wrong test case (assertion fail)
* wip: preliminary work sig circuit/lookp * feat: handle panics and edge cases in sig circuit * fix: handle v not boolean * fix: fq modulus not assigned and bus-mapping handle overflowing r/s * fix: sig_v handle invalid values (lookup) and is_valid dev_load fix * refactor (review comment) * fix: no sig table lookup for invalid sig_v * remove wrong test case (assertion fail)
As mentioned in #926, the
Challenges::mock
function was not adding different values for theChallenges
. Therefore, a new function has been added that allows mocking by passing two different values (one per each challenge).This allows to keep the API we previously had and also, reduce the need to send always 2 values when only 1 can be passed.
Resolves: #926
I considered to do a
Trait
-based approach by ussingAdd<Output=Self>
butExpression<F>
does not implement this trait. Same happens forChallenge
(the one in Halo2).Therefore, the easiest way to not break the current API and also, not ask for 2 values when we don't need them to be different (everywhere minus Keccak) is to introduce a new function.