-
Notifications
You must be signed in to change notification settings - Fork 857
Implement PUSH0
instruction
#1463
Implement PUSH0
instruction
#1463
Conversation
Hi @silathdiir thanks for this PR! I noticed that we don't have the spec/python for PUSH0 in https://github.com/privacy-scaling-explorations/zkevm-specs could you also make a spec PR so that we can review that first? |
Got it. Will add a spec PR first. Thanks. |
Hi @silathdiir do you have any update on the spec for the PUSH0? Do you need any help from our side? |
I am sorry that I haven't start to work on the spec for |
4be4555
to
032a4af
Compare
Hi @ed255, sorry for the delay. I add the |
CI: "Waiting for a runner to pick up this job..." |
637b90c
to
0b922cf
Compare
It seems the self hosted github workers are taking a long time to pick up the jobs. Maybe the AWS region we're using has low availability for the required server instances right now? Update: On the last run, the time for the workers to pick up the job was within an acceptable time range, so probably the previous issue was temporary. |
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.
The branch needs to be rebased (since pushn has been merged). I added a question for checking that 0 is indeed pushed on the stack.
if idx == 0 { | ||
- (OpcodeId::PUSH0.as_u8() + idx as u8).expr(); | ||
|
||
cb.condition(sel.expr(), |cb| { |
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.
Shouldn't we also lookup-check the byte if is_push0 is true at idx=0 (we check later on that byte = 0 when is_push0 is true)?
In which case, for idx=0, we could remove the condition iiuc.
on scroll fork, we support both push0 and the new PUSHN full constraints. We can pick the changes later this week. ref scroll-tech@2b4e90d |
0b922cf
to
29e2809
Compare
Thanks! |
Hi @rrtoledo, I pick the latest changes of |
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 with some nitpicks.
Thanks for adding the PUSH0 and clean up the circuit code!
let mut is_pushed_cell_prev = true.expr(); | ||
let mut is_padding_cell_prev = true.expr(); |
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.
Great adding clear variable names :)
Co-authored-by: Chih Cheng Liang <[email protected]>
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
96b3c4e
Description
Add
PUSH0
opcode to eth-types. It could be parsed from0x5f
or a string of PUSH0.In eth-types, update
is_push
function to return true forPUSH0 .. PUSH32
, and add a new functionis_push_with_data
, it returns true forPUSH1 .. PUSH32
.Small fixes to replace
PUSH1 - 1
with PUSH0 value.Add PUSH0 implementation to bus-mapping, and
PushGadget
to support PUSH0 in zkevm-circuits.Issue Link
Close #1473
Reference previous PR #1361
zkevm-specs PR privacy-scaling-explorations/zkevm-specs#471
Type of change