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

gossipsub: Lazy sending

Open arnetheduck opened this issue 1 year ago • 34 comments

Consider:

  • peer A sends a message to us which is sent to validation - peer B sends the same message to us and when the message validates, we skip sending it to peer B
  • however, we still send the data to peer C and D
  • sending data to peed C takes time - for example, streaming 1mb to peer C takes 1s on a 10mbit line
  • peer D completes sending the same message to us

In the above, we can skip sending to peer D as well - to make this work:

  • track the completion of "sending" to peer C
  • when the future completes, check if sending to D is still relevant

Problems:

  • C might be slow which increases latency of sending to D
    • send to Dmin peers, then use lazy sending for the rest

arnetheduck avatar Jan 23 '23 21:01 arnetheduck