feat: Refactor#153
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive architectural refactoring that transforms the ProveKit repository from a monolithic structure into a clean, modular design. It separates concerns by extracting core functionality into focused modules under the provekit/ directory and reorganizes tooling under tooling/.
- Creates modular ProveKit crates:
provekit-common,provekit-r1cs-compiler,provekit-prover, andprovekit-verifier - Extracts CLI tools into dedicated
tooling/cliand benchmarking infrastructure intotooling/provekit-bench - Moves experimental code to
playground/and maintains backward compatibility
Reviewed Changes
Copilot reviewed 95 out of 161 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tooling/provekit-gnark/src/lib.rs | New lib entry point for Gnark integration utilities |
| tooling/provekit-gnark/src/gnark_config.rs | Refactors imports to use modular provekit-common |
| tooling/provekit-gnark/Cargo.toml | Package rename and dependency restructuring |
| tooling/provekit-bench/tests/compiler.rs | Test suite for compilation with updated imports |
| tooling/provekit-bench/benches/bench.rs | Benchmarking suite with modular imports |
| tooling/cli/src/cmd/*.rs | CLI command implementations using separated modules |
| provekit/verifier/src/whir_r1cs.rs | New verification functionality for WHIR R1CS |
| provekit/verifier/src/noir_proof_scheme.rs | Verification trait implementation |
| provekit/prover/src/whir_r1cs.rs | Proving functionality extracted and modularized |
| provekit/common/src/lib.rs | Core types and utilities shared across modules |
| skyscraper/*/Cargo.toml | Workspace metadata updates for consistency |
Comments suppressed due to low confidence (1)
provekit/prover/src/whir_r1cs.rs:1
- [nitpick] Commented-out code should be removed unless there's a specific reason to keep it. If it's needed for reference, add a comment explaining why it's preserved.
use {
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed WallTime Performance ReportMerging #153 will degrade performances by 28.91%Comparing
|
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
prove_poseidon_1000 |
15.8 s | N/A | N/A | |
prove_poseidon_1000_with_io |
17.4 s | N/A | N/A | |
read_poseidon_1000 |
1.6 s | N/A | N/A | |
verify_poseidon_1000 |
2.3 ms | N/A | N/A | |
| ❌ | montgomery_interleaved_3 |
113 ns | 128 ns | -11.72% |
| ❌ | scalar_mul |
95 ns | 128 ns | -25.78% |
| ❌ | simd_mul |
112 ns | 147 ns | -23.81% |
| ❌ | block_sqr |
91 ns | 128 ns | -28.91% |
| 🆕 | prove_poseidon_1000 |
N/A | 15.5 s | N/A |
| 🆕 | prove_poseidon_1000_with_io |
N/A | 17.3 s | N/A |
| 🆕 | read_poseidon_1000 |
N/A | 1.6 s | N/A |
| 🆕 | verify_poseidon_1000 |
N/A | 1.8 ms | N/A |
🏗️ Major Repository Refactoring: Modular Architecture & Clean Separation of Concerns
Overview
This PR introduces a comprehensive architectural refactoring of the ProveKit repository, transforming a monolithic structure into a clean, modular design that separates concerns and improves maintainability.
🏗️ New Architecture
Core ProveKit Modules:
Tooling & Infrastructure:
Research & Experiments:
🔧 Key Improvements
Clean Module Separation
Better Organization
🚀 Benefits
🔄 Backward Compatibility
This refactoring maintains API compatibility:
This refactoring establishes a solid foundation for future development while maintaining the high-performance characteristics that make ProveKit suitable for mobile zero-knowledge applications.