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>
This commit is contained in:
Alex Potsides
2023-03-23 15:49:37 +00:00
committed by GitHub
parent 7530296745
commit 6634ca7abb

View File

@@ -4,7 +4,7 @@ This is the version 2 of the libp2p Circuit Relay protocol.
| Lifecycle Stage | Maturity | Status | Latest Revision |
| --------------- | -------------- | ------ | --------------- |
| 3A | Recommendation | Active | r2, 2023-01-31 |
| 3A | Recommendation | Active | r3, 2023-02-28 |
Authors: [@vyzo]
@@ -255,6 +255,16 @@ accidental termination according to its connection management policy.
If a relay server becomes overloaded however, it may still drop a
connection with reservations in order to maintain its resource quotas.
If more data than the limit specified in the `data` field is transferred
over the relayed connection, or the relayed connection has been open for
longer than `duration`, the relay should reset the stream to the source
and the stream to the destination.
If the reservation for the connection has expired then the relay may
apply any connection management policy to the connection as normal otherwise
it should retain the connection, unless doing so would prevent it from
maintaining its resource quotas.
***Note: Implementations _should not_ accept reservations over already relayed connections.***
#### Connection Initiation