-
Notifications
You must be signed in to change notification settings - Fork 127
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
Fluffy: Portal subnetwork peer ban list #3007
base: master
Are you sure you want to change the base?
Conversation
p: PortalProtocol, id: NodeId, k: int = BUCKET_SIZE, seenOnly = false | ||
): seq[Node] = | ||
# TODO: Maybe banned peers should be in the routing table and filtered out at that level | ||
p.routingTable.neighbours(id, k, seenOnly).filterIt(not p.isBanned(it.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kdeme Any thoughts on whether it would be a good idea to add the ban list into the routing table code in nim-eth? I believe the same routing table is used by the discv5 code and so it might be a good way to apply something similar at the discv5 level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can be either in the routing table object or in PortalProtocol and DiscoveryProtocol. The latter would require a few more wrappers like you did now for neighbours
.
What is more important I think is that banned nodes do not stay in the routing table. They should be removed from the routing table and not be allowed to re-added. That way the routing table gives space to valid nodes and a neighbours
call gives better results.
I think achieving this might be slightly simpler when the ban list is part of routing table, not sure.
But yes, the ban list would also be useful for discv5 I think.
@@ -109,6 +109,7 @@ proc getContent( | |||
continue | |||
|
|||
validateRetrieval(key, contentValue).isOkOr: | |||
n.portalProtocol.contentLookupFailedValidation(lookupRes.receivedFrom.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when code reading it is clearer what this does when it would just be p.banPeer(nodeId, PeerBanDurationContentLookupFailedValidation)
. I feel the templates (or their names) mask to much which action is done here.
# Ban durations for the banned peers table | ||
PeerBanDurationContentLookupFailedValidation = 30.minutes | ||
PeerBanDurationOfferFailedValidation = 60.minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could probably be the same duration always? Similar type of protocol violation?
This PR relates to #2809 and implements a per subnetwork peer ban list in the PortalProtocol type.
Changes completed:
Remaining work: