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

Do not use the sync target to download the headers #7914

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

pinges
Copy link
Contributor

@pinges pinges commented Nov 25, 2024

PR description

The download headers step should be able to use any peer to download the headers

@fab-10
Copy link
Contributor

fab-10 commented Nov 26, 2024

Seems straight forward, have you evidence that this is improving the sync?
I mean could it be that other peers do not have the headers and so this could have side effects?

@pinges pinges enabled auto-merge (squash) November 27, 2024 05:17
@@ -99,7 +99,6 @@ private CompletableFuture<List<BlockHeader>> downloadHeaders(final SyncTargetRan
range.getStart().getNumber(),
headerRequestSize,
metricsSystem)
.assignPeer(range.getSyncTarget())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For POS this is safe as the range start block number is used as the minimum required block. For non-pos chains not sure whether this is safe think might be an issue.

If you only skipped this when it's POS then I think it would be better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking through this more, it's already possible that other nodes might not have this header and we will fail to download the block. So I think this change is fine.

@pinges pinges merged commit e8a282f into hyperledger:main Nov 27, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants