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: staticcall fails -> revert immediately instead of updating state_success #804

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

ThomasPiellard
Copy link
Collaborator

In order to not waste gas in gas of a failure, the math functions (ec_add, ec_mul, etc) revert immediately in case of failure.

Until now we updated the variable stored at add(mload(0x40), add(mload(0x40), state_success) and continued the execution until the end even in case of failure.

Now at state_success we store only the result of the actual checks related to the proof, which are

  • the verification of the constraints at a random point
  • the KZG openings

@ThomasPiellard ThomasPiellard added the consolidate strengthen an existing feature label Aug 3, 2023
@ivokub ivokub self-requested a review August 3, 2023 13:09
@ivokub ivokub assigned ThomasPiellard and unassigned ivokub Aug 3, 2023
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.

Few deadlines and a double comment, but implementation LGTM.

backend/plonk/bn254/solidity.go Outdated Show resolved Hide resolved
backend/plonk/bn254/solidity.go Outdated Show resolved Hide resolved
backend/plonk/bn254/solidity.go Outdated Show resolved Hide resolved
@ThomasPiellard ThomasPiellard merged commit bd4a397 into develop Aug 3, 2023
@ThomasPiellard ThomasPiellard deleted the feat/revert_staticcall branch August 3, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consolidate strengthen an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants