-
Notifications
You must be signed in to change notification settings - Fork 857
Bytecode Circuit: Refactor word_rlc into word lo/hi #1468
Conversation
Should I remove the hash_rlc references? |
The test do not pass I think because the keccak does not has the hash_word yet. |
Keccak already have hash_word type, https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/word-lo-hi/zkevm-circuits/src/table/keccak_table.rs#L13 and with |
I fixed the tests by deleting the lookup to the output_rlc, from the comment before I checked |
Now I have eliminated the code_hash(rlc) and renamed the code_hash_word to code_hash. |
@ChihChengLiang @hero78119 please review again, I think it is good now |
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.
Except for few word type usage, other LGTM!
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 after the comments are addressed.
let empty_hash_word: Word<Expression<F>> = | ||
Word32::new(EMPTY_CODE_HASH_LE.map(|v| Expression::Constant(F::from(v as u64)))) | ||
.to_word(); |
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 don't need to convert to 32 limbs of expressions and then merge to 2 limbs.
let empty_hash_word: Word<Expression<F>> = | |
Word32::new(EMPTY_CODE_HASH_LE.map(|v| Expression::Constant(F::from(v as u64)))) | |
.to_word(); | |
let empty_hash_word: Word<Expression<F>> = Word::from(EMPTY_CODE_HASH).to_word(); |
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.
Word::from(CodeDB::empty_code_hash()) will produce a Word<Value> not a Word<Expression>.
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.
Do you want me to implement to_word trait for Word<Value>? How should it behave if Value::unknown?
@ChihChengLiang I have merged the base branch and that has substituted the From by From which is good |
@hero78119 I can add tests in another Pr if that is what you mean, I don't understand why this PR depend on the other one? I wouldn't prolong this PR much more, it is getting long and I think that could create more conflicts. |
@ChihChengLiang please check again :-) |
Notice there are some error message when running unittest related to bytecode_circuit for this pr
some error msg snippet
please kindly help to check |
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.
All good. LGTM
When I ran that comment in my local branch I get:
Those errors are from tests where the positive result is an invalid proof. I don't see how #1488 is connected to this PR, they don't change the same files |
Hi @leolara Besides https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/word-lo-hi/.github/workflows/ci.yml#L80 here can just append |
@hero78119 I tried your script on the Fixing the error logs is out of the scope of this pull request. Can we fix them in future PRs? |
Yeah it's ok we fixed in future pr., my opinion is it will be better if we can identify the root cause. Just worry that actually error msg hide something so we can't know whether the word-lo-hi apply on bytecode_circuit break something or not. Then one thing lefted is adding bytecode_circuit to ci then I think all good to go now |
@hero78119 By "adding bytecode_circuit to ci," we're saying adding bytecode_circuit to the following place right? zkevm-circuits/.github/workflows/ci.yml Line 80 in cb6c17c
|
I think:
|
Hi @leolara It's just one line change, maybe I didn't explain it clear. Please see @ChihChengLiang comment above #1468 (comment) |
The light tests pass in Ci, when you add the light test back you can add bytecode_circuit. I can either:
I think the second option is the way to go because:
|
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.
Ok then all LGTM! I will add bytrcde circuit to ci later
@hero78119 thanks |
Description
Bytecode Circuit: Refactor word_rlc into word lo/hi
Issue Link
Closes #1380
Type of change
Contents
Bytecode Circuit: Refactor word_rlc into word lo/hi
Rationale
In Issue
How Has This Been Tested?
Running unit tests