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

Flexible arity #66

Merged
merged 2 commits into from
Mar 14, 2024
Merged

Flexible arity #66

merged 2 commits into from
Mar 14, 2024

Conversation

RogerTaule
Copy link
Contributor

Currently, the merkle trees used in the BN128 Stark RecursiveF proof have an arity of 16. This was optimal from the prover performance point of view. The problem is that right now we are quite close to the next power of 2 (our final circuit has 16.509M and 2^24 = 16.777M), and with Feijoa chances are that we may surpass that value.
To mitigate this problem, this PR parametrizes the arity of the merkle tree to be any power of two. The reasoning behind this is that the VerifyMerkleHash circuit was originally optimized for Groth16 by adding a lot of sums, which is not efficient for Fflonk, our current proving system.
This PR not only adds the parametrization, but proposes changing the arity to 4, which leads to a 4M constraints reduction on the final circuit. The proof time will not be impacted much, since the extra proving time added to the StarkRecursiveF will be compensated in the Fflonk proof

@RogerTaule RogerTaule requested a review from jbaylina March 11, 2024 07:42
@cla-bot cla-bot bot added the cla-signed label Mar 11, 2024
@RogerTaule RogerTaule force-pushed the feature/flexibleArity branch from 0ed9720 to 9d22595 Compare March 14, 2024 08:57
@RogerTaule RogerTaule changed the base branch from main to develop March 14, 2024 08:57
Copy link

sonarcloud bot commented Mar 14, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarCloud

@jbaylina jbaylina merged commit b2bafc8 into develop Mar 14, 2024
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants