-
Notifications
You must be signed in to change notification settings - Fork 89
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
Update hopr-connect to automatically relay whenever intermediate node has no direct connection to recipient #1494
Comments
Isn't this a standard feature of what hopr-connect is doing for about half a year now? If not, what's the difference? |
@SCBuergel this is done only using the bootstrap server, see https://github.com/hoprnet/hopr-connect/blob/main/src/index.ts#L86. The goal is that it can be any node. |
I find this scope hard to tackle - it's too big for a normal issue so I'd break it down into manageable parts(and e.g. take the incentivized transport-level incentivization out). If this is a full-blown HIP, then I'd need a clearer Spec and Rationale to comment on it. |
@SCBuergel Please check the “Additional notes”. The “HIP” is already defined in #1495. In case this wasn't clear before, within the DEADR proposal (Decentralized Entry Advertisement & Distributed Relaying), the This is not complex, if anything, it's complicated. At most, we need to:
In the chat, we are discussing with @peterbraden we can start with a naive approach (for looping all nodes), and then decide on better heuristics when needed. |
Implemented in HoprConnect, but changing slight details:
Incentivizing nodes for providing signaling services (such as STUN) to other nodes as well as relaying services (such as TURN) is currently out of scope. |
As discussed with @robertkiel since the amount of work needed for relaying is minimal compared to mixing, for now there are no practical incentives for nodes to relay other than a perceptual increase in connectivity in the network. We might explore this afterwards. Since everything else was completed and documented, this issue can now be closed. |
Introduction
Whenever possible,
hopr-connect
tries to establish a direct connection between nodes. The entire spec can be seen in the libp2p repository. However, it will be inevitable that some nodes will eventually fail to ever achieve direct connection.As a workaround, we are looking to use the concept of “Decentralized Relay”, where another node that has a successful connection in the network to the final recipient of the packet is used in exchange.
Let's take the normal example, where a node (
bob
) is used as an intermediate byalice
to send a message tocharlie
. In this case,bob
has both a payment channel opened tocharlie
, and can reach it directly.However, there could be a case where
bob
has indeed agreed to relay tocharlie
, but for some reason, it's unable to reachcharlie
. In such case,bob
can usemonica
and relay the packet instead.Task Description
monica
to actually relay the package tocharlie
, considering that a)monica
has no payment channel tocharlie
andbob
will be the receiver of the ticket, notmonica
n -> m
connections from the DHT, such as it's not only possible to know what other nodes are in the network, but the next immediate nodes such nodes have (this would mean to build a tree with a depth level of 1)hopr-connect
to lookup within ourn -> m
tree other registered nodes whenever a failed connection happens, such as givena -> b -> c
, ifb[x -> c]
exists, andb -> c
fails, we can usex -> c
.Additional notes
See #1495. The “DR” in DEADR refers to this in particular.
Multiple assumptions were made on the task description, in particular,
n -> m
structure is something that does not exist, and should be implementedn -> m
has O(log)n with a maximum depth of 1 on lookup and writingThe text was updated successfully, but these errors were encountered: