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

Respond with an empty headers list if in IBD state #1258

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Conversation

azarovh
Copy link
Member

@azarovh azarovh commented Oct 4, 2023

Closes bullets 5 and 6 in #1199

v1 logic: ignore headers list request. If the node that requested headers receives blocks request in assumes that the peer is in Initial Block Download state and won't disconnect it as stalled.

new v2 logic: if in IBD respond with an empty list. It's simple and effective. Empty headers list is legal and no assumptions are made. Bitcoin does the same. Todos suggested some advanced logic with exchanging best block on handshake or some permission system. Idk it looks too complicated. Empty list does the job + serves as a pong.

P.S. also in v2 I moved call to the wait_for_clock_diff to allow more checks to pass before waiting.

@azarovh azarovh added the p2p p2p related issues label Oct 4, 2023
@azarovh azarovh changed the title Respond with an empty headers list if in IDB state Respond with an empty headers list if in IBD state Oct 4, 2023
@azarovh azarovh merged commit e135879 into master Oct 9, 2023
23 checks passed
@azarovh azarovh deleted the fix/issue_1199_5 branch October 9, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2p p2p related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants