Repository navigation
fix(statesync): statesync stops the node when light block request fails - #514
Merged
Merged
Conversation
lklimek
force-pushed
the
retry-statesync
branch
from
November 28, 2022 15:40
76f2881 to
d33bead
Compare
This reverts commit 1a1c98cb9d95a39847e5825e00db56f1725c2484.
lklimek
force-pushed
the
retry-statesync
branch
from
November 29, 2022 10:57
d33bead to
b5f9444
Compare
lklimek
force-pushed
the
retry-statesync
branch
from
November 30, 2022 14:01
5607a2d to
6508668
Compare
lklimek
marked this pull request as ready for review
November 30, 2022 14:47
shotonoff
approved these changes
Dec 1, 2022
shotonoff
left a comment
Collaborator
There was a problem hiding this comment.
LGTM
left a couple of suggestions
| if sp, ok := stateProvider.(*stateProviderP2P); ok { | ||
| // we do this in a separate routine to not block whilst waiting for the light client to finish | ||
| // whatever call it's currently executing | ||
| go sp.addProvider(newProvider) |
Collaborator
There was a problem hiding this comment.
is it safe to call addProvider concurrently?
Collaborator
Author
There was a problem hiding this comment.
It is, as sp.lc (which is pointer to light client) never changes.
Logic inside sp.lc has its own mtx locked properly.
| break | ||
| } | ||
| r.logger.Error("failed to init state provider, retrying", "retry", retry, "error", err) | ||
| time.Sleep(time.Second) |
Collaborator
There was a problem hiding this comment.
is this a sleep call correct here?
Collaborator
Author
There was a problem hiding this comment.
Maybe a bit redundant, but I added it here to just delay another retry a bit, so that networking has time to stabilize before next attempt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
When node starts, it executes state sync. If the state sync fails, node terminates.
This breaks end-to-end tests.
In some scenarios, state sync might not receive responses to light block request.
This happens in e2e tests, when connection between nodes is not fully established,
for example when handshake is not finalized correctly (see this comment).
What was done?
How Has This Been Tested?
Running end-to-end tests.
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only