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!: fflonk #28

Merged
merged 1 commit into from
Oct 10, 2024
Merged

feat!: fflonk #28

merged 1 commit into from
Oct 10, 2024

Conversation

robik75
Copy link
Member

@robik75 robik75 commented Sep 23, 2024

What ❔

This PR implements all the functionality necessary to prove the fflonk compression chain on a GPU, taking the scheduler proof as input and producing a compression proof for the fflonk wrapper.

The fflonk compression chain is made up of 5 circuit proofs, last proof in the chain is the compression proof for the wrapper and uses poseidon 2 over BN254 scalar field for commitment.

Proving of the whole chain can be tested with the run_proof_compression_by_schedule test.

Measurements of proving times on the L4 GPU:

compression circuit 1: 0.5 s
compression circuit 2: 2.2 s
compression circuit 3: 5.8 s
compression circuit 4: 22.7 s
compression for wrapper circuit: 192.1 s

End to end, including loading setup data from disk, producing witnesses etc., the chain can be proven in ~230 seconds.
The highest GPU memory requirement is 14.2 GB.

This PR changes shivini's proving API and the GpuSetup structure, dependent code will need to be adjusted and serialized gpu setup files will need to be recreated.

Why ❔

fflonk proofs are cheaper to verify on L1.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via cargo fmt and linted via cargo clippy.

@robik75 robik75 merged commit acd71d8 into main Oct 10, 2024
13 checks passed
@robik75 robik75 deleted the rr/fflonk branch October 10, 2024 10:47
robik75 added a commit that referenced this pull request Oct 16, 2024
@robik75 robik75 mentioned this pull request Oct 16, 2024
robik75 added a commit that referenced this pull request Oct 16, 2024
@robik75 robik75 restored the rr/fflonk branch October 17, 2024 13:57
0xVolosnikov pushed a commit that referenced this pull request Oct 18, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.151.0](v0.150.9...v0.151.0)
(2024-10-18)


### ⚠ BREAKING CHANGES

* fflonk
([#28](#28))

### Features

* Bump `zksync-protocol` to 0.150.6
([#34](#34))
([43704f3](43704f3))
* enable compilation without Bellman CUDA
([#31](#31))
([39860f5](39860f5))
* fflonk
([#28](#28))
([acd71d8](acd71d8))


### Bug Fixes

* Attempt to pin github runner to 22.04.1
([#36](#36))
([ddb7311](ddb7311))


### Reverts

* "feat!: fflonk"
([#33](#33))
([dccaaa6](dccaaa6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <[email protected]>
@robik75 robik75 mentioned this pull request Oct 24, 2024
4 tasks
robik75 added a commit that referenced this pull request Oct 31, 2024
This is a re-do of #28.

# What ❔

This PR implements all the functionality necessary to prove the fflonk
compression chain on a GPU, taking the scheduler proof as input and
producing a compression proof for the fflonk wrapper.
A new method for generating the `GpuSetup` and `VerificationKey`
structures using a GPU is also implemented.

The fflonk compression chain is made up of 5 circuit proofs, last proof
in the chain is the compression proof for the wrapper and uses poseidon
2 over BN254 scalar field for commitment.

Proving of the whole chain can be tested with the
`run_proof_compression_by_schedule` test.

Measurements of proving times on the L4 GPU:

compression circuit 1: 0.5 s
compression circuit 2: 2.2 s
compression circuit 3: 5.8 s
compression circuit 4: 22.7 s
compression for wrapper circuit: 192.1 s

End to end, including loading setup data from disk, producing witnesses
etc., the chain can be proven in ~230 seconds.
The highest GPU memory requirement is 14.2 GB.



**This PR changes shivini's proving API and the `GpuSetup` structure,
dependent code will need to be adjusted and serialized gpu setup files
will need to be recreated.
`GpuSetup::from_setup_and_hints` function was removed, the
`gpu_setup_and_vk_from_base_setup_vk_params_and_hints` function was
implemented as a replacement.**

## Why ❔

fflonk proofs are cheaper to verify on L1.

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `cargo fmt` and linted via `cargo
clippy`.
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.

2 participants