-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: http locking circuit codegen #76
Conversation
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.
absolute charizard fire!!!
one step closer.
@Autoparallel while making this PR:
circuits/http/locker.circom
Outdated
|
||
// TODO: change r | ||
headerNameValueMatch[data_idx] <== HeaderFieldNameValueMatch(DATA_BYTES, headerNameLen, headerValueLen)(data, header, value, 100, data_idx); | ||
hasMatched += headerNameValueMatch[data_idx]; |
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.
this is underconstrained. I believe we need to make it hasMatched[DATA_BYTES]
and then add with previous value.
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.
Is it actually though? @devloper made a similar comment about an accumulator var being underconstrained, but I think it isn't. If you try to assign hasMatched
to something non-quadratic, then it throws an error actually.
If it is underconstrained i must know why!!! need to learn!!!
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.
I made a change to address this, but still want to know why.
Also the change didn't change the number of constraints I believe
include "circomlib/circuits/gates.circom"; | ||
include "@zk-email/circuits/utils/array.circom"; | ||
|
||
template LockStartLine(DATA_BYTES, beginningLen, middleLen, finalLen) { |
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.
umm, why not run IsEqualArray
3 times, first from 0..beginningLen
, beginningLen+1..beginningLen+1+middleLen
, and so on?
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.
I suppose this template will be useful when we can parse multiple spaces between each value in start line, but current parser doesn't.
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.
we could do what you suggested!
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.
I wanted to avoid using the buggy getSubArray
template
In This PR
We got the following done:
circuits/test/http/codegen.test.ts
.Hence, at this point we should have these accomplished (not just due to this PR by any means):
Headers
matches #56Host
matches #55This should honestly be cleaned up and made a bit better, but this is an MVP for now before I head out of town for a bit! Feel free to make any changes as needed on top of this base functionality :)