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

Implements Reachable Smart Tag #22

Merged
merged 31 commits into from
May 25, 2021
Merged

Implements Reachable Smart Tag #22

merged 31 commits into from
May 25, 2021

Conversation

adlrocha
Copy link
Contributor

Depends on: #20

This PR implements the Reachable smart tag. This smart tag detects if any of the entries of a Set or Dict 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".

  • Reachable smart tag.
  • Updates assembleContext to include host.
  • Basic tests

@adlrocha adlrocha requested a review from petar May 10, 2021 10:30
@adlrocha
Copy link
Contributor Author

@petar, I will do a final review after lunch, but I think this is also ready for review. Thanks!

@adlrocha adlrocha mentioned this pull request May 12, 2021
9 tasks
vm/gc.go Outdated Show resolved Hide resolved
ir/base/reachable.go Outdated Show resolved Hide resolved
// 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())
Copy link
Collaborator

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.

@adlrocha
Copy link
Contributor Author

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!

@adlrocha adlrocha merged commit 101f43a into petar/p1 May 25, 2021
@adlrocha adlrocha deleted the feat/tag-reachable branch May 25, 2021 15:56
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.

2 participants