rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

Kad PUT_VALUE response deviating from the spec

Open gmelodie opened this issue 1 month ago • 2 comments

Description

The spec says that a PUT_VALUE response message should have key and record fields set, however this implementaion does the following instead:

https://github.com/libp2p/rust-libp2p/blob/0125fa96b8de44ce3c3836a26339bfd9ba6db6fe/protocols/kad/src/protocol.rs#L326-L333

Motivation

It should follow the spec

Current Implementation

Uses key and value

Are you planning to do it yourself in a pull request?

Maybe

gmelodie avatar Nov 25 '25 18:11 gmelodie

We construct the record field when we build the actual protobuf: https://github.com/libp2p/rust-libp2p/blob/0125fa96b8de44ce3c3836a26339bfd9ba6db6fe/protocols/kad/src/protocol.rs#L434-L443

elenaf9 avatar Nov 25 '25 19:11 elenaf9

That seems correct to me indeed... I wonder why my nim parser failed to parse the response from rust-libp2p but succeeded when I had it talk to go-libp2p.

gmelodie avatar Nov 26 '25 13:11 gmelodie