-
Notifications
You must be signed in to change notification settings - Fork 863
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
Fix "Backward sync stuck in a loop" #6749 #6756
Conversation
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
final CompletableFuture<Void> secondFuture = | ||
context.syncBackwardsUntil(getBlockByNumber(REMOTE_HEIGHT - 1).getHash()); | ||
respondUntilFutureIsDone(secondFuture); | ||
secondFuture.get(); |
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.
is there any useful assertion to make at this point? or just that it didn't error out
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 still in dev, will tidy up this test now I know it works for the impl
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.
Done
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
gradle.properties
Outdated
@@ -14,3 +14,4 @@ org.gradle.jvmargs=-Xmx4g \ | |||
--add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | |||
# Could be moved to sonar properties after https://sonarsource.atlassian.net/browse/SONARGRADL-134 | |||
systemProp.sonar.gradle.skipCompile=true | |||
version=24.3.1-SNAPSHOT |
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.
we removed version from gradle.properties intentionally. Is this an errant add?
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.
I had to add it to be able to use the Jenkins build from source. Sally found that problem in the scripts and I think it should get fixed soon. Once that is done I can get rid of it.
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.
removed
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 doesn't look removed... ?
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.
Good 'light touch' approach. good to merge once those two minor issues are resolved
// context.getEthContext().getEthPeers().peerCount() > | ||
// (context.getEthContext().getEthPeers().getMaxPeers() / 2) |
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 probably is wise to at least assert we have peers before we drop hashes, but making a qualitative judgement about the peers, when all we have to go by is a hash, is not straightforward.
IMO dropping the hash is straightforward and not catastrophic, since we will get a subsequent fcU. As long as we do not give up either:
- too easily
- in the absence of peers
I think a simple peer count check with a task retry backoff will suffice 👍
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.
We do know that we have at least one peer, otherwise we would not get the max retries exception.
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.
Even if we do remove a hash from the list that is on the chain, the BWS still works.
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@@ -83,7 +83,7 @@ public class BackwardSyncContextTest { | |||
public static final int REMOTE_HEIGHT = 50; | |||
public static final int UNCLE_HEIGHT = 25 - 3; | |||
|
|||
public static final int NUM_OF_RETRIES = 100; | |||
public static final int NUM_OF_RETRIES = 1; |
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.
only one retry ? in case of bad peers it will not be a problem? not sure how backwardsync is working so just asking
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 test code, prod code has 2 retries (which is actually just one retry: two "tries")
…s from source with Jenkins Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
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.
LGTM, non-blocking feedback
gradle.properties
Outdated
@@ -14,3 +14,4 @@ org.gradle.jvmargs=-Xmx4g \ | |||
--add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | |||
# Could be moved to sonar properties after https://sonarsource.atlassian.net/browse/SONARGRADL-134 | |||
systemProp.sonar.gradle.skipCompile=true | |||
version=24.3.1-SNAPSHOT |
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 doesn't look removed... ?
@@ -438,4 +441,53 @@ public void shouldFailAfterMaxNumberOfRetries() { | |||
} | |||
} | |||
} | |||
|
|||
@SuppressWarnings("BannedMethod") |
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.
what is the banned method? a comment might help here and on the other suppresswarnings statement
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.
Had to add the version back in so I can use the Jankins build from source. Will fix it :-)
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
* minimal change to fix BWS Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: Simon Dudley <simon.dudley@consensys.net> Signed-off-by: Justin Florentine <justin+github@florentine.us>
* minimal change to fix BWS Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: Simon Dudley <simon.dudley@consensys.net> Signed-off-by: amsmota <antonio.mota@citi.com>
* minimal change to fix BWS Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: Simon Dudley <simon.dudley@consensys.net> Signed-off-by: amsmota <antonio.mota@citi.com>
* minimal change to fix BWS Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
PR description
This PR is fixing issue #6749, trying to make minimal changes to the existing implementation.