Implement bytecode refactor spec in circuit#1044
Conversation
han0110
left a comment
There was a problem hiding this comment.
LGMT! Nice refactor! Only left some unimportant comments.
Co-authored-by: Han <tinghan0110@gmail.com>
|
please @icemelon assign a reviewer |
|
I assigned myself and will take a look this week. @leolara |
ChihChengLiang
left a comment
There was a problem hiding this comment.
LGTM. I left some comments, but they might be out of the scope of this PR. Feel free to ignore them.
| cb.require_equal( | ||
| "assert cur.hash == EMPTY_HASH", | ||
| meta.query_advice(bytecode_table.code_hash, Rotation::cur()), | ||
| empty_hash, |
There was a problem hiding this comment.
I remember we have cb.empty_hash_rlc(), but that method was available for ConstraintBuilder but not for BaseConstraintBuilder.
No change is needed here.
| meta.query_advice(keccak_table.is_enabled, Rotation::cur()), | ||
| )]; | ||
|
|
||
| // TODO: perhaps write this explicitly so it is more readable the matching |
There was a problem hiding this comment.
Agree we should make this more readable. One idea I have in mind is to have a function in keccak table side.
match_columns(input_rlc, length, output_hash) -> Vec<(Column, Column)>
The function is only responsible for yielding correct pairs of columns. We then add selectors and query cells here.
There was a problem hiding this comment.
I was going to complain, but I actually think what you are saying makes sense.
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
* In [#1044](privacy-ethereum/zkevm-circuits#1044) PR from PSE, there was a renaming from Length to Header of the Bytecode Tag. However, some parts of the code were not properly updated, so I made the change.
* In PR from PSE, github.com/privacy-ethereum/zkevm-circuits/pull/1044 there was a renaming from Length to Header of the Bytecode Tag. However, some parts of the code were not properly updated, so I made the change.
* In PR from PSE, github.com/privacy-ethereum/zkevm-circuits/pull/1044 there was a renaming from Length to Header of the Bytecode Tag. However, some parts of the code were not properly updated, so I made the change.
* In PR from PSE, github.com/privacy-ethereum/zkevm-circuits/pull/1044 there was a renaming from Length to Header of the Bytecode Tag. However, some parts of the code were not properly updated, so I made the change.
Closes #1026
We have done the following refactor to the spec:
privacy-ethereum/zkevm-specs#151
privacy-ethereum/zkevm-specs#340
privacy-ethereum/zkevm-specs#351
This task is to implement this new spec into the bytecode circuit implementation in this repo.