Understanding guarantees of the improved IPNS over pubsub

I found it’s actually supported by the ipfs cmd.

:+1:

I just tested, republishing a valid old record will revert ipns record, DHT can’t tell which one is newer

The DHT can tell which one is newer based on the sequence numbers in the records and will reject older records. The code that does that is here https://github.com/ipfs/go-ipns/blob/5976a80227cc5199414119585cca347bc814647a/record.go#L103 and https://github.com/libp2p/go-libp2p-kad-dht/blob/57a258ff447b13a34ee75c2de13911d98fa0706c/handlers.go#L195

I’m not sure exactly how you crafted and published your records but if you try and do an ipfs dht put with an old record your node won’t even publish it and you’ll get

ipfs dht put /ipns/YOUR_KEY ipns_record
Error: can't replace a newer value with an older value