zkevm-specs
zkevm-specs copied to clipboard
Use 32 byte RLC in simple opcode gadgets instead of variable byte RLC
Currently different opcode gadgets use different number of bytes for RLC encoding depending on the type of data when doing lookups.
For example, for CALLER we use 20 bytes, for CALLDATASIZE we use 5 bytes.
Following a discussion with @han0110: we could reuse the constraints to encode a 32 byte RLC in all places as an optimization.
See more details in the original discussion: https://github.com/appliedzkp/zkevm-specs/pull/96#discussion_r788593342
@kilic, are your concerns about ECC multiplication cycles related to this?
We should decide on this maybe as we have a lot of opcodes implemented refering to this and would be nice to decide on it for the upcoming ones.
See for example: https://github.com/privacy-scaling-explorations/zkevm-specs/pull/241/files#
cc: @ChihChengLiang @han0110 @ed255 @kilic
We should decide on this maybe as we have a lot of opcodes implemented refering to this and would be nice to decide on it for the upcoming ones.
See for example: https://github.com/privacy-scaling-explorations/zkevm-specs/pull/241/files#
cc: @ChihChengLiang @han0110 @ed255 @kilic
I'm inclined to ignore this issue for now (so that it doesn't affect the unimplemented opcodes), and once all opcodes are implemented, revisit this as a possible optimization. So I would leave this as a low priority issue in the collection of small optimizations we can do in the future.
This issue became irrelevant with the word lo/hi refactor https://github.com/privacy-scaling-explorations/zkevm-specs/pull/390