Skip to content
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

Merged
merged 5 commits into from
Jul 13, 2022

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented Jul 13, 2022

Signed-off-by: Fabio Di Fabio [email protected]

PR description

During the investigation of a Hive test that triggers backward sync, found some improvements that could be applied to backward sync exceptions.

  1. Remove of recoursive exceptions nesting, that produces monster exception like this one
    deeply-nested-exception.txt

  2. Avoid to return null from syncBackwardsUntil methods in case the block is already trusted

  3. Log a warning for backward sync exception that are not recoverable, likewise it is already done for recoverable exceptions

  4. 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

  • I thought about documentation and added the doc-change-required label to this PR if
    updates are required.

Changelog

@fab-10 fab-10 marked this pull request as ready for review July 13, 2022 09:10
Signed-off-by: Fabio Di Fabio <[email protected]>
Copy link
Contributor

@gezero gezero left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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 <[email protected]>
@macfarla macfarla merged commit a1af83b into hyperledger:main Jul 13, 2022
codyborn pushed a commit to codyborn/besu that referenced this pull request Jul 31, 2022
* Remove backward sync exception recursive nesting

Signed-off-by: Fabio Di Fabio <[email protected]>
codyborn pushed a commit to codyborn/besu that referenced this pull request Jul 31, 2022
* Remove backward sync exception recursive nesting

Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Cody Born <[email protected]>
@fab-10 fab-10 deleted the backwardsync-exceptions branch November 8, 2022 13:29
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* Remove backward sync exception recursive nesting

Signed-off-by: Fabio Di Fabio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants