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

Improve transport-settlement handshake. #271

Open
3 tasks
evanlinjin opened this issue Apr 5, 2019 · 2 comments
Open
3 tasks

Improve transport-settlement handshake. #271

evanlinjin opened this issue Apr 5, 2019 · 2 comments

Comments

@evanlinjin
Copy link

Depends on PR:#252

Description

We should depend on transport-discovery to settle transports, otherwise it may lead to some ambiguity. The following changes depend on deterministic Transport IDs (implemented within PR:#252).

The transport-settlement handshake SHOULD look as follows:

IMG_2327

Legend
TpDisc - Transport Discovery.
Init-er - Transport Initiating Node.
Resp-er - Transport Responder Node.
E - Transport Entry.
S - Signature.
TpID - Transport ID.
Wait(<v>) - Repetitively query until the resource is obtained.

The current implementation of the transport-settlement handshake works very similarly to the aforementioned. The only differences include:

  • The Resp-er replies with E+2S (Entry with two signatures) instead of TpID (Transport-ID).
  • The Resp-er does not wait for the TpDisc to have the entry submitted.

Further Notes

For the implementation, ensure that:

  • Only NEWLY-CREATED transports should go through the settlement-handshake. Always check the Transport Discovery whether the transport already has an entry. Both edges of the settlement-handshake should check this.
    • The Initiator should check with the Transport Discovery whether a settlement-handshake is needed.
    • The Responder should check the Transport Discovery whenever they Factory.Accept() a transport, if a settlement-handshake is required.

Tasks

  • Make the aforementioned changes.
  • Update tests.
  • Update Skywire Specifications.
@jdknives
Copy link
Member

@evanlinjin this should simplify the transport establishment. However, if the tpID is deterministic, then why would Resp-er even respond with the tpID? Would that not just increase the number of messages?

@evanlinjin
Copy link
Author

@jdknives

  1. We need a way for Responder to inform Initiator that it accepts the request.
  2. Given the assumption that Responder will always agree to establish the transport, the alternate solution would be to have Initiator repetitively poll tpDisc as it awaits the confirmation of the Entry being submitted. Or have Initiator request tpDisc with a timeout, and the tpDisc keeps the connection with Initiator open until the Entry is submitted by Responder. I am not a fan of either of these solutions as it adds more logic and complexity than what I have suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

3 participants