-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implements Reachable Smart Tag #22
Conversation
@petar, I will do a final review after lunch, but I think this is also ready for review. Thanks! |
ir/base/reachable.go
Outdated
// CheckIfReachable Checks if peer reachable with 5s timeout. | ||
// NOTE: We currently consider a peer reachable if we can dial them. | ||
// We could change the concept of reachable and say that someone is | ||
// reachable if we are currently connected to it (host.Network().Peers()) |
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.
@aschmahmann What is the current DHT approach? I imagine it is to check whether we are connected to them?
@adlrocha We should probably have two tags named "connected" and "dialable". This implementation currently corresponds to dialable. Note that you could implement both "connected" and "dialable" in the same Go semantic type (say "Reachable", as you have it now), using one assembler. Just add boolean fields "dialable" and "connected" to Reachable. And in the assembler, make a small adjustment to switch on the tag label.
Hey, @petar. I've adressed your comments and split the reachable tag into connected and dialable as suggested (I think it makes total sense to have it this way). Let me know if you have any additional feedback before merging. Thanks! |
Depends on: #20
This PR implements the
Reachable
smart tag. This smart tag detects if any of the entries of aSet
orDict
is a multiaddrs, and if it is, it checks their reachability. The smart tag only keeps multiaddrs that are reachable, discarding the rest. The rest of entries in the node which aren't multiaddrs are kept "as-is".