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
added padding advice column in Exp Circuit #359
added padding advice column in Exp Circuit #359
Conversation
Hi @rrzhang139 , is this PR related to this one? privacy-scaling-explorations/zkevm-circuits#1062 |
@ed255 Yes, trying to push this PR before working on that one |
@rrzhang139 thanks for working in this order. As @roynalnaruto suggested, we should use some mechanism similar to the one used in privacy-scaling-explorations/zkevm-circuits#1064 for the I think the PR can serve you as inspiration on how to deal with this. |
Thanks! @CPerezz. Will check it out. |
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.
Can't we re-use is_step
column and remove padding
?
On this way, if is_step
is false
then we know it's padding.
Also see the comment for the final constraint.
I would like to discuss the possibility of a different approach:
Edit: I originally meant to say |
@ed255 Great idea! This was also proposed by @z2trillion today and I was gonna post it here for comments. This is totally doable, removes the need for padding and simplifies constraints as all the "dummy" steps would be I was thinking about this today and I am completely supportive of this approach! @rrzhang139 would you be willing to drop the current padding approach and instead implement this? Please ask any questions if you are not completely sure how this would work. |
Sorry, I pressed the button |
Won't this require padding anyway?? Maybe I'm missing something but I don't see how padding is not needed here. As "filling-up" is the same as padding isn't it?? |
@CPerezz yes I think you are right. Padding is involved, just how do we implement it to show that it is padding? I think exp_circuit does a good job delineating what is padding by creating a separate function, but I am open to some other design ideas. |
"Padding" would still be needed in the sense that some rows in the exp circuit will not be used by anything in the EVM circuit. the benefit (imo) would be that we wouldn't need to add an additional |
@z2trillion sounds good! Let's go for this then! |
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.
Good progress so far, I have a few suggestions :)
@ed255 @roynalnaruto @CPerezz can we merge this PR since its zkevm-circuits PR is already merged? It sufficiently reflects the padding behavior exhibited in the circuits. Because it oversimplifies the number of rows in a step (I think it only uses two rows per step), I don't think we need to include the specificities of inserting unusable rows like in the circuits. A few more changes I made to the latest commit were converting the steps -> rows by multiplying with OFFSET_INCREMENT, and removing pad_rows since we don't really pad but fill in dummy events. |
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.
Leaving the review to @ed255 as he was involved in the merge of the PR that solved this in the circuits.
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! Sorry for the delay on reviewing this 😅
There's currently a type error in class ExpCircuit:
# [...]
def __init__(self, max_exp_steps: int = 100) -> None:
#[...] We can merge once all the tests pass. |
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 once @ed255 's comments are applied!
@rrzhang139 Could you take a look at this and fix the typing issue so that we can merge this? Thanks! |
Sorry for the delay! Just pushed! |
@rrzhang139 sorry we've been away for some weeks, can you resolve the conflicts and we merge this? |
This is weird. I'm not getting any merge conflicts on my side so I can't even push a new commit. |
818fe50
to
5e7758d
Compare
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.
Overall looks good, except the one addition which is not required for the specs. I'll go through it again once you update your PR
@roynalnaruto I have resolved. But why is this conflict always appearing? |
i dont know, what about squashing commits into one and forcing push again? |
@rrzhang139 just following up, did you figure out how to solve the conflicts to get this merged? Need any help from PSE? |
@rrzhang139 we can take this PR and replicate it with the conflicts solved and merge it (we can't do it on the current PR because it's on a scroll branch); let us know if you'd prefer to work on it yourself, otherwise we'll take it in a few days :) |
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
Superseded by #419 |
There is no column to indicate whether a row is padding or not.