43 Commits

Author SHA1 Message Date
Alex Potsides
6634ca7abb circuitv2: clarify what to do when data limit is reached (#526)
This documents the rust-libp2p behaviour when more data than is allowed is transferred over a relayed connection.  js-libp2p will take the same approach.  go-libp2p may need to be updated.

---------

Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Prithvi Shahi <50885601+p-shahi@users.noreply.github.com>
2023-03-23 15:49:37 +00:00
Alex Potsides
aac4e1f1c8 circuitv2: specify timestamp units for reservation expiration (#531)
The reservation expiration date is specified in seconds so be explicit about that in the spec in the same way we are explicit about the duration limit units.
2023-03-21 21:21:49 +13:00
Max Inden
c844f72e77 docs(relay-v2): Document that relayed conn is upgraded with sec and mux (#522) 2023-02-20 15:50:17 -08:00
Marco Munizaga
6fffda0e24 Update proto definition 2023-01-31 18:25:30 -08:00
Chinmay Kousik
4c3d32a327 update revision 2023-01-31 21:27:23 +05:30
Chinmay Kousik
0db6c537e0 update circuitv2 to proto3 2023-01-31 08:24:28 +05:30
Marco Munizaga
2e77be6f76 Merge pull request #506 from libp2p/marco/proto3
Recommend proto3
2023-01-23 10:24:22 -08:00
Danny Salman
1ec40b3f9c refactor: use rfc6890 special-purpose addresses (#505) 2023-01-23 15:02:20 +01:00
Marco Munizaga
c733210b3a Make existing protocols explicit about proto2 2023-01-20 17:13:13 -08:00
Danny Salman
946441e549 minor tweak to lifestyle doc phrase (#494) 2022-12-14 17:09:28 +01:00
Prithvi Shahi
cfcf0230b2 chore: update lifecycle and maturity (#484) 2022-11-27 18:35:02 -08:00
Kevin
0c40ec8856 *: Set PlantUML background color to white (#419)
Night owls had a hard time reading the diagrams included in these specs.
A white background ensures that all text is readable in dark mode as well.
2022-05-29 16:17:52 +02:00
Max Inden
70d7fda47d relay/circuit-v2: Make Reservation::expire as required (#384)
The Go implementation of the circuit relay v2 implementation treats the
`Reservation::expire` field as `required`:

``` Golang
result := &Reservation{}
result.Expiration = time.Unix(int64(rsvp.GetExpire()), 0)
if result.Expiration.Before(time.Now()) {
	return nil, fmt.Errorf("received reservation with expiration date in the past: %s", result.Expiration)
}
```

bfee9f5935/p2p/protocol/circuitv2/client/reservation.go (L88-L92)

Where `rsvp.GetExpire` returns `0` when `Reservation::expire` is not set:

``` Golang
func (m *Reservation) GetExpire() uint64 {
	if m != nil && m.Expire != nil {
		return *m.Expire
	}
	return 0
}
```

bfee9f5935/p2p/protocol/circuitv2/pb/circuit.pb.go (L414-L419)

While inexplicable to me why Go treats the non-set case equal to the default
value (`0`), we unfortunately have to take the go implementation as the source
of truth, given that it is already released.

With the above in mind and to prevent confusion for other implementations in
languages which do not treat the non-set case equal to the default value (`0`),
this commit marks the `Reservation::expire` field as `required`.
2021-12-19 15:30:26 +01:00
Thomas Eizinger
6f049f9c09 relay/circuit-v2: Do minor fixes (#382) 2021-12-09 10:12:10 +01:00
Aaron Surty
5e693a7ed1 Spelling (#378)
r/two many/too many
2021-12-08 12:05:33 -05:00
Marcin Rataj
6d5b84f1a0 chore: typo 2021-12-03 16:24:00 +01:00
Max Inden
ef4c029568 relay/DCUtR: Make message type field required (#375)
The `type` field of the DCUtR message definition should not be
`optional`, as a message without a `Type` is useless. Instead it should
be `required`.

See also circuit relay v2 specification using `required` for `type`.

```protobuf
message HopMessage {
  enum Type {
    RESERVE = 0;
    CONNECT = 1;
    STATUS = 2;
  }

  required Type type = 1;
```

```protobuf
message StopMessage {
  enum Type {
    CONNECT = 0;
    STATUS = 1;
  }

  required Type type = 1;
```
2021-11-22 21:18:31 +01:00
Mark Riise
500a7906dd Spelling (#372)
words
2021-10-17 02:52:19 -07:00
r-zig
591707373e Update circuit-v2.md
fix gstatus to status
2021-09-30 16:49:49 +03:00
Marten Seemann
d34653e70d add link to DCUtR to README 2021-09-04 03:08:19 -07:00
vyzo
689e5cb87c relay/DCUtR: Add Direct Connection Upgrade through Relay protocol (#173)
> In this specification, we describe a synchronization protocol for direct
connectivity with hole punching that eschews signaling servers and utilizes
existing relay connections instead.

Co-authored-by: Raúl Kripalani <raul@protocol.ai>
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2021-08-23 16:43:44 +02:00
vyzo
3d7385294c relay/: Add Circuit Relay v2 specification (#325)
* Specify the Circuit Relay v2 protocol.

* Move README.md specifying the Circuit Relay v1 protocol to circuit-v1.md

Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: raulk <raul@protocol.ai>
2021-06-29 21:06:55 +02:00
Max Inden
4480efe66c relay/README: Add rust-libp2p to list of implementations (#318) 2021-04-27 15:09:14 +02:00
tmakarios
eb094acabe relay: Use SUCCESS instead of OK for relay status code (#293) 2021-03-13 17:52:07 +01:00
Steven Allen
415fff2063 fix: finish ipfs -> p2p multiaddr switch
part of https://github.com/libp2p/libp2p/issues/79
2019-12-17 16:42:17 +01:00
Yusef Napora
bb345a2726 add header to circuit relay spec 2019-06-21 14:26:54 -04:00
Yusef Napora
33a2c49b42 remove dead link to rust relay impl 2019-03-21 11:07:01 -04:00
Whyrusleeping
cf16ffc62c Merge pull request #61 from libp2p/propose-relay-backoff
RFC: Add relay backoff code
2018-06-04 00:08:36 +08:00
Whyrusleeping
012ccbb6dc Add relay backoff code 2018-05-24 11:31:58 +01:00
James Ray
bf46bc41e3 Add a circuit relay link 2018-05-24 18:09:54 +10:00
Maciej Krüger
97b86236ce docs: Fix styling of relay error codes 2018-01-12 16:43:26 +01:00
Dmitriy Ryajov
b7c983e04f Amending error codes with a few more additions (#24)
* prefixing err codes with HOP/STOP to differentiate dup keys

* typo: srcPeer and destPeer are set in STOP, not STATUS

* relay: add STOP_RELAY_REFUSED and MALFORMED_MESSAGE

* document error codes 390 and 400
2017-11-12 17:19:32 +00:00
Dmitriy Ryajov
8dce468080 feat: adding an explicit CAN_HOP message type to allow passive relay discovery 2017-07-16 16:29:19 -07:00
David Dias
f8254b56f9 fix typos 2017-07-12 06:20:20 +01:00
Dmitriy Ryajov
77d8bdfde3 Adding Status enum 2017-07-09 13:33:46 -07:00
David Dias
8967cc11a9 apply review 2017-07-09 19:46:35 +01:00
David Dias
c1500a42eb spec: The circuit relay spec 2017-07-08 17:06:21 +01:00
Lars Gierth
f32ccac1de relay: add note about in-progress review and update (#20) 2017-05-23 08:53:28 -04:00
Hector Sanjuan
03e3fdce93 Clarify the difference between a tunnel and a relay (#8)
fix: make it clear that relay is not a raw tunnel.
2017-03-28 14:33:56 +01:00
Lars Gierth
76ff2cd0b3 relay: update multicodec and multiaddr 2017-02-21 18:32:19 +01:00
Lars Gierth
c69027543a Add js and go implementations 2017-02-21 18:29:53 +01:00
Lars Gierth
d76e2bc5a5 Fix circuit relay note syntax 2017-02-13 17:42:09 +01:00
David Dias
2f23667044 update location, links and name of the multicodec 2017-02-13 08:04:33 -08:00