Skip to content

Implement "glue" for prover modules over koalabear field (old) - #4

Closed
OmegaTymbJIep wants to merge 11 commits into
mainfrom
feature/prover-over-koalabear
Closed

Implement "glue" for prover modules over koalabear field (old)#4
OmegaTymbJIep wants to merge 11 commits into
mainfrom
feature/prover-over-koalabear

Conversation

@OmegaTymbJIep

@OmegaTymbJIep OmegaTymbJIep commented Apr 25, 2025

Copy link
Copy Markdown

Changes

  • Created new FlattenColumn component in common package that:
    • Manages flattened limbs and mask columns
    • Implements projection constraints to verify data consistency
    • Supports reuse across multiple circuits to avoid duplication
  • ecarith, modexp, ecpair
    • Used Flatten column for a Plonk in Wizard part.
    • Adjusted constraints by dividing 128-bit limbs into 8 columns of 16 bits.

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

## Changes

Added comprehensive implementation of flatten column functionality to handle limb data in a circuit:

1. Created new `FlattenColumn` component in `common` package that:
   - Manages flattened limbs and mask columns
   - Implements projection constraints to verify data consistency
   - Supports reuse across multiple circuits to avoid duplication

2. Refactored EC arithmetic modules to use shared flatten column:
   - Updated ECADD and ECMUL to use common implementation
   - Added proper column sharing between circuits
   - Improved variable naming for clarity
1. Flatten columns for limbs and circuit masks were used in the modexp module for both 256-bit and 4096-bit instances.
2. Updated modexp constraints for a limbs column divided into 8 smaller columns.
Comment thread prover/zkevm/prover/common/flatten_column.go Outdated
Comment thread prover/zkevm/prover/ecarith/ecadd.go Outdated
@AlexandreBelling

Copy link
Copy Markdown

The PR is good, everything seems to make sense to me. Only had 2 suggestions.

OmegaTymbJIep and others added 7 commits April 29, 2025 14:12
## Changes 

1. Use Flatten column in the ecpair module for a Plonk in Wizard part.
2. Adjust constraints for 8 columns of 16 bits.
3. Change the G2GroupCheckInstance.IsSuccess, so it uses 8 field values to represent the boolean, but the first 7 are empty.
@Nazarevsky
Nazarevsky force-pushed the feature/prover-over-koalabear branch from 792fb64 to ed3f759 Compare May 16, 2025 15:25
Nazarevsky and others added 2 commits May 16, 2025 18:26
* Make 16 bit limbs for address

* Make 16 bit limbs for txn signature

* Rewrite ecdata for 16 bit limbs

* Apply 16 bit divisions for unaligned data

* Fix address constrains, remove unused variables

* Break into 16 bit limbs

* Refactor constant name and structures assignment

* Refactor constant name and structures assignment

* Fix divideBytes empty input function, add test

* Fix wrong address trimming

* Change reader to read antichamber csv file

* Remove mocked data for modules that use hash module

* Add working ecdsa module

* Fix constraints and circuit

* Apply constraint for an every column

* Get rid of magic variables

* Fix address constraint over all columns

* Use constants from the common module

* Change constants, change comments, bring commented constraints back

* Add import for circuit

* Change constant name, remove commented import

* Fix ScanStreams, change limb size

* Make constant global

* Add left alignment for limbs

* Add GnarkDataLA column

* Uncomment projection query

* Remove commented print, fix formatting

* Rename DivideBytes into SplitBytes

* Fix magic values

* Change gnarkDataOffsetAlignment from bytes to bits
@OmegaTymbJIep OmegaTymbJIep changed the title Implement "glue" for prover modules over koalabear field Implement "glue" for prover modules over koalabear field (old) May 20, 2025
@OmegaTymbJIep

Copy link
Copy Markdown
Author

Moved to #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants