-
Notifications
You must be signed in to change notification settings - Fork 857
Conversation
41a1c42
to
6117f85
Compare
I added a commented |
I didn't see this comment, maybe you didn't push it? |
It is line 198 and 202
|
Oh sorry, for some reason I was thinking it would be in the let out_of_bound_padding = is_out_of_range.expr() * (num_pushed.clone() - code_size_left + 1.expr());
let num_padding = 32.expr() - num_pushed.clone() + out_of_bound_padding; So that the circuit explicitly matches the logic in the assignment for |
It was originally not commented but after some changes it wasn't used any longer so I had to either remove or comment it :) |
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! The implementation looks nice and clear! It's really nice that you keep the code well commented :)
I've left a few suggestions regarding variable name consistency with the specs, please take a look! Since they are minor comments I'm approving already.
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.
General OK, several code style fix needed, like pu
/pa
, maybe full name is better.
Also some explicit type annotation found, is it necessary?
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!
Description
We intend here to support PUSHn with bytecode length inferior to n.
Issue Link
Issue #633
Linked to specs issue privacy-scaling-explorations/zkevm-specs#463
Type of change
Contents
Rationale
In pushn, "selectors" are switches to enable or disable lookup arguments on the bytcode bytes as well as to check whether these are non-null if needs be. They directly depend on "n" of PUSHn.
We add to these "selectors", "counters" which have similar role but are a subset of them depending on the bytecode length. We added these extra switches to be able to easily check the various identities at the risk of some redundancy.
To support these changes, modifications in stop.py also had to be done. More precisely, the check "is_out_of_range had to be extended to support small bytecodes.
How Has This Been Tested?
Extra tests have been added in push.rs (only).