Skip to content

feat: exit when condition is not filled#928

Merged
ThomasPiellard merged 4 commits into
masterfrom
feat/plonk_exit_if_error
Dec 5, 2023
Merged

feat: exit when condition is not filled#928
ThomasPiellard merged 4 commits into
masterfrom
feat/plonk_exit_if_error

Conversation

@ThomasPiellard
Copy link
Copy Markdown
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
Copy Markdown
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
@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