-
Notifications
You must be signed in to change notification settings - Fork 837
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
Backward sync exception improvements #4092
Conversation
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
5cf3f34
to
caf08a1
Compare
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 to me
@@ -165,7 +165,13 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) | |||
new Block(newBlockHeader, new BlockBody(transactions, Collections.emptyList())); | |||
|
|||
if (mergeContext.isSyncing() || parentHeader.isEmpty()) { | |||
mergeCoordinator.appendNewPayloadToSync(block); | |||
mergeCoordinator |
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.
Should this be part of this PR? Is this related to BWSync?
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.
The idea is to log also the not recoverable backward sync exceptions, and to do that closest possible to where the sync was invoked, and possibly do other actions in case of these exceptions.
So it related to backward sync since the exception is triggered there, but no problem for me to move it to a separate PR if you think it does not belong here.
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
6f90f53
to
cda207c
Compare
* Remove backward sync exception recursive nesting Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Remove backward sync exception recursive nesting Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Signed-off-by: Cody Born <codyborn@outlook.com>
* Remove backward sync exception recursive nesting Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio fabio.difabio@consensys.net
PR description
During the investigation of a Hive test that triggers backward sync, found some improvements that could be applied to backward sync exceptions.
Remove of recoursive exceptions nesting, that produces monster exception like this one
deeply-nested-exception.txt
Avoid to return
null
fromsyncBackwardsUntil
methods in case the block is already trustedLog a warning for backward sync exception that are not recoverable, likewise it is already done for recoverable exceptions
Rephrase the error messages when there is a validator error found during the backward sync, with the assumption that the child block is the invalid one, and the parent is correct, this makes clearer the error message for the Hive test
Fixed Issue(s)
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog