From 5f58325468ab42c56142b8cd8b67eeeb3ee09fb8 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 21 Nov 2024 12:04:16 +0000 Subject: [PATCH 1/3] docs: clarify FIND_NODE response for DHT-client nodes If a node receives a `FIND_NODE` RPC call with a peer ID, it should return only closer DHT servers, unless it knows the peer ID in question, in which case it should include it, even if it is not a DHT server. --- kad-dht/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kad-dht/README.md b/kad-dht/README.md index 574a19eae..1bbd4fb1a 100644 --- a/kad-dht/README.md +++ b/kad-dht/README.md @@ -490,7 +490,9 @@ These are the requirements for each `MessageType`: * `FIND_NODE`: In the request `key` must be set to the binary `PeerId` of the node to be found. In the response `closerPeers` is set to the `k` closest - `Peer`s. + `Peer`s. Each closer peer will be a DHT server, unless `key` is an exact for + a peer known to the node, in which case the closer peers will include the + matching, non-server peer. * `GET_VALUE`: In the request `key` is an unstructured array of bytes. `record` is set to the value for the given key (if found in the datastore) and From c703141ac297427efc435954b702c00f1303a698 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 21 Nov 2024 12:10:38 +0000 Subject: [PATCH 2/3] chore: missed a word --- kad-dht/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kad-dht/README.md b/kad-dht/README.md index 1bbd4fb1a..c85b10010 100644 --- a/kad-dht/README.md +++ b/kad-dht/README.md @@ -490,8 +490,8 @@ These are the requirements for each `MessageType`: * `FIND_NODE`: In the request `key` must be set to the binary `PeerId` of the node to be found. In the response `closerPeers` is set to the `k` closest - `Peer`s. Each closer peer will be a DHT server, unless `key` is an exact for - a peer known to the node, in which case the closer peers will include the + `Peer`s. Each closer peer will be a DHT server, unless `key` is an exact match + for a peer known to the node, in which case the closer peers will include the matching, non-server peer. * `GET_VALUE`: In the request `key` is an unstructured array of bytes. `record` From fd862769760daf19f318d9db51bf6e2de61a6e19 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 21 Nov 2024 12:11:17 +0000 Subject: [PATCH 3/3] chore: clarify --- kad-dht/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kad-dht/README.md b/kad-dht/README.md index c85b10010..e31957b8b 100644 --- a/kad-dht/README.md +++ b/kad-dht/README.md @@ -492,7 +492,7 @@ These are the requirements for each `MessageType`: node to be found. In the response `closerPeers` is set to the `k` closest `Peer`s. Each closer peer will be a DHT server, unless `key` is an exact match for a peer known to the node, in which case the closer peers will include the - matching, non-server peer. + matching peer, even if it is not a DHT server. * `GET_VALUE`: In the request `key` is an unstructured array of bytes. `record` is set to the value for the given key (if found in the datastore) and