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(sync): Make the syncer ignore some new block verification errors #5537

Merged
merged 4 commits into from
Nov 4, 2022

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Nov 2, 2022

Motivation

The syncer skips some duplicate block errors, but we added new duplicate block errors in #4937.

This might fix the full sync errors on the main branch.

Solution

  • Ignore "block has already been sent to be committed to the state" errors
  • Make a finalized state error into "block has already been committed to the state"

Review

I talked through this with @arya2 already.

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?
  • How do you know it works? Does it have tests?

Follow Up Work

We should fix these permanently using typed errors, so we don't introduce this sort of bug again:

@teor2345 teor2345 added C-bug Category: This is a bug A-rust Area: Updates to Rust code P-Medium ⚡ I-slow Problems with performance or responsiveness I-integration-fail Continuous integration fails, including build and test failures A-state Area: State / database changes labels Nov 2, 2022
@teor2345 teor2345 requested a review from arya2 November 2, 2022 23:31
@teor2345 teor2345 requested review from a team as code owners November 2, 2022 23:31
@teor2345 teor2345 self-assigned this Nov 2, 2022
arya2
arya2 previously approved these changes Nov 2, 2022
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 good!

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #5537 (6574cd5) into main (34313b8) will increase coverage by 0.02%.
The diff coverage is 16.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5537      +/-   ##
==========================================
+ Coverage   78.76%   78.79%   +0.02%     
==========================================
  Files         305      305              
  Lines       38114    38118       +4     
==========================================
+ Hits        30022    30035      +13     
+ Misses       8092     8083       -9     

mergify bot added a commit that referenced this pull request Nov 3, 2022
@arya2
Copy link
Contributor

arya2 commented Nov 3, 2022

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Nov 3, 2022

refresh

✅ Pull request refreshed

@arya2
Copy link
Contributor

arya2 commented Nov 3, 2022

A couple failures in the merge queue, the clippy lint:

error: the Err-variant returned from this function is very large
--> zebrad/src/components/sync.rs:1027:10
|
1027 | ) -> Result<(), BlockDownloadVerifyError> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the Err-variant is at least 144 bytes

https://github.com/ZcashFoundation/zebra/actions/runs/3387578258/jobs/5628508335#step:8:501

and compiling in ubuntu-latest:

2022-11-03T18:02:59.1665948Z Couldn't compile the test.test src/components/mempool/crawler.rs - components::mempool::crawler (line 16) ... FAILED
2022-11-03T18:02:59.1670828Z
2022-11-03T18:02:59.1671033Z failures:
2022-11-03T18:02:59.1671272Z
2022-11-03T18:02:59.1675686Z failures:
2022-11-03T18:02:59.1686048Z src/components/mempool/crawler.rs - components::mempool::crawler (line 16)

These are failing on the main branch too

mergify bot added a commit that referenced this pull request Nov 3, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Nov 3, 2022

These are failing on the main branch too

Looks like Rust 1.65:
https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#generic-associated-types-gats

I can open PRs to fix them now.

If it's not caused by this specific PR, can you please open a ticket, or ask the person on main branch failures to open one?
That's @oxarbitrage this week.

@arya2
Copy link
Contributor

arya2 commented Nov 3, 2022

Looks like Rust 1.65: https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#generic-associated-types-gats

Sounds about right. I created #5547.

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 3, 2022

Looks like Rust 1.65: https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#generic-associated-types-gats

Sounds about right. I created #5547.

I try to catch these things by running nightly rust, but sometimes they slip through, or I ignore them, or they are merged right before the release.

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 4, 2022

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2022

update

✅ Branch has been successfully updated

mergify bot added a commit that referenced this pull request Nov 4, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Nov 4, 2022

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2022

refresh

✅ Pull request refreshed

mergify bot added a commit that referenced this pull request Nov 4, 2022
@mergify mergify bot merged commit 4a8349f into main Nov 4, 2022
@mergify mergify bot deleted the fix-sync-errors branch November 4, 2022 06:57
teor2345 added a commit that referenced this pull request Feb 6, 2023
…5537)

* Fix error text for state service for syncer

* Fix error handling in syncer

* cargo fmt --all

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.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 I-integration-fail Continuous integration fails, including build and test failures I-slow Problems with performance or responsiveness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants