Skip to content

Commit bc7ad50

Browse files
committed
fix: use RFC 2119 terminology consistently
replace 'recommended' with appropriate SHOULD/MAY terms throughout the document for clarity and consistency with RFC 2119 conventions #497 (comment)
1 parent 48e5458 commit bc7ad50

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/routing/kad-dht.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ all nodes within that swarm must use it. Public DHT swarms MUST use a unique
7171
libp2p protocol identifier, whereas private swarms SHOULD use a distinct
7272
identifier. Although private swarms may reuse an identifier if their networks
7373
remain isolated, they will merge upon interaction. Therefore, unique
74-
identifiers are recommended.
74+
identifiers SHOULD be used.
7575

7676
#### Amino DHT
7777

@@ -260,7 +260,7 @@ their routing table originate from a diverse set of Autonomous System Numbers
260260
(ASNs). This measure helps mitigate Sybil attacks and enhances the network’s
261261
resilience.
262262

263-
A recommended approach is to impose the following limits:
263+
Implementations SHOULD impose the following limits:
264264

265265
* **Globally**, a maximum of `3` nodes sharing the same IP grouping should be
266266
allowed in the routing table.
@@ -282,13 +282,13 @@ representation within the table.
282282

283283
There are several strategies a DHT Server can use to verify that nodes in its
284284
Routing Table remain reachable. Implementations may choose their own methods,
285-
provided they avoid serving unresponsive nodes. One recommended strategy is to
285+
provided they avoid serving unresponsive nodes. The recommended strategy is to
286286
periodically refresh the Routing Table.
287287

288-
DHT Servers SHOULD perform a Routing Table Refresh every `10` minutes. During
289-
this process, the server sends a ping request to all nodes it hasn’t heard from
290-
recently (e.g in the last 5 minutes). Any peer that fails to respond MUST be
291-
removed from the Routing Table.
288+
When using periodic refresh, DHT Servers SHOULD perform a Routing Table Refresh
289+
every `10` minutes. During this process, the server sends a ping request to all
290+
nodes it hasn't heard from recently (e.g in the last 5 minutes). Any peer that
291+
fails to respond MUST be removed from the Routing Table.
292292

293293
After removing unresponsive peers, any buckets that are not full MUST be
294294
replenished with fresh, online peers. This can be accomplished by either adding
@@ -372,9 +372,9 @@ discarded.
372372
#### Termination
373373

374374
The resilience parameter (`β`) defines the number of closest reachable peers
375-
that must be successfully queried before a lookup is considered complete. It is
376-
recommended to set `β` to `3`, ensuring that multiple nodes confirm the lookup
377-
result for increased reliability.
375+
that must be successfully queried before a lookup is considered complete.
376+
Implementations SHOULD set `β` to `3`, ensuring that multiple nodes confirm the
377+
lookup result for increased reliability.
378378

379379
The lookup process continues until the `β` closest reachable peers to `kid`
380380
have been queried. However, the process MAY terminate earlier if the
@@ -387,8 +387,7 @@ A client MAY have multiple concurrent in-flight queries to distinct nodes for
387387
the same lookup. This behavior is specific to the client and does not affect
388388
how DHT servers operate.
389389

390-
It is recommended that the maximum number of in-flight requests (denoted by
391-
`α`) be set to `10`.
390+
The maximum number of in-flight requests (denoted by `α`) SHOULD be set to `10`.
392391

393392
## Peer Routing
394393

@@ -411,7 +410,7 @@ DHT clients that want to remain routable must ensure their multiaddresses are
411410
stored in the peerstore of the DHT Servers closest to them in XOR distance.
412411
Since peerstore entries expire over time, DHT Clients SHOULD periodically
413412
reconnect to their closest DHT servers to prevent their information from being
414-
removed. It is recommended to perform this reconnection every 10 minutes.
413+
removed. Implementations SHOULD perform this reconnection every 10 minutes.
415414

416415
When receiving a `FIND_NODE` request for a given Peer ID, DHT Servers MUST
417416
always respond with the information of that Peer ID, if it is included in their

0 commit comments

Comments
 (0)