-
Notifications
You must be signed in to change notification settings - Fork 117
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
Ignore AlreadyInChain error in the syncer #2890
Conversation
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.
Looks good - and thanks for using explicit error types.
I have some suggestions to improve the reliability of this fix.
(And a suggestion to improve diagnostics.)
I've also added the new missing_docs
to ticket #453.
I've had a single instance of this error
This will be a bit tricky to filter since I'd need to enumerate the |
I suggest you convert the |
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 is useful for everyone so it would be good to merge it soon, so I created tickets for the remaining issues (as suggested)
I suggest you convert the
BoxError
to a string and use string matching. (And open a ticket for a proper fix that converts all the commit errors to enum variants.)
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 is better than the previous code, and we have tickets to follow up the remaining issues.
Thanks for diagnosing and fixing this!
Motivation
Everytime there is an error from the block downloader and verifier, the sync is restarted. There is an exception for already verified blocks, but a "already in chain" error can also occur that should not cause a restart. This makes sync slower.
Specifications
Designs
Solution
I've attempted improve the code by checking the error type instead of the error string. However there's a bit of risk involved, see comment in code.
Closes #2883
Review
Anyone can review.
To see if it works, you can start a not-fully-synced node with trace level for
zebrad
and search the logs. It should not contain something like this:If the log contains
block is already in chain
then this positively confirm this works. However I couldn't make it happen again (it seems easier if the state it's a bit more out of sync). I'm currently waiting some hours to start the node and check again.Reviewer Checklist
Follow Up Work