Skip to content

Commit

Permalink
circuitv2: clarify what to do when data limit is reached (#526)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Prithvi Shahi <[email protected]>
  • Loading branch information
3 people authored Mar 23, 2023
1 parent 7530296 commit 6634ca7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion relay/circuit-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6634ca7

Please sign in to comment.