-
Notifications
You must be signed in to change notification settings - Fork 120
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): Avoid temporary failures verifying the first non-finalized block or attempting to fork the chain before the final checkpoint #6810
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6810 +/- ##
==========================================
+ Coverage 77.53% 78.14% +0.60%
==========================================
Files 310 308 -2
Lines 41933 41055 -878
==========================================
- Hits 32513 32081 -432
+ Misses 9420 8974 -446 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"non-finalized" and "finalized" are outdated terms that we're trying to move away from, because they were very confusing during the audit. When we're talking about the verification status of blocks, we use "semantically verified", "checkpoint verified" or "contextually verified".
But it's ok to say "finalized queue" when talking about block storage, or which state blocks are queued for.
There's a list of name changes in ticket #6793 which might be helpful.
Edit: name changes have finished
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just marking this as needing changes.
I updated my review because the name changes in ticket #6793 have merged. (There's no need to work on this PR any time soon, please check with Pili first.) |
… of non-finalized tip when dropping the finalized block write sender
This PR has been simplified and rewritten
@Mergifyio update |
✅ Branch has been successfully updated |
@Mergifyio update |
✅ Branch has been successfully updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good, is short, clear and it seems to work.
What i am not totally sure is if it closes all the stuff that are inside the related tickets.
I will like @teor2345 to make the final review as they have more context in the tickets this is closing. I think the next few days could be a good time to merge this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix!
What i am not totally sure is if it closes all the stuff that are inside the related tickets.
That's a good question.
#5125 is partially resolved, I opened #7352 with the remaining work. (Which I don't think we should fix unless it actually happens.)
I checked the logs and #5709 is not resolved, it seems to be just as frequent as before this fix. (The warnings are still there, and syncing takes about the same amount of time.)
Motivation
This PR updates the
can_fork_chain_at()
method in zebra-state to ignore blocks below the finalized tip and fixes a bug where the first block past the final checkpoint will fail verification if it arrives in zebra-state before the final checkpoint block is written to disk.Close #6388
Close #5125
Part of #5709
Solution
can_fork_chain_at_hashes
flag toSentHashes
can_fork_chain_at(hash)
method toSentHashes
that checks the new flagblock_write_sent_hashes
with an emptySentHashes
and markcan_fork_chain_at_hashes
as trueRelated:
shrink_to_fit()
calls inprune_by_height()
Review
This is low-priority.
Reviewer Checklist