Commit Graph

8 Commits

Author SHA1 Message Date
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
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
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
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