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

feat: Forward ports #164

Open
wants to merge 64 commits into
base: dev
Choose a base branch
from
Open

feat: Forward ports #164

wants to merge 64 commits into from

Conversation

huitseeker
Copy link
Member

@huitseeker huitseeker commented Aug 28, 2024

This ports the following upstream PRs:

This completes parity with upstream's v1.0.0-rc.1

@huitseeker huitseeker force-pushed the forward_ports_44 branch 3 times, most recently from 604ca3d to 424f6a1 Compare August 28, 2024 17:32
adr1anh
adr1anh previously approved these changes Sep 2, 2024
Copy link
Contributor

@adr1anh adr1anh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circuit and constraint changes look good to me. Skimmed across the rest and it looks good to merge

@huitseeker
Copy link
Member Author

Except 210423a (porting succinctlabs/sp1#1099) does create a test failure (test_verifier_export). Working on it but if @adr1anh or @wwared have the time to take a look, that'd be much appreciated.

build/src/lib.rs Outdated Show resolved Hide resolved
The two columns in `AbsorbWorkspace` introduced in
`210423a5403b25319da2b60dce78e0d9d107d0aa` seemed to expose some
underlying issue which made the gnark circuit fail to accept a proof
even though the execution did not trigger any `TRAP`s. It seems like the
placement of these two columns in this struct were the reason why it was
failing, possibly some unfortunate interaction of `AlignedBorrow`, Rust
unions, or something else.

The issue exposed itself as a gnark constraint failure, and the specific
constraint that was failing was the one responsible for verifying the
constraints for the `Multi` chip. The `Multi` chip can have either a
`FriFoldChip` or a `Poseidon2WideChip` for each row. This might help
explain why this change was leading to constraint failures.
This refactor moves the `PublicValues` struct into the corresponding
`WithEvents` impls for each chip that needs access to it explicitly.
@huitseeker huitseeker force-pushed the forward_ports_44 branch 3 times, most recently from 527111d to a6e2d46 Compare September 18, 2024 21:30
- Replaced `Field` trait with `Sync` in various modules for the `Poseidon2WideChip` implementation and friends, thereby updating associated dependencies.
- In the `fri_fold` module, updated functions and methods to support the new interface and constraints with revised struct and replaced `Field` trait with `Sync`,
- Renamed package from `sp1-recursion-gnark-cli` to `sphinx-recursion-gnark-cli`
- Updated dependency from `sp1-recursion-gnark-ffi` to `sphinx-recursion-gnark-ffi`
- Included macOS-specific linking for CoreFoundation and Security frameworks in gnark-ffi package
- Enhanced error handling across three critical go files in recursion/gnark-ffi, ensuring each function returns an error along with its intended output if any error occurs.
- Improved `randomPolynomial` function to return an error along with the polynomial and added necessary error checks.
- Improved safety by adding error handling for `SetString` and `SetRandom` operations, the program will now terminate in case of any error.
- Added error handling for critical function calls, such as `os.MkdirAll` and `vk.ExportSolidity` in build.go.
- Strengthened guard against unexpected panic conditions in `prove.go` by enabling error handling for `ReadFrom` methods for the R1CS, proving key, and verifier key.
- Added a step in the GitHub workflow to install the `sphinx-recursion-gnark-cli` for integration testing.
- Prepared for future testing capabilities by adding a note for `test-plonk-bn254`, pending CLI readiness.
- Introduced cross-platform support for the Go build command in the gnark-ffi's build.rs script.
- Enhanced detection of the current operating system to set the appropriate GOOS environment variable.
- Replaced static type `F` with generic type parameter `T` across multiple methods in `MultiChip` struct,
- this should lead to better compatibility with upstream.
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.