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: exit when condition is not filled #928

Merged
merged 4 commits into from
Dec 5, 2023

Conversation

ThomasPiellard
Copy link
Collaborator

Description

The sanity checks in the plonk verifier (solidity) now return an error as soon as a condition is not matched instead of waiting for all checks to be done. It should save some gas when a condition is not matched (minor optim).

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Otherwise, looks good. But now wouldn't it make more sense to use gt(..., R_MOD-1) instead of iszero(lt(..., R_MOD))? Maybe additional storage for R_MOD-1 is bigger than additional opcode?

@ThomasPiellard ThomasPiellard merged commit 926b158 into master Dec 5, 2023
4 checks passed
@ThomasPiellard ThomasPiellard deleted the feat/plonk_exit_if_error branch December 5, 2023 13:24
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