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

Feature/include network id for account update hash berk #13880

Conversation

ghost-not-in-the-shell
Copy link
Member

@ghost-not-in-the-shell ghost-not-in-the-shell commented Aug 16, 2023

Explain your changes:
This PR adds chain name to the account update hash in order to address the concern described here: #13759

Explain how you tested your changes:
Added a section for testing account update with different network ID in zkapps-integration-test;
also added a test in transaction_pool, but since we only have dummy verifier in unit-test, so it should pass the verification.

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • 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

…include-network-id-for-account-update-hash-berk
@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

Tang Jiawei added 2 commits August 18, 2023 00:38
@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

Copy link
Member

@mrmr1993 mrmr1993 left a comment

Choose a reason for hiding this comment

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

See nit in comments.

Also, shouldn't we have a test to check that we reject these transactions as part of blocks (/staged ledger diffs) too?

src/lib/hash_prefixes/hash_prefixes.ml Show resolved Hide resolved
@ghost-not-in-the-shell ghost-not-in-the-shell requested a review from a team as a code owner August 24, 2023 00:36
@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

…include-network-id-for-account-update-hash-berk
…include-network-id-for-account-update-hash-berk
@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

@@ -242,7 +243,8 @@ module Make (Inputs : Intf.Test.Inputs_intf) = struct
, zkapp_command_invalid_nonce
, zkapp_command_insufficient_funds
, zkapp_command_insufficient_replace_fee
, zkapp_command_insufficient_fee ) =
, zkapp_command_insufficient_fee
, zkapp_command_single_account_update ) =
Copy link
Member

Choose a reason for hiding this comment

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

nit: could you rename this to something more meaningful- zkapp_command_cross_network_replay or something?


(* This test uses dummy verifiers, that's why it's not rejecting the problematic zkapp command
But this test is still useful, since it exercises the parts that doesn't requires a pickles instance
Combining together with the test that uses pickles directly, these 2 tests would make sure that
Copy link
Member

Choose a reason for hiding this comment

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

can you edit the comment to describe this test? What are the 2 tests here?

@@ -4581,6 +4581,130 @@ module Make_str (A : Wire_types.Concrete) = struct
in
zkapp_command

module Single_account_update_spec = struct
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment to describe what this is for (as there are a few different specs) and when it can be used?

Tang Jiawei added 4 commits August 25, 2023 22:40
zkapp_command_cross_network_replay
…include-network-id-for-account-update-hash-berk
…' of github.com:MinaProtocol/mina into feature/include-network-id-for-account-update-hash-berk
@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

…include-network-id-for-account-update-hash-berk
@ghost-not-in-the-shell
Copy link
Member Author

!ci-build-me

@deepthiskumar
Copy link
Member

!approved-for-mainnet

@ghost-not-in-the-shell ghost-not-in-the-shell merged commit 9f3e4c0 into berkeley Aug 28, 2023
49 checks passed
@ghost-not-in-the-shell ghost-not-in-the-shell deleted the feature/include-network-id-for-account-update-hash-berk branch August 28, 2023 17:11
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.

None yet

4 participants