-
Notifications
You must be signed in to change notification settings - Fork 942
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protocols/dcutr/examples: Wait to tell relay its public addr (#2659)
As a listening client, when requesting a reservation with a relay, the relay responds with its public addresses. The listening client can then use the public addresses of the relay to advertise itself as reachable under a relayed address (`/<public-relay-addr>/p2p-circuit/p2p/<listening-client-peer-id>`). The above operates under the assumption that the relay knows its public address. A relay learns its public address from remote peers, via the identify protocol. In the case where the relay just started up, the listening client might be the very first node to connect to it. Such scenario allows for a race condition. The listening client requests a reservation from the relay, while the relay requests its public address from the listening client. The former needs to contain the response from the latter. This commit serializes the two requests, making sure, in the case of a freshly started relay, that the listening client tells the relay its public address before requesting a reservation from the relay. Co-authored-by: Elena Frank <elena.frank@protonmail.com>
- Loading branch information
Showing
2 changed files
with
34 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters