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: Reject outbound conns to non-full nodes. #1252

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Jun 3, 2018

This requires PR #1251.

This modifies the server connection code to reject outbound peers that do not offer full node services.

@davecgh davecgh force-pushed the server_reject_outbound_peers_without_desired_services branch from 878874d to 017c2b2 Compare June 3, 2018 06:56
@davecgh davecgh force-pushed the server_reject_outbound_peers_without_desired_services branch from 017c2b2 to dbc42cd Compare June 3, 2018 08:02
@davecgh davecgh added this to the 1.3.0 milestone Jun 4, 2018
@davecgh davecgh force-pushed the server_reject_outbound_peers_without_desired_services branch from dbc42cd to fe73bee Compare June 4, 2018 21:18
server.go Outdated
wantServices := wire.SFNodeNetwork
if !sp.Inbound() && !hasServices(msg.Services, wantServices) {
srvrLog.Debugf("Rejecting peer %s with services %v due to not "+
"providing desired services %v", msg.Services, wantServices)
Copy link
Member

Choose a reason for hiding this comment

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

We could improve this by masking everything off except the missing services: wantServices&^msg.Services

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't really matter for dcrd's case as it only needs a single service flag, so it would be the same result either way, but that could change in the future.

Copy link
Member Author

@davecgh davecgh Jun 4, 2018

Choose a reason for hiding this comment

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

I agree that it currently is the same, but I think it's a good idea, because I would expect there to be pruned nodes in the future with a new service bit, in which case it would matter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

@davecgh davecgh force-pushed the server_reject_outbound_peers_without_desired_services branch from fe73bee to 7f2e71b Compare June 4, 2018 22:55
This modifies the server connection code to reject outbound peers that
do not offer full node services.
@davecgh davecgh force-pushed the server_reject_outbound_peers_without_desired_services branch from 7f2e71b to 166c71e Compare June 4, 2018 22:56
@davecgh davecgh merged commit 166c71e into decred:master Jun 4, 2018
@davecgh davecgh deleted the server_reject_outbound_peers_without_desired_services branch June 4, 2018 23:17
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