libp2p / jvm-libp2p

a libp2p implementation for the JVM, written in Kotlin 🔥
https://libp2p.io
Apache License 2.0
260 stars 74 forks source link

Set topicID on outbound IHAVE and ignore inbound IHAVE for unknown topic #365

Closed StefanBratanov closed 3 months ago

StefanBratanov commented 3 months ago

fixes https://github.com/libp2p/jvm-libp2p/issues/361

Nashatyrev commented 3 months ago

I think we would need to group IHAVEs in the resulting message produced by GossipRpcPartsQueue else we might get significant message size overhead

StefanBratanov commented 3 months ago

I think we would need to group IHAVEs in the resulting message produced by GossipRpcPartsQueue else we might get significant message size overhead

Isn't that what the GossipRouter does in emitGossip on a heartbeat and only then enqueues it?

val shuffledMessageIds = ids.shuffled(random).take(params.maxIHaveLength)

I suppose we could be more efficient when flushing the queue. Is it worth to make this improvement a separate PR?

Nashatyrev commented 3 months ago

Please check here: https://github.com/StefanBratanov/jvm-libp2p/pull/1 Fixing the case has also addressed the grouping question

StefanBratanov commented 3 months ago

Please check here: StefanBratanov#1 Fixing the case has also addressed the grouping question

Thanks. I agree with the change. I have missed that part. Thanks.

Nashatyrev commented 3 months ago

Added another minor improvement