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

Fix duplicated rows in zkapp_account_precondition table #14785

Merged

Conversation

dkijania
Copy link
Member

@dkijania dkijania commented Jan 4, 2024

Added shell script which generated two sql scripts for patching database:

  • zkapp_precondition_script.sql - Removes duplicated rows in zkapp_account_precondition
  • zkapp_update_body_script.sql - Updates zkapp_account_update_body table which has foreign key to zkapp_account_precondition table

Moreover i've updated zkapp_tables.sql script and added unique constraint so that whenever we bypass Ocaml code and manipulate data directly db constraint will complain

Lastly added update script which adds constraint if we want to patch existing database.

In order to fix current schemas in ITN we need to follow below steps:

  • run zkapp_duplicated_precondition/remove_duplicated_zkapp_account_precondition_rows.sh {schema}
  • run produced scripts in correct order: zkapp_precondition_script.sql, zkapp_update_body_script.sql
  • update constraint for zkapp_account_precondition table: add_constraint.sql

Closes #14777

@dkijania dkijania self-assigned this Jan 4, 2024
@dkijania dkijania added priority-high itn3 https://docs.google.com/document/d/1ualsFs9NbgavFZj1Z4CYHf4PdRGblyz1wOl9BawT1iU Testworld-2-0-archive-node Should be used to raise archive node issues with Testworld 2.0 network labels Jan 4, 2024
@dkijania
Copy link
Member Author

dkijania commented Jan 4, 2024

!ci-build-me

@dkijania dkijania marked this pull request as ready for review January 4, 2024 15:06
@dkijania dkijania requested review from a team as code owners January 4, 2024 15:06
This reverts commit 4883c25838c8650d74fb51e97baad2c663a60390.
@dkijania
Copy link
Member Author

dkijania commented Jan 4, 2024

!ci-build-me

Copy link
Member

@ejMina226 ejMina226 left a comment

Choose a reason for hiding this comment

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

I'm not an expert on this code, but I see the priority is high.

Copy link
Member

@shimkiv shimkiv left a comment

Choose a reason for hiding this comment

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

LGTM, small improvements suggested.

Co-authored-by: Serhii Shymkiv <sergey@shimkiv.com>
@dkijania
Copy link
Member Author

dkijania commented Jan 4, 2024

!ci-build-me

@deepthiskumar
Copy link
Member

!ci-build-me

@deepthiskumar
Copy link
Member

!approved-for-mainnet

@dkijania
Copy link
Member Author

dkijania commented Jan 6, 2024

!ci-build-me

@dkijania dkijania merged commit a51f09d into rampup Jan 7, 2024
26 checks passed
@dkijania dkijania deleted the dkijania/fix_duplicated_zkapp_account_precondition_table branch January 7, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itn3 https://docs.google.com/document/d/1ualsFs9NbgavFZj1Z4CYHf4PdRGblyz1wOl9BawT1iU priority-high Testworld-2-0-archive-node Should be used to raise archive node issues with Testworld 2.0 network
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants