kad: Query::next_action()
message is ignored by the kademlia handler
#230
Labels
enhancement
New feature or request
Query::next_action()
method returns aQueryAction
that contains a raw kademlia message.For the
FindNode
query type it is theFIND_NODE
message, forGetRecords
query type it is theGET_VALUE
message.litep2p/src/protocol/libp2p/kademlia/query/find_node.rs
Line 232 in e3a22d5
The message is ignored by the kademlia handler
on_query_action
method:litep2p/src/protocol/libp2p/kademlia/mod.rs
Lines 787 to 791 in e3a22d5
The following lines are ignoring the provided message, and sending the
FindNode
request regardless of the message provided:litep2p/src/protocol/libp2p/kademlia/mod.rs
Lines 700 to 707 in e3a22d5
The intention behind this behavior was to advance the discoverability of the network. For example,
GetRecords
query must first discover the network, then publish aGET_VALUE
request.Consider untangling the query message with the kademlia handler and to allow queries to decide which message should be sent.
We can further look into optimizing the number of messages sent from the query engine to the kademlia handler (since some of them may be redundant as in this case)
The text was updated successfully, but these errors were encountered: