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(state): Remove workarounds for storing trees #7218

Merged
merged 8 commits into from
Jul 18, 2023
Merged

Conversation

upbqdn
Copy link
Member

@upbqdn upbqdn commented Jul 15, 2023

Motivation

We were using some workarounds for committing trees into the non-finalized state. Namely, we turned off asserting that we don't commit more than a single tree at a particular height in tests. It would be great to have this resolved before we do the tree deduplication.

Solution

This PR removes the workarounds and fixes tests so they don't push more than a single block at a particular height.

Review

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 added 4 commits July 15, 2023 23:03
There are the same two asserts above the two removed ones.
We were using the height of the last block instead of the initial block
to construct a new chain.
@upbqdn upbqdn added C-bug Category: This is a bug A-rust Area: Updates to Rust code P-Medium ⚡ C-testing Category: These are tests labels Jul 15, 2023
@upbqdn upbqdn requested a review from teor2345 July 15, 2023 21:56
@upbqdn upbqdn requested a review from a team as a code owner July 15, 2023 21:56
@upbqdn upbqdn self-assigned this Jul 15, 2023
@github-actions github-actions bot added C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG extra-reviews This PR needs at least 2 reviews to merge labels Jul 15, 2023
@upbqdn upbqdn force-pushed the fix-height-in-tests branch from 2e64c22 to 0fd231c Compare July 15, 2023 21:57
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks for these fixes!

I just committed one typo fix.

@upbqdn upbqdn removed the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Jul 16, 2023
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Hmm, looks like 3 proptests failed for 3 different reasons?

---- service::non_finalized_state::tests::prop::forked_equals_pushed_genesis stdout ----
The application panicked (crashed).
Message: hash is present
Location: zebra-state/src/service/non_finalized_state/tests/prop.rs:206

https://github.com/ZcashFoundation/zebra/actions/runs/5570108032/jobs/10174308429?pr=7218#step:4:4059

We didn't get a proptest seed out of these tests, so we might need to run a few tests to make sure we've fixed this completely.

@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Jul 17, 2023
@upbqdn
Copy link
Member Author

upbqdn commented Jul 17, 2023

It looks like it's two proptests, but the log contains three entries because one of the tests panicked in an expect, which got reported, and that made the test fail, which got reported again.

I ran both protests five times locally, and none of them failed once. :/ I think I found the issue for both failures, though. I pushed a fix.

@teor2345
Copy link
Contributor

I ran both protests five times locally, and none of them failed once. :/ I think I found the issue for both failures, though. I pushed a fix.

I usually run all the related proptests in a loop for a few thousand iterations, overnight or while I'm doing other work.

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Let's try it and see

@teor2345 teor2345 removed the extra-reviews This PR needs at least 2 reviews to merge label Jul 17, 2023
@teor2345
Copy link
Contributor

teor2345 commented Jul 17, 2023

This was automatically marked with extra-reviews because it contains the word "remove", but it doesn't actually remove any user-visible features.

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 C-bug Category: This is a bug C-testing Category: These are tests C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants