zkevm-circuits icon indicating copy to clipboard operation
zkevm-circuits copied to clipboard

Refactor EVM circuit with challenge API

Open andyguzmaneth opened this issue 3 years ago • 6 comments

  • Using the challenge API instead of the instance value for randomness in EVM circuit

  • Maybe we´ll need another upgrade on the entire circuit?

  • Create a task in Halo2, Halo2 wrong, zkevm circuits? dependent on the previous

andyguzmaneth avatar Sep 08 '22 12:09 andyguzmaneth

Reference example: https://github.com/han0110/halo2/blob/feature%2Fchallenge-api/halo2_proofs/examples/shuffle.rs

ed255 avatar Sep 13 '22 08:09 ed255

Notes: update the abstraction done in the EVM circuit to support challenge API. Need to refactor the opcodes.

Uncertainty on how big this task is due to the size of the refactoring.

andyguzmaneth avatar Oct 27 '22 11:10 andyguzmaneth

Notes: in progress.

While checking the errors there's a poltergeist there. The problem how to assign cells no "advised" columns on phase 1 and phase 2. Can do it manually but t's a nightmare, not very maintainable. Find a way for a solution that is more maintainable.

Discussed some time ago how to stop using the word RLC, we could remove it and split the words into HIGH and LOW. Not sure the current progress. If the challenge APIs changes for word we have to revert it.

andyguzmaneth avatar Nov 24 '22 12:11 andyguzmaneth

Pending Discussion Notes:

  • Remove RLC and change everything to HIGH and LOW?

Future question, if splitting the circuit to different proofs, removing the challenge API has it's benefits. The challenge API one

  • is for word but
  • also using it for Keccak inputs, and we have never discussed removing that.
  • We also use the challenge API for lookups and haven't discussed removing that.
  • We might also use it for batched ECDSA integration.

andyguzmaneth avatar Nov 24 '22 12:11 andyguzmaneth

Notes: meeting with Adria, Carlos and David, addressing the problem on how to use the phase 1 and 2 cell manager. Still in progress.

Do we need to modify the cell manager? The manager now needs to take into account into which phase we're.

Some ideas that need to be explored: specify the phase the value is to allow propagation, but it could mess another part of the code.

andyguzmaneth avatar Dec 01 '22 12:12 andyguzmaneth

Notes: making progress. Pending: when the degree of expression is too high, it automatically needs to split the expressions + other things.

andyguzmaneth avatar Dec 08 '22 12:12 andyguzmaneth

Notes: in progress, it seems everything is working but having 2 pending topics:

  • Correctness: need to find systematic way to search for problems
  • Performance: 1st implementation working 3-4 times slower, main problem using call identifier from Halo2. Now is 50% slower. Want to continue to debug and optimize this

PR is in draft, could be reviewed. PR https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/990

andyguzmaneth avatar Dec 15 '22 12:12 andyguzmaneth