zksecurity / noname

Noname: a programming language to write zkapps
https://zksecurity.github.io/noname/
161 stars 35 forks source link

Replace gate creation by wiring for copy constraints #118

Closed levihackerman-102 closed 1 month ago

levihackerman-102 commented 1 month ago

I've removed the gate creation in assert_eq_var(). I will be testing it further, for now I'm opening a draft PR.

levihackerman-102 commented 1 month ago

I think it would be better to create a method for directly adding a copy constraint for permutation as then I can use it in both assert_eq_var() and assert_eq_const().

levihackerman-102 commented 1 month ago

I'm getting some out of bound errors when running the cargo tests. It seems to be an off-by-one error but I'm not sure what caused it.

levihackerman-102 commented 1 month ago

@mimoo @katat do you have some idea of what might be going wrong here?

katat commented 1 month ago

Hi @levihackerman-102 I am not quite sure what is this PR for. Can you create an issue to describe what this PR is aiming to achieve?

levihackerman-102 commented 1 month ago

Hi @levihackerman-102 I am not quite sure what is this PR for. Can you create an issue to describe what this PR is aiming to achieve?

@katat this is for issue #55. Currently, we create a gate for the copy constraint but this aims to just do it by creating a permutation check using the wiring.

mimoo commented 1 month ago

so I don't think the approach is right. Now that I think about it I think we'll need something like union finds to make it work which is a bit more involved. I'll update the issue with more information

levihackerman-102 commented 1 month ago

so I don't think the approach is right. Now that I think about it I think we'll need something like union finds to make it work which is a bit more involved. I'll update the issue with more information

Alright, I'm willing to continue on this issue, are there any parts of the documentation that I could read to find out why this approach wouldn't work and what we can do to fix it? I'll also pickup another issue in the meantime.

mimoo commented 1 month ago

I wrote more about it here, let me know if that helps! https://github.com/zksecurity/noname/issues/55#issuecomment-2171904782

mimoo commented 1 month ago

I'll close this one, but feel free to reopen later!