Our code however uses a seq for topics, likely due to implementing an ancient version of the protocol no longer in use (it used to be repeated long ago - this is both wrong (when sending messages) and increases code complexity.
On incoming messages, we should require at least one topic, and if there are multiple topics in the incoming message, send to only the last one (this is how protobuf decoding of required works if there are multiple values for the same field).
Per the floodsub spec, a message has only one (mandatory) topic:
https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-message
Our code however uses a
seq
for topics, likely due to implementing an ancient version of the protocol no longer in use (it used to berepeated
long ago - this is both wrong (when sending messages) and increases code complexity.On incoming messages, we should require at least one topic, and if there are multiple topics in the incoming message, send to only the last one (this is how protobuf decoding of required works if there are multiple values for the same field).