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

Don't verify proofs for failed zkApp commands #12550

Merged
merged 9 commits into from
Feb 2, 2023

Conversation

mrmr1993
Copy link
Member

This PR builds upon #12490, skipping the verification of proofs inside failed zkApp commands.

Checklist:

  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them

@mrmr1993 mrmr1993 requested a review from a team as a code owner January 26, 2023 02:51
@mrmr1993
Copy link
Member Author

!ci-build-me

@mrmr1993
Copy link
Member Author

!ci-build-me

User_command.to_verifiable ~ledger ~get ~location_of_account cmd
|> Or_error.ok_exn
in
{ With_status.data = cmd; status } ) )
Copy link
Member

Choose a reason for hiding this comment

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

This won't be enough in the case of failed transactions where vk hashes in account updates don't match with what's in the ledger or in the same transaction, right? Zkapp_command.Verifiable.create (called by to_verifiable here) will fail to find vk hashes, cause a failure here and the block will be rejected

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I've added an optional allow_missing_vk argument to create that should prevent this from triggering.
Sounds like we probably also need a test; I'll put something together later.

Base automatically changed from feature/early-fail to develop January 26, 2023 07:39
@mrmr1993
Copy link
Member Author

!ci-build-me

@mrmr1993
Copy link
Member Author

!ci-build-me

@@ -1185,34 +1191,43 @@ end = struct
return err
in
if Control.(Tag.equal Tag.Proof (Control.tag p.authorization))
then (
then
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better Applied|Failed check is performed before entering this block? That way none of VKs are included. Currently there could be some VKs included and some not and that might cause confusion.

Copy link
Member

@deepthiskumar deepthiskumar left a comment

Choose a reason for hiding this comment

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

Made a minor comment but otherwise looks good. Will wait for the unit test

@deepthiskumar
Copy link
Member

deepthiskumar commented Jan 31, 2023

For the unit test, do you think this is sufficient? I'll create a separate issue for adding this in the intg test #12433

@deepthiskumar
Copy link
Member

!ci-build-me

@deepthiskumar
Copy link
Member

!ci-build-me

@mrmr1993
Copy link
Member Author

mrmr1993 commented Feb 2, 2023

!ci-build-me

@deepthiskumar
Copy link
Member

!ci-build-me

@deepthiskumar deepthiskumar merged commit 3cece74 into develop Feb 2, 2023
@deepthiskumar deepthiskumar deleted the feature/skip-proof-verification-when-failed branch February 2, 2023 21:56
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