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(test): Don't include shielded data in genesis blocks #7302

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

upbqdn
Copy link
Member

@upbqdn upbqdn commented Aug 7, 2023

Motivation

Our proptests were generating genesis blocks containing transactions with joinsplits and shielded data. PR #7266 asserts that the note commitment trees associated with the genesis block are equal to the empty trees. These assertions were failing in that PR because the note commitment trees for genesis blocks weren't empty.

Solution

  • Do not include joinsplits nor shielded data in V4 transactions in the test genesis block.
  • Do not include shielded data in V5 transactions in the test genesis block.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

@upbqdn upbqdn added C-bug Category: This is a bug A-rust Area: Updates to Rust code C-testing Category: These are tests A-state Area: State / database changes labels Aug 7, 2023
@upbqdn upbqdn requested a review from a team as a code owner August 7, 2023 19:55
@upbqdn upbqdn requested review from dconnolly and removed request for a team August 7, 2023 19:55
@upbqdn upbqdn changed the title Don't include shielded data in V4 tx in genesis Don't include shielded data in V4 tx in genesis blocks Aug 7, 2023
@upbqdn upbqdn changed the title Don't include shielded data in V4 tx in genesis blocks fix(test): Don't include shielded data in genesis blocks Aug 7, 2023
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Aug 7, 2023
@upbqdn upbqdn removed the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Aug 7, 2023
@upbqdn upbqdn self-assigned this Aug 7, 2023
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Aug 8, 2023
@upbqdn upbqdn removed the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Aug 8, 2023
@upbqdn upbqdn requested a review from arya2 August 8, 2023 17:05
Copy link
Contributor

@arya2 arya2 left a comment

Choose a reason for hiding this comment

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

This looks great! Let's merge this into dedup-tree-insertion-fin-state to fix those tests.

The disk format upgrade panicked here and possibly elsewhere:

can't upgrade a database that has already been upgraded, or is newer

https://github.com/ZcashFoundation/zebra/actions/runs/5798021847/job/15717359090?pr=7302#step:8:215

@upbqdn
Copy link
Member Author

upbqdn commented Aug 8, 2023

Thanks for looking at the tests. I forgot to mention that the bug that this PR addresses is gone—an example of the bug in #7266: https://github.com/ZcashFoundation/zebra/actions/runs/5798018815/job/15717022677.

This PR fails because of an unrelated bug that I'll fix in another PR.

@upbqdn upbqdn merged commit 8ec4631 into dedup-tree-insertion-fin-state Aug 8, 2023
274 of 285 checks passed
@upbqdn upbqdn deleted the fix-genesis-shielded-data branch August 8, 2023 17:24
mergify bot pushed a commit that referenced this pull request Aug 9, 2023
… trees into finalized state (#7266)

* Pass ZebraDB to batch preparation

* Dedup the insertion of Sapling trees into database

* Dedup the insertion of Orchard trees into database

* Update snapshots

* Rename batch preparation of trees

* Simplify the naming of note commitment trees

* Correctly retrieve Sapling trees from fin state

* Correctly retrieve Orchard trees from fin state

* Simplify the naming of methods for Sprout trees

* Simplify the naming of methods for Sapling trees

* Simplify the naming of methods for Orchard trees

* Reduce disk reads by caching trees. (#7276)

* Bump the state minor version

* Reset the state patch version

* Simplify the preparation of genesis trees

* Store the roots of the trees of the genesis block

* Add the genesis roots to snapshots

* fix(test): Don't include shielded data in genesis blocks (#7302)

* fix(state): Fix marking format upgrades (#7304)

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code A-state Area: State / database changes C-bug Category: This is a bug C-testing Category: These are tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants