Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Type simplifications #297

Merged
merged 8 commits into from
Feb 5, 2024
Merged

Some Type simplifications #297

merged 8 commits into from
Feb 5, 2024

Conversation

huitseeker
Copy link
Contributor

@huitseeker huitseeker commented Feb 3, 2024

E1: Engine<Base = E2::Scalar>,
E2: Engine<Base = E1::Scalar>,
C1: StepCircuit<E1::Scalar>,
C2: StepCircuit<E2::Scalar>,

Becomes
E1: CurveCycleEquiped

And

E1: Engine<Base = E2::Scalar>,
E2: Engine<Base = E1::Scalar>,
C1: StepCircuit<E1::Scalar>,
C2: StepCircuit<E2::Scalar>,
S1: RelaxedR1CSSNARKTrait<E1>,
S2: RelaxedR1CSSNARKTrait<E2>,

becomes

E1: CurveCycleEquipped
S1: RelaxedR1CSSNARKTrait<E1>,
S2: RelaxedR1CSSNARKTrait<SecEng<E1>>,

Note

Lurk is not expected to compile on top of this, Companion PR at lurk-lab/lurk-beta#1092

…ucts

TL;DR: This is deinterleaving, i.e. E1, E2, C1, C2 .. becomes E1, C1, .. E2, C2, ...

- Reorganized order of generic parameters across various rust function calls and implementations, affecting structures such as `PublicParams`, `RecursiveSNARK`, and `CompressedSNARK`, among others.
- Updated all relevant unit tests to align with the new ordering of parameters.
- Introduced a new convenience trait to pair engines with fields in a curve cycle relationship, extending mod.rs traits.
- Added CurveCycleEquipped to the provider mod.rs traits list.
- Implemented CurveCycleEquipped to Bn256Engine, Bn256EngineKZG, Bn256EngineZM, Secp256k1Engine, and PallasEngine, setting respective secondary types accordingly.
- Expanded functionality for multiple engine systems with the addition of a secondary engine of 'Self'.
- Refactored the bench, examples, and source files to simplify `PublicParams`, `CompressedSNARK`, and `RecursiveSNARK` setup by removing the redundant secondary engine type and circuit parameters.
- Modified all functions, methods, and type definitions that depend on the `PublicParams`, `CompressedSNARK`, and `RecursiveSNARK` setup to reflect these changes.
- Removed all (default) instances of `TrivialCircuit` parameters from the codebase, simplifying the setup process.
- Renamed `SecEngine` to `SecEng`,
- Adjustments were made to functions to reflect the updated parameters without changing the functionality or behavior of the code.
…ied testing

TL;DR : use CurveCycle and remove Phantom parameters

- Altered and simplified generic parameter restrictions for `NonUniformBench` and `NonUniformCircuit`.
- Refactored import statements in `benches/common/supernova/mod.rs` for a cleaner and simplified codebase.
- Refactored the use of `TrivialTestCircuit` from the `benches/common/supernova/bench.rs` file.
- Revised the `RecursiveSNARK` type in `bench.rs`,
- Refactored and simplified function signatures in `test.rs`,
- Made significant changes to the `TestROM` structure and adjusted related function implementations within `src/supernova/test.rs`.
- Overall, improved the use of generics.
- Simplified engine parameterization by replacing dual `E1` and `E2` variables with a single `E1` in relevant function definitions.
- Enhanced code readability by changing type constraints to `CurveCycleEquipped` and implementing the `SecEng` projection across multiple function modules.
- Updated calls and variable assignments to align with the new engine parameterization.
- Retained original functionalities of the affected functions even with the considerable code modifications and simplifications.
samuelburnham
samuelburnham previously approved these changes Feb 5, 2024
src/traits/mod.rs Outdated Show resolved Hide resolved
src/traits/mod.rs Outdated Show resolved Hide resolved
porcuquine
porcuquine previously approved these changes Feb 5, 2024
@huitseeker huitseeker dismissed stale reviews from porcuquine and samuelburnham via 05cde95 February 5, 2024 20:05
- Improved readability of CurveCycleEquipped function comment in traits module by adding backticks around function name.
@huitseeker huitseeker force-pushed the type_simplifications branch from 05cde95 to 0dc08a9 Compare February 5, 2024 20:10
@huitseeker huitseeker added this pull request to the merge queue Feb 5, 2024
Merged via the queue into dev with commit 788e878 Feb 5, 2024
8 of 9 checks passed
@huitseeker huitseeker deleted the type_simplifications branch February 5, 2024 20:38
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.

3 participants