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

server: Respond to getheaders when same chain tip. #2587

Merged
merged 1 commit into from Feb 13, 2021

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 3, 2021

The handler for getheaders currently ignores the request when the chain is not yet believed to be current. This is generally desirable and correct behavior, since it might otherwise lead peers to incorrect conclusions about the state of the peer.

However, on private networks, such as simnet, it is not at all uncommon for every node in the network to no longer be current if a block hasn't been mined in a long time or when all nodes are stopped and restarted.

In order to better handle these types of edge conditions, this modifies the server to respond to getheaders when the local chain tip is exactly the same as the requested locator even when it is not marked current yet.

This results in more robust handling for private networks while still providing the normal desirable behavior prior to being current.

@davecgh davecgh added this to the 1.7.0 milestone Feb 3, 2021
@davecgh davecgh force-pushed the server_getheaders_response_same_tip branch from 4ce16df to a8fb147 Compare February 3, 2021 19:35
The handler for getheaders currently ignores the request when the chain
is not yet believed to be current.  This is generally desirable and
correct behavior, since it might otherwise lead peers to incorrect
conclusions about the state of the peer.

However, on private networks, such as simnet, it is not at all uncommon
for every node in the network to no longer be current if a block hasn't
been mined in a long time or when all nodes are stopped and restarted.

In order to better handle these types of edge conditions, this modifies
the server to respond to getheaders when the local chain tip is exactly
the same as the requested locator even when it is not marked current
yet.

This results in more robust handling for private networks while still
providing the normal desirable behavior prior to being current.
@davecgh davecgh force-pushed the server_getheaders_response_same_tip branch from a8fb147 to 14adb6c Compare February 13, 2021 07:24
@davecgh davecgh merged commit 14adb6c into decred:master Feb 13, 2021
@davecgh davecgh deleted the server_getheaders_response_same_tip branch February 13, 2021 07:28
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.

None yet

3 participants