-
Notifications
You must be signed in to change notification settings - Fork 622
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
[Epoch Sync] Fix GC error spam and invalid height problem #12288
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12288 +/- ##
==========================================
- Coverage 71.60% 71.60% -0.01%
==========================================
Files 836 836
Lines 167856 167861 +5
Branches 167856 167861 +5
==========================================
- Hits 120195 120193 -2
- Misses 42408 42417 +9
+ Partials 5253 5251 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -754,7 +754,9 @@ impl Chain { | |||
// the block might not have been what the block producer originally produced. Either way, it's | |||
// OK if we miss some cases here because this is just an optimization to avoid reprocessing | |||
// known invalid blocks so the network recovers faster in case of any issues. | |||
if error.is_bad_data() && !matches!(error, Error::InvalidSignature) { | |||
if error.is_bad_data() | |||
&& !matches!(error, Error::InvalidSignature | Error::InvalidBlockHeight(_)) |
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.
Minor point but just checking, in our sequence of checks that we do for block, how far down the list do we have InvalidBlockHeight
? Because if it's quite up in the stack of validation checks, this can be a source of spam as we don't mark such blocks as invalid.
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.
It's pretty early. However, the is_bad_data() check here is not for the purpose of preventing spam. It's for the purpose of dealing with a class of bugs where we the network gets stuck and the recovery is slowed down by repeatedly processing invalid blocks. Invalid height is not quite relevant here because these invalid blocks are talking about recent blocks. But honestly, I can't say that I still have enough context to reason about this. It's possible that this isn't even relevant anymore due to stateless validation. Either way, logically it is incorrect to mark a block as invalid just because its height is too high due to where the receiving node currently is, so we should stop doing that anyway.
Closes #11930
Closes #11936