-
Notifications
You must be signed in to change notification settings - Fork 695
Update ValidateRejectCode from InvalidBlock to UnknownParent where appropriate and add additional reject codes #6027
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
Update ValidateRejectCode from InvalidBlock to UnknownParent where appropriate and add additional reject codes #6027
Conversation
Signed-off-by: Jacinta Ferrant <[email protected]>
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.
This is good. Wish I had thought of this case when I originally made this change
I don't think we actually need to. I misread the code. Because you set prior_evaluation to None when it thinks it should_reevaluate_block, it won't hit the codepath that early exits. So its all good! You had it right, just missed this one spot! (EDIT: which also makes sense why your test worked. It was testing a same block being reproposed but it just didn't check for the specific InvalidParentBlock case) |
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.
Actually, I think this still does not catch the case we're seeing. The block validation endpoint is responding with InvalidBlock
in this case. I think it would require some changes in that endpoint to differentiate the different errors better.
Great catch. This makes me think actually that maybe InvalidParentBlock should NOT be reevaluated. This happens when a miner is attempting to reorg actually. Not sure that should ever be reconsidered. definitely conflated this error code with the validateReject reason code which is different XD |
…ure to find a parent block id as an UnknownParent error code Signed-off-by: Jacinta Ferrant <[email protected]>
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 the update. Yes, I think this looks good, but the minor challenge here is that this requires signers to update their nodes at the same time as updating their signers. Updating the node and not the signer will result in deserialization errors.
… into fix/reconsider-invalid-parent-block-proposals
Signed-off-by: Jacinta Ferrant <[email protected]>
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.
👍
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6027 +/- ##
===========================================
+ Coverage 79.64% 83.79% +4.15%
===========================================
Files 528 528
Lines 385780 386301 +521
Branches 323 323
===========================================
+ Hits 307247 323702 +16455
+ Misses 78525 62591 -15934
Partials 8 8
... and 195 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
No description provided.