From 6634ca7abb2f955645243d48d1cd2fd02a8e8880 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 23 Mar 2023 15:49:37 +0000 Subject: [PATCH] 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 Co-authored-by: Prithvi Shahi <50885601+p-shahi@users.noreply.github.com> --- relay/circuit-v2.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/relay/circuit-v2.md b/relay/circuit-v2.md index 4fa9800..155e574 100644 --- a/relay/circuit-v2.md +++ b/relay/circuit-v2.md @@ -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