Use BinaryNumberChip in LexicographicOrderingConfig to lower degree#566
Conversation
| pub tag_bits: [Expression<F>; 4], | ||
| pub id: MpiQueries<F, N_LIMBS_ID>, | ||
| pub is_id_unchanged: Expression<F>, | ||
| pub is_tag_and_id_unchanged: Expression<F>, |
There was a problem hiding this comment.
we also need is_tag_unchanged and is_id_unchanged is_field_tag_unchanged, I have used them in PR #552 , I believe others Op constraint will need in the near future .
There was a problem hiding this comment.
we can add them later when they're needed.
* feat(evm-circuit): add dummy gadget; make sha3 uses dummy gadget; enable erc20 integration tests * some comments
|
I left the shift description in the top of the file because I think it's much easier to understand. In my mind, the gadget is showing "one of C0, ..., C31 is non-zero and fits into 16 bits" by using an RLC to avoid overflowing. |
Just thought it might be a bit confusing if docs are different from the implementation. Perhaps leave the shifts in the comment, but mention that RLC is used to lower the degree? BTW, a naive question: wouldn't be possible to implement the approach with RLC without BinaryNumberChip? |
|
No it wouldn't be possible because we need to use the BinaryNumberChip to represent |
Of course, got it now. Thanks! Perhaps add a comment that there are two optimisations to reduce the degree: RLC and BinaryNumberChip. The PR looks cool to me! Just one consideration: seems like BinaryNumberChip could be useful elsewhere too, perhaps it could be put in evm_circuit/util? |
Co-authored-by: Eduard S. <eduardsanou@posteo.net>
I don't think it makes sense to move it into evm_circuit/util right now, since it's only used in by the state circuit at the moment. |
…um#566) * stage * support tx gas cost in RLP circuit * lookup to RLP table for TxDataGasCost
fixes #561