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

netsync: don't ask for blocks from peers on the same block height #2304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kcalvinalvin
Copy link
Collaborator

When we're all caught up and we have a new peer, we'll ask for blocks from peers that we're on the same height. Since these peers don't have any blocks to send us, they don't reply and we disconnect from them as they timeout.

To prevent this, we don't ask for blocks if the chain thinks we're current and do not have a peer that reports having a higher block.

@coveralls
Copy link

coveralls commented Jan 16, 2025

Pull Request Test Coverage Report for Build 12803849581

Details

  • 0 of 4 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 57.269%

Changes Missing Coverage Covered Lines Changed/Added Lines %
netsync/manager.go 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
mempool/mempool.go 1 66.67%
Totals Coverage Status
Change from base Build 12775873016: 0.01%
Covered Lines: 29950
Relevant Lines: 52297

💛 - Coveralls

When we're all caught up and we have a new peer, we'll ask for blocks
from peers that we're on the same height. Since these peers don't have
any blocks to send us, they don't reply and we disconnect from them as
they timeout.

To prevent this, we don't ask for blocks if the chain thinks we're
current and do not have a peer that reports having a higher block.
@kcalvinalvin kcalvinalvin force-pushed the 2025-01-16-dont-ask-for-blocks-from-same-height-peers branch from fb9121d to aace7a9 Compare January 16, 2025 07:09
@yyforyongyu yyforyongyu self-requested a review January 16, 2025 15:29
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.

2 participants